def test_bad_bytestring(self):
     """Test convert_tag with a bad bytestring"""
     bytestring = b'\x10\x00'
     convert_tag(bytestring, True)
 def test_offset(self):
     """Test convert_tag with an offset"""
     bytestring = b'\x12\x23\x10\x00\x20\x00\x34\x45'
     assert convert_tag(bytestring, True, 0) == Tag(0x2312, 0x0010)
     assert convert_tag(bytestring, True, 2) == Tag(0x0010, 0x0020)
 def test_empty_bytestring(self):
     """Test convert_tag with empty bytestring"""
     bytestring = b''
     assert convert_tag(bytestring, True) == ''
 def test_big_endian(self):
     """Test convert_tag with a big endian byte string"""
     bytestring = b'\x00\x10\x00\x20'
     assert convert_tag(bytestring, False) == Tag(0x0010, 0x0020)
 def test_little_endian(self):
     """Test convert_tag with a little endian byte string"""
     bytestring = b'\x10\x00\x20\x00'
     assert convert_tag(bytestring, True) == Tag(0x0010, 0x0020)
Пример #6
0
 def test_bad_bytestring(self):
     """Test convert_tag with a bad bytestring"""
     bytestring = b'\x10\x00'
     convert_tag(bytestring, True)
Пример #7
0
 def test_empty_bytestring(self):
     """Test convert_tag with empty bytestring"""
     bytestring = b''
     assert convert_tag(bytestring, True) == ''
Пример #8
0
 def test_offset(self):
     """Test convert_tag with an offset"""
     bytestring = b'\x12\x23\x10\x00\x20\x00\x34\x45'
     assert convert_tag(bytestring, True, 0) == Tag(0x2312, 0x0010)
     assert convert_tag(bytestring, True, 2) == Tag(0x0010, 0x0020)
Пример #9
0
 def test_little_endian(self):
     """Test convert_tag with a little endian byte string"""
     bytestring = b'\x10\x00\x20\x00'
     assert convert_tag(bytestring, True) == Tag(0x0010, 0x0020)
Пример #10
0
 def test_big_endian(self):
     """Test convert_tag with a big endian byte string"""
     bytestring = b'\x00\x10\x00\x20'
     assert convert_tag(bytestring, False) == Tag(0x0010, 0x0020)