test and fixtures for Object explorers

Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
remotes/origin/feature_files_export
Steven Armstrong 13 years ago
parent 2c6c9bcab5
commit d03f23129b
  1. 13
      lib/cdist/test/object/__init__.py
  2. 0
      lib/cdist/test/object/fixtures/object/__third/moon/.cdist/explorer/.keep

@ -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)

Loading…
Cancel
Save