Skip to content

Commit

Permalink
ci(ruff-simplify): autofix "SIM"
Browse files Browse the repository at this point in the history
  • Loading branch information
sujuka99 committed Sep 26, 2023
1 parent f90dd22 commit 68b824b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion kpops/component_handlers/topic/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
36 changes: 18 additions & 18 deletions tests/compiler/test_pipeline_name.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down
4 changes: 2 additions & 2 deletions tests/components/test_kubernetes_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 68b824b

Please sign in to comment.