test for: .cdist may not be used in object_id

Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
remotes/origin/feature_files_export
Steven Armstrong 13 years ago
parent e58b52592b
commit af367a76f8
  1. 8
      lib/cdist/test/object/__init__.py

@ -53,12 +53,18 @@ class ObjectClassTestCase(unittest.TestCase):
class ObjectIdTestCase(unittest.TestCase):
def test_illegal_object_id(self):
def test_object_id_starts_with_slash(self):
cdist_type = core.Type(type_base_path, '__third')
illegal_object_id = '/object_id/may/not/start/with/slash'
with self.assertRaises(core.IllegalObjectIdError):
core.Object(cdist_type, object_base_path, illegal_object_id)
def test_object_id_contains_dotcdist(self):
cdist_type = core.Type(type_base_path, '__third')
illegal_object_id = 'object_id/may/not/contain/.cdist/anywhere'
with self.assertRaises(core.IllegalObjectIdError):
core.Object(cdist_type, object_base_path, illegal_object_id)
class ObjectTestCase(unittest.TestCase):

Loading…
Cancel
Save