def test_path(self): for exp in ( '/home/deployer/bang-stacks/fubar.yml', '../blargh/asdf.yml', './testcfg', 'stacks/buya.yml', 'buya.yml', ): act = C.resolve_config_spec(exp) self.assertEqual(exp, act)
def test_path(self): # gozinta == gozoutta for exp in ( '/home/deployer/bang-stacks/fubar.yml', '../blargh/asdf.yml', './testcfg', 'stacks/buya.yml', 'buya.yml', ): act = C.resolve_config_spec(exp) self.assertEqual(exp, act) # transformation for args, exp in ( (('foo', ), 'foo.yml'), (('foo', '/path/to/configs'), '/path/to/configs/foo.yml'), (('bar', '/path/to/configs/'), '/path/to/configs/bar.yml'), (('fullstack', '/etc/bang'), '/etc/bang/fullstack.yml'), ): act = C.resolve_config_spec(*args) self.assertEqual(exp, act)
def test_basename(self): stacks_dir = '/home/deployer/bang-stacks' name = 'fubar' exp = '%s/%s.yml' % (stacks_dir, name) act = C.resolve_config_spec(name, stacks_dir) self.assertEqual(exp, act)