forked from ungleich-public/cdist
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:
parent
8f75a9133f
commit
0851af7d52
1 changed files with 2 additions and 2 deletions
|
@ -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)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue