test for Object changed

Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
This commit is contained in:
Steven Armstrong 2011-10-10 10:04:36 +02:00
parent 86f976976e
commit f2701cb512

View file

@ -58,6 +58,9 @@ class ObjectTestCase(unittest.TestCase):
self.cdist_type = cdist.core.Type(type_base_path, '__third') self.cdist_type = cdist.core.Type(type_base_path, '__third')
self.cdist_object = cdist.core.Object(self.cdist_type, object_base_path, 'moon') self.cdist_object = cdist.core.Object(self.cdist_type, object_base_path, 'moon')
def tearDown(self):
self.cdist_object.changed = False
def test_name(self): def test_name(self):
self.assertEqual(self.cdist_object.name, '__third/moon') self.assertEqual(self.cdist_object.name, '__third/moon')
@ -90,4 +93,11 @@ class ObjectTestCase(unittest.TestCase):
expected = [] expected = []
self.assertEqual(list(self.cdist_object.requirements), expected) self.assertEqual(list(self.cdist_object.requirements), expected)
def test_changed(self):
self.assertFalse(self.cdist_object.changed)
def test_changed_after_changing(self):
self.cdist_object.changed = True
self.assertTrue(self.cdist_object.changed)
#suite = unittest.TestLoader().loadTestsFromTestCase(ObjectTestCase) #suite = unittest.TestLoader().loadTestsFromTestCase(ObjectTestCase)