From 9640c3a0981ce165ac4e552cf97de7062232b25f Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Fri, 14 Oct 2011 11:21:12 +0200 Subject: [PATCH] test for illegal object_id Signed-off-by: Steven Armstrong --- lib/cdist/test/object/__init__.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/cdist/test/object/__init__.py b/lib/cdist/test/object/__init__.py index 9ba3ed61..9a13f524 100644 --- a/lib/cdist/test/object/__init__.py +++ b/lib/cdist/test/object/__init__.py @@ -52,6 +52,14 @@ class ObjectClassTestCase(unittest.TestCase): self.assertEqual(objects, objects_expected) +class ObjectIdTestCase(unittest.TestCase): + def test_illegal_object_id(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) + + class ObjectTestCase(unittest.TestCase): def setUp(self):