mirror of
https://gitea.osmocom.org/sim-card/pysim.git
synced 2026-03-23 05:48:34 +03:00
utils: fix dec_xplmn_w_act() and format_xplmn_w_act()
The function dec_xplmn_w_act(), which is also used by format_xplmn_w_act() is using integer numbers as MCC/MNC representation. This causes various problems since the information about leading zeros gets lost. Change-Id: I57f7dff80f48071ef9a3732ae1088882b127a6d4
This commit is contained in:
@@ -96,13 +96,13 @@ class DecTestCase(unittest.TestCase):
|
||||
self.assertEqual(utils.dec_act("ffff"), ["UTRAN", "E-UTRAN", "GSM", "GSM COMPACT", "cdma2000 HRPD", "cdma2000 1xRTT"])
|
||||
|
||||
def testDecxPlmn_w_act(self):
|
||||
expected = {'mcc': 295, 'mnc': 10, 'act': ["UTRAN"]}
|
||||
expected = {'mcc': '295', 'mnc': '10', 'act': ["UTRAN"]}
|
||||
self.assertEqual(utils.dec_xplmn_w_act("92f5018000"), expected)
|
||||
|
||||
def testFormatxPlmn_w_act(self):
|
||||
input_str = "92f501800092f5508000ffffff0000ffffff0000ffffff0000ffffff0000ffffff0000ffffff0000ffffff0000ffffff0000"
|
||||
expected = "\t92f5018000 # MCC: 295 MNC: 010 AcT: UTRAN\n"
|
||||
expected += "\t92f5508000 # MCC: 295 MNC: 005 AcT: UTRAN\n"
|
||||
expected = "\t92f5018000 # MCC: 295 MNC: 10 AcT: UTRAN\n"
|
||||
expected += "\t92f5508000 # MCC: 295 MNC: 05 AcT: UTRAN\n"
|
||||
expected += "\tffffff0000 # unused\n"
|
||||
expected += "\tffffff0000 # unused\n"
|
||||
expected += "\tffffff0000 # unused\n"
|
||||
|
||||
Reference in New Issue
Block a user