diff --git a/.bumpversion.cfg b/.bumpversion.cfg index c09c518f..e2cb66ca 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.9.37 +current_version = 0.9.38 commit = False tag = False parse = (?P\d+)\.(?P\d+)\.(?P\d+)(\.(?P[a-z]+)(?P\d+))? diff --git a/VERSION b/VERSION index 41796a92..4b38075a 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.9.37 +0.9.38 diff --git a/taskcat/_config.py b/taskcat/_config.py index 408e0880..82c6b69f 100644 --- a/taskcat/_config.py +++ b/taskcat/_config.py @@ -154,7 +154,6 @@ def _dict_from_file(file_path: Path, fail_ok=True) -> dict: try: with open(str(file_path), "r", encoding="utf-8") as file_handle: config_dict = yaml.safe_load(file_handle) - LOG.debug(f"file_path={file_path}, file_handle={file_handle}") return config_dict except Exception as e: # pylint: disable=broad-except LOG.warning(f"failed to load config from {file_path}") diff --git a/taskcat/testing/base_test.py b/taskcat/testing/base_test.py index fe5aecf7..155aaff1 100644 --- a/taskcat/testing/base_test.py +++ b/taskcat/testing/base_test.py @@ -86,19 +86,11 @@ def from_file( input_file_path: Path = project_root_path / input_file # pylint: disable=too-many-arguments args = _build_args(enable_sig_v2, regions, GLOBAL_ARGS.profile) - - # Detect if input file is taskcat config or CloudFormation template - if '.taskcat.yml' in input_file or '.taskcat.yaml' in input_file: - config = Config.create( - project_root=project_root_path, - project_config_path=input_file_path, - args=args - ) - else: - config = Config.create( - project_root=project_root_path, - template_file=input_file_path, - args=args + config = Config.create( + project_root=project_root_path, + project_config_path=input_file_path, + args=args + # TODO: detect if input file is taskcat config or CloudFormation template ) return cls(config) diff --git a/tests/testing_module/test_base.py b/tests/testing_module/test_base.py index 414d1672..5da1b842 100644 --- a/tests/testing_module/test_base.py +++ b/tests/testing_module/test_base.py @@ -19,9 +19,6 @@ def setUpClass(cls): cls.input_file = ".taskcat.yml" cls.project_root_path = Path(__file__).parent / "../data/nested-fail" cls.input_file_path = cls.project_root_path / cls.input_file - cls.template_file = ( - Path(__file__).parent / "../data/nested-fail/templates/test.template.yaml" - ) cls.base_config = Config.create( project_root=cls.project_root_path, @@ -57,38 +54,8 @@ def test_inheritance(self): self.assertIsInstance(base, Test) - @patch("taskcat.testing.base_test._build_args") - @patch("taskcat.testing.base_test.BaseTest") - def test_from_file_template_yaml(self, base_test_mock, args_mock): - # given - mock_out = base_test_mock.return_value - - # when - mock_out.from_file( - project_root=self.project_root_path, input_file=self.template_file - ) - - # then - base_test_mock.return_value.from_file.assert_called_with( - project_root=self.project_root_path, - input_file=self.template_file - ) - - @patch("taskcat.testing.base_test._build_args") - @patch("taskcat.testing.base_test.BaseTest") - def test_from_file_taskcat_yaml(self, base_test_mock, args_mock): - # given - mock_out = base_test_mock.return_value - - # when - mock_out.from_file(project_root=self.project_root_path) - - # then - base_test_mock.return_value.from_file.assert_called_with( - project_root=self.project_root_path - ) - def test_from_file(self): + base = BaseTest.from_file(project_root=self.project_root_path) self.assertIsInstance(base, BaseTest, "Should return an instance of BaseTest.")