Fix tests

This commit is contained in:
2025-01-26 04:38:15 +01:00
parent 4bd937a570
commit 22f7028c1e

View File

@ -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