From 22f7028c1e82b8526cb430b23f034cf50962ebfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Hells=C3=A9n?= Date: Sun, 26 Jan 2025 04:38:15 +0100 Subject: [PATCH] Fix tests --- tests/test_ui.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/test_ui.py b/tests/test_ui.py index 936a6a6..1c26f08 100644 --- a/tests/test_ui.py +++ b/tests/test_ui.py @@ -37,8 +37,8 @@ class TestCreateJobEmbed(unittest.TestCase): assert_msg = "Expected embed description to not be None" assert embed.description is not None, assert_msg - assert_msg = f"Expected ID: 12345 in embed description, got {embed.description}" - assert "ID: 12345" in embed.description, assert_msg + assert_msg = f"Expected 12345 in embed footer, got {embed.footer}" + assert "12345" in embed.footer.text if embed.footer.text else None, assert_msg assert_msg = f"Expected Next run: 2023-10-10 10:00:00 in embed description, got {embed.description}" assert "Next run: 2023-10-10 10:00:00" in embed.description, assert_msg @@ -49,8 +49,8 @@ class TestCreateJobEmbed(unittest.TestCase): assert_msg = f"Expected Channel: <#67890> in embed description, got {embed.description}" assert "Channel: <#67890>" in embed.description, assert_msg - assert_msg = f"Expected Author: <@54321> in embed description, got {embed.description}" - assert "Author: <@54321>" in embed.description, assert_msg + assert_msg = f"Expected Created by: <@54321> in embed description, got {embed.description}" + assert "Created by: <@54321>" in embed.description, assert_msg def test_create_job_embed_without_next_run_time(self) -> None: """Test the `create_job_embed` function to ensure it correctly creates a Discord embed for a job without the next run time.""" @@ -65,8 +65,8 @@ class TestCreateJobEmbed(unittest.TestCase): assert_msg = "Expected embed description to not be None" assert embed.description is not None, assert_msg - assert_msg = f"Expected ID: 12345 in embed description, got {embed.description}" - assert "ID: 12345" in embed.description, assert_msg + assert_msg = f"Expected 12345 in embed footer, got {embed.footer}" + assert "12345" in embed.footer.text if embed.footer.text else None, assert_msg assert_msg = f"Expected Paused in embed description, got {embed.description}" assert "Paused" in embed.description, assert_msg @@ -77,8 +77,8 @@ class TestCreateJobEmbed(unittest.TestCase): assert_msg = f"Expected Channel: <#67890> in embed description, got {embed.description}" assert "Channel: <#67890>" in embed.description, assert_msg - assert_msg = f"Expected Author: <@54321> in embed description, got {embed.description}" - assert "Author: <@54321>" in embed.description, assert_msg + assert_msg = f"Expected Created by: <@54321> in embed description, got {embed.description}" + assert "Created by: <@54321>" in embed.description, assert_msg def test_create_job_embed_with_long_message(self) -> None: """Test the `create_job_embed` function to ensure it correctly truncates long messages.""" @@ -95,8 +95,8 @@ class TestCreateJobEmbed(unittest.TestCase): assert_msg = "Expected embed description to not be None" assert embed.description is not None, assert_msg - assert_msg = f"Expected ID: 12345 in embed description, got {embed.description}" - assert "ID: 12345" in embed.description, assert_msg + assert_msg = f"Expected 12345 in embed footer, got {embed.footer}" + assert "12345" in embed.footer.text if embed.footer.text else None, assert_msg assert_msg = f"Expected Paused in embed description, got {embed.description}" assert "Paused" in embed.description, assert_msg @@ -107,5 +107,5 @@ class TestCreateJobEmbed(unittest.TestCase): assert_msg = f"Expected Channel: <#67890> in embed description, got {embed.description}" assert "Channel: <#67890>" in embed.description, assert_msg - assert_msg = f"Expected Author: <@54321> in embed description, got {embed.description}" - assert "Author: <@54321>" in embed.description, assert_msg + assert_msg = f"Expected Created by: <@54321> in embed description, got {embed.description}" + assert "Created by: <@54321>" in embed.description, assert_msg