laforge has uploaded this change for review.

View Change

cdma_ruim: Fix unit tests and actually enable them

As pySim.cdma_ruim was not imported by test_files.py, the unit tests
were apparently never executed and hence didn't pass. Let's fix both
of those problems.

Change-Id: Icdf4621eb68d05a4948ae9efeb81a007d48e1bb7
---
M pySim/cdma_ruim.py
M tests/test_files.py
2 files changed, 17 insertions(+), 3 deletions(-)

git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/04/33704/1
diff --git a/pySim/cdma_ruim.py b/pySim/cdma_ruim.py
index 3fab558..6556600 100644
--- a/pySim/cdma_ruim.py
+++ b/pySim/cdma_ruim.py
@@ -91,7 +91,7 @@

_test_de_encode = [
( "010801536b796c696e6b204e57ffffffffffffffffffffffffffffffffffffffffffff",
- { 'rfu0' : 0, 'show_in_hsa' : True, 'rfu2' : 0,
+ { 'rfu1' : 0, 'show_in_hsa' : True, 'rfu2' : 0,
'char_encoding' : 8, 'lang_ind' : 1, 'spn' : 'Skylink NW' } ),
]

@@ -115,7 +115,7 @@
'''3.4.33 Administrative Data'''

_test_de_encode = [
- ( "000000", { 'ms_operation_mode' : 'normal', 'additional_info' : '0000', 'rfu' : '' } ),
+ ( "000000", { 'ms_operation_mode' : 'normal', 'additional_info' : '0000', 'rfu' : b'' } ),
]

class OP_MODE(enum.IntEnum):
@@ -133,7 +133,7 @@
# Byte 1: Display Condition
'ms_operation_mode'/Enum(Byte, self.OP_MODE),
# Bytes 2-3: Additional information
- 'additional_info'/Bytes(2),
+ 'additional_info'/HexAdapter(Bytes(2)),
# Bytes 4..: RFU
'rfu'/GreedyBytesRFU,
)
diff --git a/tests/test_files.py b/tests/test_files.py
index 3fb1062..fe520fb 100755
--- a/tests/test_files.py
+++ b/tests/test_files.py
@@ -29,6 +29,7 @@
import pySim.ts_51_011
import pySim.sysmocom_sja2
import pySim.gsm_r
+import pySim.cdma_ruim

def get_qualified_name(c):
"""return the qualified (by module) name of a class."""

To view, visit change 33704. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Icdf4621eb68d05a4948ae9efeb81a007d48e1bb7
Gerrit-Change-Number: 33704
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge@osmocom.org>
Gerrit-MessageType: newchange