aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2021-05-21 21:48:11 +0200
committerHarald Welte <laforge@osmocom.org>2021-05-25 09:43:13 +0200
commite7506036bd94856499f755537c87d094e52c9458 (patch)
treeb514967fe2a5f0e59ed989679f34db9539c6f449 /tests
parentc1475307c85db0289d44bef7482b4c75d5a0de92 (diff)
Introduce unit test for bertlv_parse_one()
Diffstat (limited to 'tests')
-rwxr-xr-xtests/test_utils.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/test_utils.py b/tests/test_utils.py
index 24f0fc9..17a9300 100755
--- a/tests/test_utils.py
+++ b/tests/test_utils.py
@@ -175,6 +175,10 @@ class TestBerTlv(unittest.TestCase):
self.assertEqual(utils.bertlv_parse_len(b'\x81\x80'), (128, b''))
self.assertEqual(utils.bertlv_parse_len(b'\x83\x12\x34\x56\x78'), (0x123456, b'\x78'))
+ def test_BerTlvParseOne(self):
+ res = utils.bertlv_parse_one(b'\x81\x01\x01');
+ self.assertEqual(res, ({'tag':1, 'constructed':False, 'class':2}, 1, b'\x01', b''))
+
if __name__ == "__main__":
unittest.main()