Пример #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)