test_files: Test decoder also with ff-padded input
It's customary in the SIM card universe to right-pad data with ff bytes.
So far we only test decoders without such padding, which is unrealistic.
Let's also tests the decoders with extra 'ff' padding present.
For some files this doesn't make sense, so we add a _test_no_pad class
attribute that can be spcified to prevent this new "test with ff-padding"
from being executed for the test data of the class.
Change-Id: I7f5cbb4a6f91040fe9adef9da0a1f30f9f156dae
diff --git a/pySim/ts_31_102.py b/pySim/ts_31_102.py
index cce6f35..1976ae0 100644
--- a/pySim/ts_31_102.py
+++ b/pySim/ts_31_102.py
@@ -526,6 +526,7 @@
"marine_guard": False, "mountain_rescue": False,
"manual_ecall": False, "automatic_ecall": False } } ),
]
+ _test_no_pad = True
cc_construct = BcdAdapter(Rpad(Bytes(3)))
category_construct = FlagsEnum(Byte, police=1, ambulance=2, fire_brigade=3, marine_guard=4,
mountain_rescue=5, manual_ecall=6, automatic_ecall=7)
@@ -588,6 +589,8 @@
"prose_services": False, "extended_drx": False },
"rfu": 0, "mnc_len": 2, "extensions": b'' } ),
]
+ _test_no_pad = True
+
class OP_MODE(enum.IntEnum):
normal = 0x00
type_approval = 0x80