From 68b824b287fcf3bee03bae694077f1f9c1814118 Mon Sep 17 00:00:00 2001 From: Ivan Yordanov Date: Wed, 27 Sep 2023 01:06:47 +0300 Subject: [PATCH] ci(ruff-simplify): autofix "SIM" --- kpops/component_handlers/topic/handler.py | 2 +- tests/compiler/test_pipeline_name.py | 36 +++++++++++------------ tests/components/test_kubernetes_app.py | 4 +-- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/kpops/component_handlers/topic/handler.py b/kpops/component_handlers/topic/handler.py index 38de9c66b..1307717c9 100644 --- a/kpops/component_handlers/topic/handler.py +++ b/kpops/component_handlers/topic/handler.py @@ -65,7 +65,7 @@ def create_topics(self, to_section: ToSection, dry_run: bool) -> None: self.proxy_wrapper.create_topic(topic_spec=topic_spec) def delete_topics(self, to_section: ToSection, dry_run: bool) -> None: - for topic_name in to_section.topics.keys(): + for topic_name in to_section.topics: if dry_run: self.__dry_run_topic_deletion(topic_name=topic_name) else: diff --git a/tests/compiler/test_pipeline_name.py b/tests/compiler/test_pipeline_name.py index fa2d3407a..979c781e2 100644 --- a/tests/compiler/test_pipeline_name.py +++ b/tests/compiler/test_pipeline_name.py @@ -14,39 +14,39 @@ def test_should_set_pipeline_name_with_default_base_dir(): Pipeline.set_pipeline_name_env_vars(DEFAULT_BASE_DIR, PIPELINE_PATH) - assert "some-random-path-for-testing" == ENV["pipeline_name"] - assert "some" == ENV["pipeline_name_0"] - assert "random" == ENV["pipeline_name_1"] - assert "path" == ENV["pipeline_name_2"] - assert "for" == ENV["pipeline_name_3"] - assert "testing" == ENV["pipeline_name_4"] + assert ENV["pipeline_name"] == "some-random-path-for-testing" + assert ENV["pipeline_name_0"] == "some" + assert ENV["pipeline_name_1"] == "random" + assert ENV["pipeline_name_2"] == "path" + assert ENV["pipeline_name_3"] == "for" + assert ENV["pipeline_name_4"] == "testing" def test_should_set_pipeline_name_with_specific_relative_base_dir(): Pipeline.set_pipeline_name_env_vars(Path("./some/random/path"), PIPELINE_PATH) - assert "for-testing" == ENV["pipeline_name"] - assert "for" == ENV["pipeline_name_0"] - assert "testing" == ENV["pipeline_name_1"] + assert ENV["pipeline_name"] == "for-testing" + assert ENV["pipeline_name_0"] == "for" + assert ENV["pipeline_name_1"] == "testing" def test_should_set_pipeline_name_with_specific_absolute_base_dir(): Pipeline.set_pipeline_name_env_vars(Path("some/random/path"), PIPELINE_PATH) - assert "for-testing" == ENV["pipeline_name"] - assert "for" == ENV["pipeline_name_0"] - assert "testing" == ENV["pipeline_name_1"] + assert ENV["pipeline_name"] == "for-testing" + assert ENV["pipeline_name_0"] == "for" + assert ENV["pipeline_name_1"] == "testing" def test_should_set_pipeline_name_with_absolute_base_dir(): Pipeline.set_pipeline_name_env_vars(Path.cwd(), PIPELINE_PATH) - assert "some-random-path-for-testing" == ENV["pipeline_name"] - assert "some" == ENV["pipeline_name_0"] - assert "random" == ENV["pipeline_name_1"] - assert "path" == ENV["pipeline_name_2"] - assert "for" == ENV["pipeline_name_3"] - assert "testing" == ENV["pipeline_name_4"] + assert ENV["pipeline_name"] == "some-random-path-for-testing" + assert ENV["pipeline_name_0"] == "some" + assert ENV["pipeline_name_1"] == "random" + assert ENV["pipeline_name_2"] == "path" + assert ENV["pipeline_name_3"] == "for" + assert ENV["pipeline_name_4"] == "testing" def test_should_not_set_pipeline_name_with_the_same_base_dir(): diff --git a/tests/components/test_kubernetes_app.py b/tests/components/test_kubernetes_app.py index f06ff44ac..de8a4723d 100644 --- a/tests/components/test_kubernetes_app.py +++ b/tests/components/test_kubernetes_app.py @@ -195,8 +195,8 @@ def test_should_raise_not_implemented_error_when_helm_chart_is_not_set( kubernetes_app.deploy(True) helm_mock.add_repo.assert_called() assert ( - "Please implement the helm_chart property of the kpops.components.base_components.kubernetes_app module." - == str(error.value) + str(error.value) + == "Please implement the helm_chart property of the kpops.components.base_components.kubernetes_app module." ) def test_should_call_helm_uninstall_when_destroying_kubernetes_app(