dexter has uploaded this change for review. (
https://gerrit.osmocom.org/c/python/pyosmocom/+/38287?usp=email )
Change subject: test_construct: move testvectors inside unittest class
......................................................................
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(-)
git pull ssh://gerrit.osmocom.org:29418/python/pyosmocom refs/changes/87/38287/1
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
https://gerrit.osmocom.org/c/python/pyosmocom/+/38287?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: python/pyosmocom
Gerrit-Branch: master
Gerrit-Change-Id: Ida24295091efd30406e9a354ca5854150127b3d4
Gerrit-Change-Number: 38287
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>