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
1 changed files with 2 additions and 2 deletions

View File

@ -54,9 +54,9 @@ class ObjectClassTestCase(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')
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):
core.CdistObject(cdist_type, object_base_path, illegal_object_id)