Skip to content

Commit

Permalink
Merge pull request #15 from cyber-francis/initial_commit
Browse files Browse the repository at this point in the history
fix: updated pytest
  • Loading branch information
cyber-francis authored Jan 2, 2024
2 parents d3cd18d + 0ddb4a6 commit b56b2d2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions src/slack_notification/singleton_base.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@

class Singleton(object):
_instances = {}

def __new__(cls, *args, **kwargs) -> dict:
if cls not in cls._instances:
instance = super().__new__(cls)
cls._instances[cls] = instance
return cls._instances[cls]

return cls._instances[cls]
5 changes: 2 additions & 3 deletions tests/test_format_message.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
from src.slack_notification.slack_notification import SlackNotification

slack = SlackNotification("FAKE_CHANNEL")


def test_format_str():
slack = SlackNotification("FAKE_CHANNEL")
formated_message = slack.format("TEST_MESSAGE")
assert formated_message == {"text": "TEST_MESSAGE"}


def test_format_dict():
slack = SlackNotification("FAKE_CHANNEL")
formated_message = slack.format({"KEY": "VALUE"})
assert formated_message == {"text": "{'KEY': 'VALUE'}"}
formated_message = slack.format

0 comments on commit b56b2d2

Please sign in to comment.