test for Object object_from_name

Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
This commit is contained in:
Steven Armstrong 2011-10-14 09:03:18 +02:00
parent f4b1252063
commit f6adefddec
1 changed files with 8 additions and 0 deletions

View File

@ -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')