mirror of
https://github.com/BOSWatch/BW3-Core.git
synced 2026-04-08 07:43:57 +00:00
edit tests
This commit is contained in:
parent
f14a78984a
commit
0c7fc84089
6 changed files with 74 additions and 72 deletions
|
|
@ -21,25 +21,25 @@ from boswatch.decoder import decoder
|
|||
class Test_Decoder:
|
||||
"""!Unittests for the decoder"""
|
||||
|
||||
def test_decoder_no_data(self):
|
||||
def test_decoderNoData(self):
|
||||
"""!Test a empty string"""
|
||||
assert decoder.getDecoder("").decode("") is None
|
||||
|
||||
def test_decoder_zvei_valid(self):
|
||||
def test_decoderZveiValid(self):
|
||||
"""!Test valid ZVEI"""
|
||||
dec = decoder.getDecoder("ZVEI")
|
||||
assert not dec.decode("ZVEI1: 12345") is None
|
||||
assert not dec.decode("ZVEI1: 12838") is None
|
||||
assert not dec.decode("ZVEI1: 34675") is None
|
||||
|
||||
def test_decoder_zvei_doubleTone(self):
|
||||
def test_decoderZveiDoubleTone(self):
|
||||
"""!Test doubleTone included ZVEI"""
|
||||
dec = decoder.getDecoder("ZVEI")
|
||||
assert not dec.decode("ZVEI1: 6E789") is None
|
||||
assert not dec.decode("ZVEI1: 975E7") is None
|
||||
assert not dec.decode("ZVEI1: 2E87E") is None
|
||||
|
||||
def test_decoder_zvei_invalid(self):
|
||||
def test_decoderZveiInvalid(self):
|
||||
"""Test invalid ZVEI"""
|
||||
dec = decoder.getDecoder("ZVEI")
|
||||
assert dec.decode("ZVEI1: 1245A") is None
|
||||
|
|
@ -48,7 +48,7 @@ class Test_Decoder:
|
|||
assert dec.decode("ZVEI1: 54") is None
|
||||
assert dec.decode("ZVEI1: 54") is None
|
||||
|
||||
def test_decoder_pocsag_valid(self):
|
||||
def test_decoderPocsagValid(self):
|
||||
"""!Test valid POCSAG"""
|
||||
dec = decoder.getDecoder("POCSAG")
|
||||
assert not dec.decode("POCSAG512: Address: 1000000 Function: 0") is None
|
||||
|
|
@ -56,7 +56,7 @@ class Test_Decoder:
|
|||
assert not dec.decode("POCSAG1200: Address: 1000002 Function: 2") is None
|
||||
assert not dec.decode("POCSAG2400: Address: 1000003 Function: 3") is None
|
||||
|
||||
def test_decoder_pocsag_text(self):
|
||||
def test_decoderPocsagText(self):
|
||||
"""!Test POCSAG with text"""
|
||||
dec = decoder.getDecoder("POCSAG")
|
||||
assert not dec.decode("POCSAG512: Address: 1000000 Function: 0 Alpha: test") is None
|
||||
|
|
@ -64,7 +64,7 @@ class Test_Decoder:
|
|||
assert not dec.decode("POCSAG1200: Address: 1000002 Function: 2 Alpha: test") is None
|
||||
assert not dec.decode("POCSAG2400: Address: 1000003 Function: 3 Alpha: test") is None
|
||||
|
||||
def test_decoder_pocsag_short(self):
|
||||
def test_decoderPocsagShortRic(self):
|
||||
"""!Test short POCSAG"""
|
||||
dec = decoder.getDecoder("POCSAG")
|
||||
assert not dec.decode("POCSAG512: Address: 3 Function: 0 Alpha: test") is None
|
||||
|
|
@ -75,14 +75,14 @@ class Test_Decoder:
|
|||
assert not dec.decode("POCSAG2400: Address: 333333 Function: 0 Alpha: test") is None
|
||||
assert not dec.decode("POCSAG2400: Address: 3333333 Function: 0 Alpha: test") is None
|
||||
|
||||
def test_decoder_pocsag_invalid(self):
|
||||
def test_decoderPocsagInvalid(self):
|
||||
"""!Test invalid POCSAG"""
|
||||
dec = decoder.getDecoder("POCSAG")
|
||||
assert dec.decode("POCSAG512: Address: 333333F Function: 0 Alpha: invalid") is None
|
||||
assert dec.decode("POCSAG512: Address: 333333F Function: 1 Alpha: invalid") is None
|
||||
assert dec.decode("POCSAG512: Address: 3333333 Function: 4 Alpha: invalid") is None
|
||||
|
||||
def test_decoder_fms_valid(self):
|
||||
def test_decoderFmsValid(self):
|
||||
"""!Test valid FMS"""
|
||||
dec = decoder.getDecoder("FMS")
|
||||
assert not dec.decode("""FMS: 43f314170000 (9=Rotkreuz 3=Bayern 1 Ort 0x25=037FZG 7141Status 3=Einsatz Ab 0=FZG->LST 2=I (ohneNA,ohneSIGNAL)) CRC correct""") is None
|
||||
|
|
@ -91,7 +91,7 @@ class Test_Decoder:
|
|||
assert not dec.decode("""FMS: 43f314170000 (9=Rotkreuz 3=Bayern 1 Ort 0x25=037FZG 7141Status 3=Einsatz Ab 1=LST->FZG 2=III(mit NA,ohneSIGNAL)) CRC correct""") is None
|
||||
assert not dec.decode("""FMS: 43f314170000 (9=Rotkreuz 3=Bayern 1 Ort 0x25=037FZG 7141Status 3=Einsatz Ab 0=FZG->LST 2=IV (mit NA,mit SIGNAL)) CRC correct""") is None
|
||||
|
||||
def test_decoder_fms_invalid(self):
|
||||
def test_decoderFmsInvalid(self):
|
||||
"""!Test invalid FMS"""
|
||||
dec = decoder.getDecoder("FMS")
|
||||
assert dec.decode("""FMS: 14170000 (9=Rotkreuz 3=Bayern 1 Ort 0x25=037FZG 7141Status 3=Einsatz Ab 1=LST->FZG 2=III(mit NA,ohneSIGNAL)) CRC correct""") is None
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue