Beispiel #1
0
 def test_evaluate_merges_and_replaces(self):
     v = Varstack(
         os.path.dirname(__file__) +
         "/../examples/varstack_no_datadir.yaml")
     evaluated = v.evaluate({})
     assert_equal(3, len(evaluated['an_array']))
     assert_equal(2, len(evaluated['a_dict']))
     assert_equal("another_string", v.evaluate({})['a_dict']['key1'])
Beispiel #2
0
 def test_init(self):
     v = Varstack()
     assert_is_not_none(v.config_filename)
     v = Varstack("/etc/some/other_file.yaml")
     assert_equal(v.config_filename, "/etc/some/other_file.yaml")
Beispiel #3
0
 def setUp(self):
     self.v = Varstack(
         os.path.dirname(__file__) + "/../examples/varstack_crypted.yaml",
         {'gnupghome': os.path.dirname(__file__) + '/helper/gnupghome/'})
     self.evaluated = self.v.evaluate({})
Beispiel #4
0
 def test_evaluate_with_non_existing_datadir_fails_and_returns_empty(
         self, log):
     v = Varstack(os.path.dirname(__file__) + "/../examples/varstack.yaml")
     assert_equal({}, v.evaluate({}))
     assert_in('not found, skipping', str(log))
Beispiel #5
0
 def test_evaluate_uses_default_datadir(self):
     v = Varstack(
         os.path.dirname(__file__) +
         "/../examples/varstack_no_datadir.yaml")
     assert_not_equal({}, v.evaluate({}))