Skip to content

Commit

Permalink
update csbk test to dmr-kaitai>=0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
smarek committed Feb 18, 2022
1 parent c3b36a2 commit 2b32d52
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
18 changes: 13 additions & 5 deletions okdmr/tests/dmrlib/etsi/fec/test_bptc_196_96.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,14 @@ def test_bptc1969_decode_map_against_dmr_utils3():
def test_decode_mmdvm2020_csbks():
packets: Dict[str, Dict[str, Any]] = {
"444d52440223383b2338630006690f632e40c70153df0a83b7a8282c2509625014fdff57d75df5dcadde429028c87ae3341e24191c003c": {
"preamble_csbk_blocks_to_follow": 29,
"preamble_data_or_csbk": DmrCsbk.CsbkDataOrCsbk.data_content_follows_preambles,
"preamble_source_address": 2308155,
"preamble_target_address": 2308195,
"csbk_data": {
"preamble_csbk_blocks_to_follow": 29,
"preamble_data_or_csbk": DmrCsbk.CsbkDataOrCsbk.data_content_follows_preambles,
"source_address": 2308155,
"target_address": 2308195,
},
"feature_set_id": 0,
"csbk_opcode": DmrCsbk.CsbkoTypes.preamble,
}
}
for packet, testdata in packets.items():
Expand All @@ -86,7 +89,12 @@ def test_decode_mmdvm2020_csbks():
assert burst.slot_type.data_type == DataTypes.CSBK
csbk: DmrCsbk = DmrCsbk.from_bytes(burst.info_bits_deinterleaved.tobytes())
for propname, value in testdata.items():
assert getattr(csbk, propname) == value
if isinstance(value, dict):
target = getattr(csbk, propname)
for subpropname, subvalue in value.items():
assert getattr(target, subpropname) == subvalue
else:
assert getattr(csbk, propname) == value


def test_decode_encode():
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
dmr-kaitai>=0.8
dmr-kaitai>=0.9
bitarray>=2.3.6
numpy>=1.21.4
# for testing
Expand Down

0 comments on commit 2b32d52

Please sign in to comment.