tests for Object state

Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
This commit is contained in:
Steven Armstrong 2011-10-19 14:50:16 +02:00
parent 4d4287c580
commit 02de396905

View file

@ -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), [])