Exemplo n.º 1
0
 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)
Exemplo n.º 2
0
 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)
Exemplo n.º 3
0
 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)
Exemplo n.º 4
0
 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)
Exemplo n.º 5
0
 def test_type(self):
     s = UUID()
     s.name = 'x'
     with self.assertRaises(TypeError):
         s.type_check(123)
Exemplo n.º 6
0
 def test_type(self):
     s = UUID()
     s.name = 'x'
     with self.assertRaises(TypeError):
         s.type_check(123)