From f6adefddec0c842df3b3c803079b0dfd08a844e2 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Fri, 14 Oct 2011 09:03:18 +0200 Subject: [PATCH] test for Object object_from_name 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 982784f2..790d6679 100644 --- a/lib/cdist/test/object/__init__.py +++ b/lib/cdist/test/object/__init__.py @@ -169,3 +169,11 @@ class ObjectTestCase(unittest.TestCase): def test_code_remote_after_changing(self): self.cdist_object.code_remote = 'Hello World' self.assertEqual(self.cdist_object.code_remote, 'Hello World') + + def test_object_from_name(self): + self.cdist_object.code_remote = 'Hello World' + other_name = '__first/man' + other_object = self.cdist_object.object_from_name(other_name) + self.assertTrue(isinstance(other_object, core.Object)) + self.assertEqual(other_object.type.name, '__first') + self.assertEqual(other_object.object_id, 'man')