From f2701cb5124d513b9c80fb45ef3ab527ade4a9e5 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Mon, 10 Oct 2011 10:04:36 +0200 Subject: [PATCH] test for Object changed Signed-off-by: Steven Armstrong --- lib/cdist/test/object/__init__.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/cdist/test/object/__init__.py b/lib/cdist/test/object/__init__.py index 910a75e1..a85e8df9 100644 --- a/lib/cdist/test/object/__init__.py +++ b/lib/cdist/test/object/__init__.py @@ -58,6 +58,9 @@ class ObjectTestCase(unittest.TestCase): self.cdist_type = cdist.core.Type(type_base_path, '__third') 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): self.assertEqual(self.cdist_object.name, '__third/moon') @@ -90,4 +93,11 @@ class ObjectTestCase(unittest.TestCase): 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)