test and fixtures for Object explorers

Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
This commit is contained in:
Steven Armstrong 2011-10-11 15:45:10 +02:00
parent 2c6c9bcab5
commit d03f23129b
2 changed files with 13 additions and 0 deletions

View File

@ -92,6 +92,19 @@ class ObjectTestCase(unittest.TestCase):
expected_parameters = {'planet': 'Saturn', 'name': 'Prometheus'}
self.assertEqual(self.cdist_object.parameters, expected_parameters)
def test_explorers(self):
self.assertEqual(self.cdist_object.explorers, {})
def test_explorers_after_changing(self):
expected = {'first': 'foo', 'second': 'bar'}
# when set, written to file
self.cdist_object.explorers = expected
# when accessed, read from file
self.assertEqual(self.cdist_object.explorers, expected)
# remove dynamically created folder
self.cdist_object.explorers = {}
os.rmdir(os.path.join(self.cdist_object.base_path, self.cdist_object.explorer_path))
def test_requirements(self):
expected = []
self.assertEqual(list(self.cdist_object.requirements), expected)