From c7c682e09ad905d37d269411b25573e8d0a06079 Mon Sep 17 00:00:00 2001 From: "4808216+philipsabri@users.noreply.github.com" Date: Tue, 24 Oct 2023 20:02:35 +0200 Subject: [PATCH] Fix spelling on send_message discord function --- src/infrastructure/discord.py | 2 +- src/usecase/apartment.py | 2 +- tests/infrastructure/test_discord.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/infrastructure/discord.py b/src/infrastructure/discord.py index bd56d06..6a247e0 100644 --- a/src/infrastructure/discord.py +++ b/src/infrastructure/discord.py @@ -5,6 +5,6 @@ class DiscordInfrastructure: def __init__(self, webhook_url): self.webhook_url = webhook_url - def send_messege(self, message): + def send_message(self, message): full_message = {"content": message} requests.post(self.webhook_url, json=full_message, timeout=5) diff --git a/src/usecase/apartment.py b/src/usecase/apartment.py index 6ce4c67..d957fc1 100644 --- a/src/usecase/apartment.py +++ b/src/usecase/apartment.py @@ -91,4 +91,4 @@ def store_apartment(self, apartment: Apartment): return self.apartment_repository.post_apartment_listing(apartment) def post_to_discord(self, apartment): - self.discord_infrastructure.send_messege(str(apartment)) + self.discord_infrastructure.send_message(str(apartment)) diff --git a/tests/infrastructure/test_discord.py b/tests/infrastructure/test_discord.py index 71c6264..f80f56f 100644 --- a/tests/infrastructure/test_discord.py +++ b/tests/infrastructure/test_discord.py @@ -16,9 +16,9 @@ def tearDown(self): # Stop the patcher to clean up self.patcher.stop() - def test_send_messege(self): + def test_send_message(self): message = "Test message" - self.discord.send_messege(message) + self.discord.send_message(message) # Check that requests.post was called with the expected arguments self.mock_requests.assert_called_once_with(self.webhook_url, json={"content": message}, timeout=5)