예제 #1
0
 def test_to_python_hex(self):
     value = uuid.uuid4()
     instance = UUIDConverter(self.app.url_map)
     self.assertEqual(value, instance.to_python(value.hex))
예제 #2
0
 def test_to_python_uuid(self):
     value = uuid.uuid4()
     instance = UUIDConverter(self.app.url_map)
     self.assertIs(instance.to_python(value), value)
예제 #3
0
 def test_to_python_error(self):
     instance = UUIDConverter(self.app.url_map)
     with self.assertRaises(ValidationError):
         instance.to_python("")
 def test_to_python_hex(self):
     value = uuid.uuid4()
     instance = UUIDConverter(self.app.url_map)
     self.assertEqual(value, instance.to_python(value.hex))
 def test_to_python_uuid(self):
     value = uuid.uuid4()
     instance = UUIDConverter(self.app.url_map)
     self.assertIs(instance.to_python(value), value)
 def test_to_python_error(self):
     instance = UUIDConverter(self.app.url_map)
     with self.assertRaises(ValidationError):
         instance.to_python("")