diff options
author | 2023-02-23 04:08:57 +0530 | |
---|---|---|
committer | 2023-02-23 04:08:57 +0530 | |
commit | 9b98dfe78bb226e26a8d9cb6e8a0e8f8504286dd (patch) | |
tree | 52421a5cb94ec9be286e84ea08169fe0d3e307ae /tests/helpers.py | |
parent | Merge branch 'main' into migration/tag (diff) |
Implement all reviews
+ Remove commented code
+ Remove unecessarily syncting the bot
+ Handle direct tag commads
+ 3.10 type hinting in concerned functions
+ Add `MockInteractionMessage`
+ Fix tests for `try_get_tag`
Diffstat (limited to 'tests/helpers.py')
-rw-r--r-- | tests/helpers.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/helpers.py b/tests/helpers.py index 2d20b4d07..0d955b521 100644 --- a/tests/helpers.py +++ b/tests/helpers.py @@ -486,7 +486,6 @@ class MockInteraction(CustomMockMixin, unittest.mock.MagicMock): Instances of this class will follow the specifications of `discord.Interaction` instances. For more information, see the `MockGuild` docstring. """ - # spec_set = context_instance def __init__(self, **kwargs) -> None: super().__init__(**kwargs) @@ -550,6 +549,16 @@ class MockMessage(CustomMockMixin, unittest.mock.MagicMock): self.channel = kwargs.get('channel', MockTextChannel()) +class MockInteractionMessage(MockMessage): + """ + A MagicMock subclass to mock InteractionMessage objects. + + Instances of this class will follow the specifications of `discord.InteractionMessage` instances. For more + information, see the `MockGuild` docstring. + """ + pass + + emoji_data = {'require_colons': True, 'managed': True, 'id': 1, 'name': 'hyperlemon'} emoji_instance = discord.Emoji(guild=MockGuild(), state=unittest.mock.MagicMock(), data=emoji_data) |