From e1d059e4f5b6769bb243e8449195003816c8892e Mon Sep 17 00:00:00 2001 From: Song Guo Date: Tue, 7 Mar 2023 16:32:13 +0800 Subject: [PATCH] Update --- .../python/test/unit_tests/test_tlv.py | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/controller/python/test/unit_tests/test_tlv.py b/src/controller/python/test/unit_tests/test_tlv.py index 12d5bb4f7ecb11..7a80b24c497320 100644 --- a/src/controller/python/test/unit_tests/test_tlv.py +++ b/src/controller/python/test/unit_tests/test_tlv.py @@ -167,9 +167,11 @@ def test_uint(self): def test_structure(self): test_cases = [ - (b'\x15\x36\x01\x15\x35\x01\x26\x00\xBF\xA2\x55\x16\x37\x01\x24\x02\x00\x24\x03\x28\x24\x04\x00\x18\x24\x02\x01\x18\x18\x18\x18', + (b'\x15\x36\x01\x15\x35\x01\x26\x00\xBF\xA2\x55\x16\x37\x01\x24' + b'\x02\x00\x24\x03\x28\x24\x04\x00\x18\x24\x02\x01\x18\x18\x18\x18', {1: [{1: {0: 374710975, 1: TLVList([(2, 0), (3, 40), (4, 0)]), 2: 1}}]}), - (b'\x156\x01\x155\x01&\x00\xBF\xA2U\x167\x01$\x02\x00$\x03($\x04\x01\x18,\x02\x18Nordic Semiconductor ASA\x18\x18\x18\x18', + (b'\x156\x01\x155\x01&\x00\xBF\xA2U\x167\x01$\x02\x00$\x03($\x04\x01' + b'\x18,\x02\x18Nordic Semiconductor ASA\x18\x18\x18\x18', {1: [{1: {0: 374710975, 1: TLVList([(2, 0), (3, 40), (4, 1)]), 2: 'Nordic Semiconductor ASA'}}]}), (b"\0256\001\0255\001&\000\031\346x\2077\001$\002\001$\003\006$\004\000\030(\002\030\030\030\030", {1: [{1: {0: 2272847385, 1: TLVList([(2, 1), (3, 6), (4, 0)]), 2: False}}]}) @@ -196,20 +198,20 @@ def test_list(self): class TestTLVTypes(unittest.TestCase): def test_list(self): - l = TLVList([(None, 1), (None, 2), (1, 3)]) - self.assertEqual(l[1], 3) - self.assertEqual(l[TLVList.IndexMethod.Index:0], (None, 1)) - self.assertEqual(l[TLVList.IndexMethod.Tag:1], 3) + var = TLVList([(None, 1), (None, 2), (1, 3)]) + self.assertEqual(var[1], 3) + self.assertEqual(var[TLVList.IndexMethod.Index:0], (None, 1)) + self.assertEqual(var[TLVList.IndexMethod.Tag:1], 3) - l.append(None, 4) - self.assertEqual(l, TLVList([(None, 1), (None, 2), (1, 3), (None, 4)])) + var.append(None, 4) + self.assertEqual(var, TLVList([(None, 1), (None, 2), (1, 3), (None, 4)])) - l.append(5, 6) - self.assertEqual(l, TLVList([(None, 1), (None, 2), (1, 3), (None, 4), (5, 6)])) + var.append(5, 6) + self.assertEqual(var, TLVList([(None, 1), (None, 2), (1, 3), (None, 4), (5, 6)])) expectIterateContent = [(None, 1), (None, 2), (1, 3), (None, 4), (5, 6)] iteratedContent = [] - for tag, value in l: + for tag, value in var: iteratedContent.append((tag, value)) self.assertEqual(expectIterateContent, iteratedContent)