def test_unpack(self): """[Foundation/BasicTypes/Char] - unpacking.""" char1 = basic_types.Char(length=3) char2 = basic_types.Char(length=5) char1.unpack(b'fo\x00') char2.unpack(b'foo\x00\x00') self.assertEqual(char1.value, 'fo') self.assertEqual(char2.value, 'foo')
def setUp(self): """Basic test setup.""" self.char1 = basic_types.Char('foo', length=3) self.char2 = basic_types.Char('foo', length=5)