-
Notifications
You must be signed in to change notification settings - Fork 1
/
test_comp.py
39 lines (30 loc) · 1.24 KB
/
test_comp.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# pylint: disable=no-member
import datetime
import os
import unittest
from typing_extensions import ClassVar
from sr.comp.comp import SRComp
DUMMY_PATH = os.path.dirname(os.path.abspath(__file__)) + '/dummy'
class CompTests(unittest.TestCase):
srcomp_instance = NotImplemented # type: ClassVar[SRComp]
@classmethod
def setUpClass(cls) -> None:
cls.srcomp_instance = SRComp(DUMMY_PATH)
def test_load(self) -> None:
"Test that loading the dummy state works"
self.assertIsNotNone(self.srcomp_instance.root)
self.assertIsNotNone(self.srcomp_instance.state)
self.assertIsNotNone(self.srcomp_instance.teams)
self.assertIsNotNone(self.srcomp_instance.schedule)
self.assertIsNotNone(self.srcomp_instance.scores)
self.assertIsNotNone(self.srcomp_instance.arenas)
self.assertIsNotNone(self.srcomp_instance.corners)
self.assertIsInstance(self.srcomp_instance.awards, dict)
def test_timezone(self) -> None:
# Test that one can get the timezone from the dummy state
self.assertEqual(
datetime.timedelta(seconds=3600),
self.srcomp_instance.timezone.utcoffset(
datetime.datetime(2014, 4, 26),
),
)