Skip to content

Commit

Permalink
Removed six from testing this
Browse files Browse the repository at this point in the history
  • Loading branch information
arekbulski committed Aug 22, 2016
1 parent 7032548 commit 606d34a
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions tests/test_this.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import unittest
from construct import Struct, UBInt8, UBInt32, IfThenElse, Value, Field, Container
from construct import this
import six


class TestThisExpressions(unittest.TestCase):
Expand All @@ -26,19 +25,15 @@ class TestThisExpressions(unittest.TestCase):
)

def test_parse(self):
res = self.this_example.parse(six.b("\x05helloABXXXX"))
expected = Container(length = 5, value = six.b('hello'),
res = self.this_example.parse(b"\x05helloABXXXX")
expected = Container(length = 5, value = b'hello',
nested = Container(b1 = 65, b2 = 66, b3 = 4295),
condition = 1482184792)
self.assertEquals(res, expected)

def test_build(self):
obj = Container(length = 5, value = six.b('hello'),
obj = Container(length = 5, value = b'hello',
nested = Container(b1 = 65, b2 = 66, b3 = None), condition = 1482184792)
data = self.this_example.build(obj)
self.assertEquals(data, six.b("\x05helloABXXXX"))


if __name__ == "__main__":
unittest.main()
self.assertEquals(data, b"\x05helloABXXXX")

0 comments on commit 606d34a

Please sign in to comment.