def __init__(self, rs_username, rs_api_key, env_config): self.rs_username = rs_username self.rs_api_key = rs_api_key self.environments = run.get_config(env_config)['environments'] self.rax_token = None self.tenant = None self.awscreds = {}
def test_bad_config_file_path(self): with self.assertRaises(SystemExit) as exc: run.get_config('./nope') self.assertIn('No such file or directory', str(exc.exception))
def test_get_config(self): mock_open = mock.mock_open(read_data=self.config) with mock.patch('fleece.cli.run.run.open', mock_open, create=True): config = run.get_config('./wat') self.assertDictEqual(yaml.load(self.config), config)