예제 #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)