def test_include_source__cached(self): global_config = BaseGlobalConfig() project_config = BaseProjectConfig(global_config) with temporary_dir() as d: touch("cumulusci.yml") other1 = project_config.include_source({"path": d}) other2 = project_config.include_source({"path": d}) assert other1 is other2
def test_include_source__unknown(self): global_config = BaseGlobalConfig() project_config = BaseProjectConfig(global_config) with self.assertRaises(Exception): project_config.include_source({"foo": "bar"})
def test_include_source__github(self, source): source.return_value = expected_result = mock.Mock() global_config = BaseGlobalConfig() project_config = BaseProjectConfig(global_config) other_config = project_config.include_source({"github": "foo/bar"}) assert other_config.source is expected_result