-
Notifications
You must be signed in to change notification settings - Fork 2
/
test.py
68 lines (57 loc) · 2.18 KB
/
test.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# Standard Library
import unittest
# First-Party
from EAS2Text import EAS2Text
class TestEAS2Text(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.EASString = "ZCZC-EAS-RWT-055079+0015-0012345-SOFTTEST-"
cls.EASData = EAS2Text(cls.EASString)
def testRawOrg(self):
self.assertIsNotNone(self.EASData.org, "Raw Originator Code Missing!")
self.assertIsInstance(
self.EASData.org, str, "Raw Originator Code Not String!"
)
self.assertEqual(
self.EASData.org, "EAS", "Raw Originator Code Incorrect!"
)
def testRawEvnt(self):
self.assertIsNotNone(self.EASData.evnt, "Raw Event Code Missing!")
self.assertIsInstance(
self.EASData.evnt, str, "Raw Event Code Not String!"
)
self.assertEqual(self.EASData.evnt, "RWT", "Raw Event Code Incorrect!")
def testRawFips(self):
self.assertIsNotNone(self.EASData.FIPS, "Raw FIPS Code(s) Missing!")
self.assertIsInstance(
self.EASData.FIPS, list, "Raw FIPS Code(s) Not List!"
)
self.assertEqual(
self.EASData.FIPS, ["055079"], "Raw FIPS Code(s) Incorrect!"
)
def testRawPurge(self):
self.assertIsNotNone(self.EASData.purge, "Raw Purge Time Missing!")
self.assertIsInstance(
self.EASData.purge, list, "Raw Purge Time Not List!"
)
self.assertEqual(
self.EASData.purge, ["00", "15"], "Raw Purge Time Incorrect!"
)
def testRawTimeStamp(self):
self.assertIsNotNone(self.EASData.timeStamp, "Raw Time Stamp Missing!")
self.assertIsInstance(
self.EASData.timeStamp, str, "Raw Time Stamp Not String!"
)
self.assertEqual(
self.EASData.timeStamp, "0012345", "Raw Time Stamp Incorrect!"
)
def testRawCallsign(self):
self.assertIsNotNone(self.EASData.callsign, "Callsign Missing!")
self.assertIsInstance(
self.EASData.callsign, str, "Callsign Not String!"
)
self.assertEqual(
self.EASData.callsign, "SOFTTEST", "Callsign Incorrect!"
)
if __name__ == "__main__":
unittest.main()