From 62a0ede950fb32d64dbbdc4aab5e095de45043e4 Mon Sep 17 00:00:00 2001 From: Frank Tubbing Date: Wed, 7 Feb 2024 12:16:32 +0100 Subject: [PATCH] Move prettify_and_dedup_list test location --- .../unit/clients/slack/test_slack_message_builder.py | 11 ----------- tests/unit/utils/test_strings.py | 11 +++++++++++ 2 files changed, 11 insertions(+), 11 deletions(-) create mode 100644 tests/unit/utils/test_strings.py diff --git a/tests/unit/clients/slack/test_slack_message_builder.py b/tests/unit/clients/slack/test_slack_message_builder.py index 5b9b5f081..2e314595d 100644 --- a/tests/unit/clients/slack/test_slack_message_builder.py +++ b/tests/unit/clients/slack/test_slack_message_builder.py @@ -5,7 +5,6 @@ from elementary.clients.slack.schema import SlackMessageSchema from elementary.clients.slack.slack_message_builder import SlackMessageBuilder -from elementary.utils.strings import prettify_and_dedup_list def test_create_divider_block(): @@ -323,16 +322,6 @@ def test_create_button_action_block(text, url): ) -def test_prettify_and_dedup_list(): - list_prettified = prettify_and_dedup_list(["name1", "name2", "name2"]) - assert list_prettified == "name1, name2" - - assert prettify_and_dedup_list("name1, name2, name2") == "name1, name2" - - string_of_list_prettified = prettify_and_dedup_list('["name1", "name2", "name2"]') - assert string_of_list_prettified == "name1, name2" - - def test_slack_message_attachments_limit(): very_short_attachments = ["attachment"] * ( SlackMessageBuilder._MAX_AMOUNT_OF_ATTACHMENTS - 1 diff --git a/tests/unit/utils/test_strings.py b/tests/unit/utils/test_strings.py new file mode 100644 index 000000000..033b62aa0 --- /dev/null +++ b/tests/unit/utils/test_strings.py @@ -0,0 +1,11 @@ +from elementary.utils.strings import prettify_and_dedup_list + + +def test_prettify_and_dedup_list(): + list_prettified = prettify_and_dedup_list(["name1", "name2", "name2"]) + assert list_prettified == "name1, name2" + + assert prettify_and_dedup_list("name1, name2, name2") == "name1, name2" + + string_of_list_prettified = prettify_and_dedup_list('["name1", "name2", "name2"]') + assert string_of_list_prettified == "name1, name2"