Beispiel #1
0
 def test_repr_full(self):
     validator = validate_uuid(variant=uuid.RFC_4122, version=3)
     self.assertEqual(
         repr(validator),
         'validate_uuid(variant=uuid.RFC_4122, version=3)',
     )
Beispiel #2
0
 def test_uuid1_valid(self):
     validate_uuid(uuid.uuid1())
Beispiel #3
0
 def test_required(self):
     with self.assertRaises(TypeError):
         validate_uuid(None)
Beispiel #4
0
 def test_repr_required_false(self):
     validator = validate_uuid(required=False)
     self.assertEqual(
         repr(validator),
         'validate_uuid(required=False)',
     )
Beispiel #5
0
 def test_incompatible_variant_version(self):
     with self.assertRaises(ValueError):
         validate_uuid(variant=uuid.RESERVED_MICROSOFT, version=4)
Beispiel #6
0
 def test_not_required(self):
     validate_uuid(None, required=False)
Beispiel #7
0
 def test_rfc4122_valid(self):
     validate_uuid(uuid.uuid4(), variant=uuid.RFC_4122)
Beispiel #8
0
 def test_microsoft_invalid(self):
     with self.assertRaises(ValueError):
         validate_uuid(uuid.uuid4(), variant=uuid.RESERVED_MICROSOFT)
Beispiel #9
0
 def test_uuid5_valid(self):
     validate_uuid(uuid.uuid5(uuid.uuid4(), "name"))
Beispiel #10
0
 def test_uuid4_valid(self):
     validate_uuid(uuid.uuid4())
Beispiel #11
0
 def test_uuid3_expected_invalid(self):
     with self.assertRaises(ValueError):
         validate_uuid(uuid.uuid4(), version=3)
Beispiel #12
0
 def test_uuid3_expected_valid(self):
     validate_uuid(uuid.uuid3(uuid.uuid4(), "name"), version=3)
Beispiel #13
0
 def test_uuid1_expected_valid(self):
     validate_uuid(uuid.uuid1(), version=1)