def test_load(self): s = UUID() s.name = 'x' o = Object() buf = self.uuid.bytes self.assertEqual(16, s.load(o, buf)) self.assertEqual(self.uuid, o.x)
def test_store(self): s = UUID() s.name = 'x' o = Object() o.x = self.uuid buf = s.store(o) self.assertEqual(self.uuid.bytes, buf)
def test_type(self): s = UUID() s.name = 'x' with self.assertRaises(TypeError): s.type_check(123)