Skip to content

Commit 3007aff

Browse files
Add GuestRoleDoesNotExistError tests
1 parent 9d5b82b commit 3007aff

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

tests/test_exceptions.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
ChannelDoesNotExistError,
1010
CommitteeRoleDoesNotExistError,
1111
DiscordMemberNotInMainGuildError,
12+
GuestRoleDoesNotExistError,
1213
GuildDoesNotExistError,
1314
ImproperlyConfiguredError,
1415
InvalidMessagesJSONFileError,
@@ -778,6 +779,30 @@ class TestGuestRoleDoesNotExistError:
778779
from its parent class so is already unit-tested in the parent class's dedicated test case.
779780
"""
780781

782+
def test_guest_role_does_not_exist_error_code(self) -> None:
783+
"""Test that the error code is set correctly."""
784+
assert "E1022" in (GuestRoleDoesNotExistError().ERROR_CODE)
785+
786+
def test_guest_role_does_not_exist_error_default_message(self) -> None:
787+
"""Test that the default message is correct."""
788+
assert (
789+
GuestRoleDoesNotExistError.DEFAULT_MESSAGE
790+
== 'Role with name "Guest" does not exist.'
791+
)
792+
793+
def test_guest_role_does_not_exist_dependent_commands(self) -> None:
794+
"""Test that the dependent commands are set correctly."""
795+
assert (
796+
frozenset({
797+
"induct",
798+
"stats",
799+
"archive",
800+
"ensure-members-inducted",
801+
"increment-year-channels",
802+
})
803+
== GuestRoleDoesNotExistError.DEPENDENT_COMMANDS
804+
)
805+
781806

782807
class TestMemberRoleDoesNotExistError:
783808
"""

0 commit comments

Comments
 (0)