From 02de3969059430fe4520957f318cb3bf72fc6666 Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Wed, 19 Oct 2011 14:50:16 +0200 Subject: [PATCH] tests for Object state Signed-off-by: Steven Armstrong --- lib/cdist/test/object/__init__.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/lib/cdist/test/object/__init__.py b/lib/cdist/test/object/__init__.py index 84d2cf8f..7064b34d 100644 --- a/lib/cdist/test/object/__init__.py +++ b/lib/cdist/test/object/__init__.py @@ -79,6 +79,7 @@ class ObjectTestCase(unittest.TestCase): self.cdist_object.source = [] self.cdist_object.code_local = '' self.cdist_object.code_remote = '' + self.cdist_object.state = '' def test_name(self): self.assertEqual(self.cdist_object.name, '__third/moon') @@ -163,6 +164,21 @@ class ObjectTestCase(unittest.TestCase): self.cdist_object.ran = True self.assertTrue(self.cdist_object.ran) + def test_state(self): + self.assertEqual(self.cdist_object.state, '') + + def test_state_ran(self): + self.cdist_object.state = core.Object.STATE_RAN + self.assertEqual(self.cdist_object.state, core.Object.STATE_RAN) + + def test_state_running(self): + self.cdist_object.state = core.Object.STATE_RUNNING + self.assertEqual(self.cdist_object.state, core.Object.STATE_RUNNING) + + def test_state_prepared(self): + self.cdist_object.state = core.Object.STATE_PREPARED + self.assertEqual(self.cdist_object.state, core.Object.STATE_PREPARED) + def test_source(self): self.assertEqual(list(self.cdist_object.source), [])