-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from cyber-francis/initial_commit
fix: updated pytest
- Loading branch information
Showing
2 changed files
with
4 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |