Example #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)
Example #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)
Example #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)
Example #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)
Example #5
0
 def test_type(self):
     s = UUID()
     s.name = 'x'
     with self.assertRaises(TypeError):
         s.type_check(123)
Example #6
0
 def test_type(self):
     s = UUID()
     s.name = 'x'
     with self.assertRaises(TypeError):
         s.type_check(123)