Fixed 3 of the VALID_VALUES on the

UnsignedIntegerTest not being bytes.

Added Long and UnsignedLong tests.
This commit is contained in:
Jeppe Klitgaard 2015-04-16 15:59:18 +02:00
parent 5eddb67489
commit 4e6f223a7d

View File

@ -231,15 +231,23 @@ class UnsignedIntegerTest(BaseNumberDatatypeTester):
DATATYPE_CLS = UnsignedInteger DATATYPE_CLS = UnsignedInteger
VALID_VALUES = [ VALID_VALUES = [
(0, "\x00\x00\x00\x00"), (0, b"\x00\x00\x00\x00"),
(10000000, "\x00\x98\x96\x80"), (10000000, b"\x00\x98\x96\x80"),
(2147483647, b"\x7f\xff\xff\xff"), (2147483647, b"\x7f\xff\xff\xff"),
(4294967295, "\xff\xff\xff\xff") (4294967295, b"\xff\xff\xff\xff")
] ]
INVALID_DESERIALIZATION_VALUES = IntegerTest.INVALID_DESERIALIZATION_VALUES INVALID_DESERIALIZATION_VALUES = IntegerTest.INVALID_DESERIALIZATION_VALUES
class LongTest(IntegerTest):
DATATYPE_CLS = Long
class UnsignedLongTest(UnsignedInteger):
DATATYPE_CLS = UnsignedLong
# def _bin(binstr): # def _bin(binstr):
# """ # """
# Accepts a pretty looking string of binary numbers and # Accepts a pretty looking string of binary numbers and