class TypedUrnGeneratorTest(unittest.TestCase): def setUp(self): self.urigen = TypedUrnGenerator('typologie') def tearDown(self): del self.urigen def test_concept(self): self.assertEqual('urn:x-skosprovider:typologie:concept:1', self.urigen.generate(type='concept', id=1)) def test_collection(self): self.urigen = TypedUrnGenerator('typologie') self.assertEqual('urn:x-skosprovider:typologie:collection:7000', self.urigen.generate(type='collection', id=7000)) def test_invalid_type(self): self.assertRaises(ValueError, self.urigen.generate, type='set', id=1)
def test_collection(self): self.urigen = TypedUrnGenerator('typologie') self.assertEqual('urn:x-skosprovider:typologie:collection:7000', self.urigen.generate(type='collection', id=7000))
def setUp(self): self.urigen = TypedUrnGenerator('typologie')