allow object_id to start and end with one /, fail with any //

Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
This commit is contained in:
Nico Schottelius 2012-02-13 10:39:04 +01:00
parent 8f75a9133f
commit 0851af7d52

View file

@ -54,9 +54,9 @@ class ObjectClassTestCase(test.CdistTestCase):
class ObjectIdTestCase(test.CdistTestCase): class ObjectIdTestCase(test.CdistTestCase):
def test_object_id_starts_with_slash(self): def test_object_id_contains_double_slash(self):
cdist_type = core.CdistType(type_base_path, '__third') cdist_type = core.CdistType(type_base_path, '__third')
illegal_object_id = '/object_id/may/not/start/with/slash' illegal_object_id = '/object_id//may/not/contain/double/slash'
with self.assertRaises(core.IllegalObjectIdError): with self.assertRaises(core.IllegalObjectIdError):
core.CdistObject(cdist_type, object_base_path, illegal_object_id) core.CdistObject(cdist_type, object_base_path, illegal_object_id)