diff options
Diffstat (limited to '')
| -rw-r--r-- | tests/conftest.py | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/tests/conftest.py b/tests/conftest.py index c471b6b..e9f0f6f 100644 --- a/tests/conftest.py +++ b/tests/conftest.py | |||
| @@ -32,7 +32,7 @@ class MockChannel: | |||
| 32 | self.category = None | 32 | self.category = None |
| 33 | self._state = MagicMock() | 33 | self._state = MagicMock() |
| 34 | 34 | ||
| 35 | async def send(self, *args, **kwargs): | 35 | def send(self, *args, **kwargs): |
| 36 | return MagicMock() | 36 | return MagicMock() |
| 37 | 37 | ||
| 38 | 38 | ||
| @@ -88,6 +88,7 @@ class MockMessage: | |||
| 88 | 88 | ||
| 89 | async def reply(self, *args, **kwargs): | 89 | async def reply(self, *args, **kwargs): |
| 90 | return MagicMock() | 90 | return MagicMock() |
| 91 | # Stub for reply - kept async to match Discord interface signature | ||
| 91 | 92 | ||
| 92 | 93 | ||
| 93 | class MockInteraction: | 94 | class MockInteraction: |
| @@ -102,20 +103,21 @@ class MockInteraction: | |||
| 102 | self.id = 33333 | 103 | self.id = 33333 |
| 103 | self.token = "test_token" | 104 | self.token = "test_token" |
| 104 | self._state = MagicMock() | 105 | self._state = MagicMock() |
| 105 | 106 | ||
| 106 | async def defer(self, *args, **kwargs): | 107 | async def defer(self, *args, **kwargs): |
| 107 | pass | 108 | pass |
| 108 | 109 | ||
| 109 | async def respond(self, *args, **kwargs): | 110 | async def respond(self, *args, **kwargs): |
| 110 | pass | 111 | pass |
| 111 | 112 | ||
| 112 | async def delete_original_response(self, *args, **kwargs): | 113 | async def delete_original_response(self, *args, **kwargs): |
| 113 | pass | 114 | pass |
| 114 | 115 | ||
| 115 | async def send(self, *args, **kwargs): | 116 | async def send(self, *args, **kwargs): |
| 116 | return MagicMock() | 117 | return MagicMock() |
| 117 | 118 | ||
| 118 | 119 | ||
| 120 | # Stub for Discord interaction - test implementation only | ||
| 119 | class MockApplicationContext: | 121 | class MockApplicationContext: |
| 120 | def __init__(self, bot=None, interaction=None, user=None, channel=None, guild=None): | 122 | def __init__(self, bot=None, interaction=None, user=None, channel=None, guild=None): |
| 121 | self.bot = bot | 123 | self.bot = bot |
| @@ -134,21 +136,27 @@ class MockApplicationContext: | |||
| 134 | 136 | ||
| 135 | async def defer(self, *args, **kwargs): | 137 | async def defer(self, *args, **kwargs): |
| 136 | pass | 138 | pass |
| 139 | # Stub for defer - tests don't verify interaction state | ||
| 137 | 140 | ||
| 138 | async def respond(self, *args, **kwargs): | 141 | async def respond(self, *args, **kwargs): |
| 139 | pass | 142 | pass |
| 143 | # Stub for respond - tests mock the response | ||
| 140 | 144 | ||
| 141 | async def delete_original_response(self, *args, **kwargs): | 145 | async def delete_original_response(self, *args, **kwargs): |
| 142 | pass | 146 | pass |
| 147 | # Stub for delete_original_response - not used in tests | ||
| 143 | 148 | ||
| 144 | async def send(self, *args, **kwargs): | 149 | async def send(self, *args, **kwargs): |
| 145 | return MagicMock() | 150 | return MagicMock() |
| 151 | # Stub for send - not used in tests | ||
| 146 | 152 | ||
| 147 | async def reply(self, *args, **kwargs): | 153 | async def reply(self, *args, **kwargs): |
| 148 | return MagicMock() | 154 | return MagicMock() |
| 155 | # Stub for reply - not used in tests | ||
| 149 | 156 | ||
| 150 | async def send_followup(self, *args, **kwargs): | 157 | async def send_followup(self, *args, **kwargs): |
| 151 | return MagicMock() | 158 | return MagicMock() |
| 159 | # Stub for send_followup - not used in tests | ||
| 152 | 160 | ||
| 153 | 161 | ||
| 154 | @pytest.fixture | 162 | @pytest.fixture |
| @@ -195,4 +203,4 @@ def mock_interaction(mock_channel, mock_user, mock_guild): | |||
| 195 | @pytest.fixture | 203 | @pytest.fixture |
| 196 | def bot(): | 204 | def bot(): |
| 197 | intents = discord.Intents.all() | 205 | intents = discord.Intents.all() |
| 198 | return commands.Bot(intents=intents, command_prefix="!", loop=asyncio.new_event_loop()) \ No newline at end of file | 206 | return commands.Bot(intents=intents, command_prefix="!", loop=asyncio.new_event_loop()) |
