-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_AISDictionary.py
37 lines (25 loc) · 1.16 KB
/
test_AISDictionary.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
from unittest import TestCase
from AISDictionary import AISDictionaries
class TestAISDictionaries(TestCase):
def test_make_stream(self):
self.fail()
def test_makebinpayload(self):
self.fail()
def test_get_payload_armour(self):
self.fail()
def test_char_to_binary(self):
# take in single text character and compares to nibble
# sequences through dictionary nibble_to_text
diction = AISDictionaries()
for nibble, text in diction.nibble_to_text.items():
print('test char -> binary nibble text', nibble, text)
outstring = diction.char_to_binary(text)
self.assertEqual(nibble, outstring, "Failed in char_to_binary")
def test_binary_to_char(self) -> str:
# take in binary nibble and present single text character back
# sequences through dictionary nibble_to_text
diction = AISDictionaries()
for nibble,text in diction.nibble_to_text.items():
print('test binary -> char nibble text', nibble, text)
outstring = diction.binary_to_char(nibble)
self.assertEqual(text, outstring, "Failed in binary_to_char")