dexter submitted this change.
test_construct: move testvectors inside unittest class
The unittest class TestGreedyInt has test vectors declared outside
that class, but no other class makes use of this test vectors, so
let's move them into TestGreedyInt, where they should be.
Related: SYS#7094
Change-Id: Ida24295091efd30406e9a354ca5854150127b3d4
---
M tests/test_construct.py
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/tests/test_construct.py b/tests/test_construct.py
index 9110144..c2aeece 100755
--- a/tests/test_construct.py
+++ b/tests/test_construct.py
@@ -6,21 +6,21 @@
# pylint: disable=no-name-in-module
from construct import FlagsEnum
-tests = [
+class TestGreedyInt(unittest.TestCase):
+ tests = [
( b'\x80', 0x80 ),
( b'\x80\x01', 0x8001 ),
( b'\x80\x00\x01', 0x800001 ),
( b'\x80\x23\x42\x01', 0x80234201 ),
- ]
+ ]
-class TestGreedyInt(unittest.TestCase):
def test_GreedyInt_decoder(self):
gi = GreedyInteger()
- for t in tests:
+ for t in self.tests:
self.assertEqual(gi.parse(t[0]), t[1])
def test_GreedyInt_encoder(self):
gi = GreedyInteger()
- for t in tests:
+ for t in self.tests:
self.assertEqual(t[0], gi.build(t[1]))
pass
To view, visit change 38287. To unsubscribe, or for help writing mail filters, visit settings.