diff options
author | Harald Welte <laforge@osmocom.org> | 2021-05-21 21:48:11 +0200 |
---|---|---|
committer | Harald Welte <laforge@osmocom.org> | 2021-05-25 09:43:13 +0200 |
commit | e7506036bd94856499f755537c87d094e52c9458 (patch) | |
tree | b514967fe2a5f0e59ed989679f34db9539c6f449 /tests | |
parent | c1475307c85db0289d44bef7482b4c75d5a0de92 (diff) |
Introduce unit test for bertlv_parse_one()
Change-Id: I3adbe22afd4b6503a7454de39b7663e9ede8995f
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/test_utils.py | 4 |
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() |