示例#1
0
 def test_other_invalid(self):
     for value in (None, True, lambda: None, 1):
         with self.assertRaises(Invalid):
             validate_uuid(value)
示例#2
0
 def test_hex(self):
     uid = uuid4()
     self.assertEqual(validate_uuid(uid.hex).hex, uid.hex)
示例#3
0
 def test_invalid_hex(self):
     with self.assertRaises(Invalid):
         validate_uuid("hello world")
示例#4
0
 def test_uuid(self):
     uid = uuid4()
     self.assertIs(validate_uuid(uid), uid)