Change in pysim[master]: Introduce unit test for bertlv_parse_one()

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Sun May 23 14:29:37 UTC 2021


laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/24348 )


Change subject: Introduce unit test for bertlv_parse_one()
......................................................................

Introduce unit test for bertlv_parse_one()

Change-Id: I3adbe22afd4b6503a7454de39b7663e9ede8995f
---
M tests/test_utils.py
1 file changed, 4 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/48/24348/1

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 @@
         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()

-- 
To view, visit https://gerrit.osmocom.org/c/pysim/+/24348
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I3adbe22afd4b6503a7454de39b7663e9ede8995f
Gerrit-Change-Number: 24348
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210523/2acc9625/attachment.htm>


More information about the gerrit-log mailing list