aboutsummaryrefslogtreecommitdiffstats
path: root/tests (follow)
Commit message (Collapse)AuthorAgeLines
...
| | | * | | | | | | AntiMalware Tests - Removed exact log content checksGravatar Jannes Jonkers2020-05-11-19/+2
| | | | | | | | | |
| | | * | | | | | | AntiMalware Tests - added a missing case for no extensions in ↵Gravatar Jannes Jonkers2020-05-11-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | test_get_disallowed_extensions
| | | * | | | | | | AntiMalware Tests - extracted the method for determining disallowed ↵Gravatar Jannes Jonkers2020-05-11-6/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | extensions and added a test for it.
| | | * | | | | | | AntiMalware Tests - implemented minor feedbackGravatar Jannes Jonkers2020-05-11-12/+12
| | | | | | | | | |
| | | * | | | | | | Update tests/bot/cogs/test_antimalware.pyGravatar MrGrote2020-05-08-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Co-authored-by: Mark <[email protected]>
| | | * | | | | | | AntiMalware Tests - Switched to unittest.IsolatedAsyncioTestCaseGravatar Jannes Jonkers2020-05-07-29/+19
| | | | | | | | | |
| | | * | | | | | | AntiMalware Tests - Added unittest for txt file attachmentGravatar Jannes Jonkers2020-05-07-2/+23
| | | | | | | | | |
| | | * | | | | | | AntiMalware Tests - Added unittest for valid attachmentGravatar Jannes Jonkers2020-05-07-0/+9
| | | | | | | | | |
| | | * | | | | | | AntiMalware Tests - Added unittest message deletion logGravatar Jannes Jonkers2020-05-07-4/+28
| | | | | | | | | |
| | | * | | | | | | AntiMalware Tests - Added unittest for cog setupGravatar Jannes Jonkers2020-05-07-0/+10
| | | | | | | | | |
| | | * | | | | | | AntiMalware Tests - Added unittest for messages that were deleted in the ↵Gravatar Jannes Jonkers2020-05-07-1/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | meantime.
| | | * | | | | | | AntiMalware Tests - Added unittest for the embed for a python file.Gravatar Jannes Jonkers2020-05-07-1/+24
| | | | | | | | | |
| | | * | | | | | | AntiMalware Tests - Added unittest for messages send by staffGravatar Jannes Jonkers2020-05-07-1/+12
| | | | | | | | | |
| | | * | | | | | | AntiMalware Tests - Added unittests for deletion of message and ignoring of dmsGravatar Jannes Jonkers2020-05-07-1/+21
| | | | | | | | | |
| | | * | | | | | | AntiMalware Tests - Added unittest for message without attachmentGravatar Jannes Jonkers2020-05-07-0/+20
| | | |/ / / / / /
| | * | | | | | | Infr. Tests: Add `apply_infraction` awaiting assertion with argsGravatar ks1292020-05-30-0/+6
| | | | | | | | |
| | * | | | | | | Simplify infraction reason truncation testsGravatar ks1292020-05-30-13/+7
| | | | | | | | |
| | * | | | | | | Infr Tests: Make `get_active_infraction` return `None`Gravatar ks1292020-05-20-1/+1
| | | | | | | | |
| | * | | | | | | Infr. Test: Replace `get_active_mock` return valueGravatar ks1292020-05-20-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Replace `{"foo": "bar"}` with `{"id": 1}`
| | * | | | | | | Infr. Tests: Replace `str` with `dict`Gravatar ks1292020-05-20-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | To allow `.get`, I had to replace `str` return value with `dict`
| | * | | | | | | Infr. Tests: Add more content to await commentGravatar ks1292020-05-20-2/+2
| | | | | | | | |
| | * | | | | | | ModLog Tests: Fix embed description truncate testGravatar ks1292020-05-20-1/+1
| | | | | | | | |
| | * | | | | | | Merge branch 'master' into ban-kick-reason-lengthGravatar ks1292020-05-20-11/+183
| | |\ \ \ \ \ \ \ | | | | |/ / / / / | | | |/| | | | |
| | * | | | | | | Infraction Tests: Small fixesGravatar ks1292020-05-20-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Remove unnecessary space from placeholder - Rename `has_active_infraction` to `get_active_infraction`
| | * | | | | | | ModLog Tests: Fix truncation tests docstringGravatar ks1292020-05-20-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Co-authored-by: Leon Sandøy <[email protected]>
| | * | | | | | | (Infractions and ModLog Tests): Replaced `shortening` with `truncation`, ↵Gravatar ks1292020-04-16-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | removed unnecessary type hint and added comment to kick truncation test about awaiting `kick`.
| | * | | | | | | (ModLog Tests): Created reason shortening tests for `send_log_message`.Gravatar ks1292020-04-16-0/+29
| | | | | | | | |
| | * | | | | | | (Infraction Tests): Created reason shortening tests for ban and kick.Gravatar ks1292020-04-16-0/+54
| | | | | | | | |
| | * | | | | | | (Test Helpers): Added `__ge__` function to `MockRole` for comparing.Gravatar ks1292020-04-15-0/+4
| | | |_|_|/ / / | | |/| | | | |
| * | | | | | | Fix failing tests related to avatar_hashGravatar Leon Sandøy2020-05-27-5/+0
| | |/ / / / / | |/| | | | |
| * | | | | | Merge branch 'master' into eval-timeout-increaseGravatar Dennis Pham2020-05-19-3/+2
| |\ \ \ \ \ \ | | | |_|_|/ / | | |/| | | |
| | * | | | | Use `Command`-object for `send_help`Gravatar Sebastiaan Zeeff2020-05-17-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As @mathsman5133 pointed out, it's better to use the `Command`-instance we typically already have in the current context than to rely on parsing the qualified name again. The invocation is now done as: `await ctx.send_help(ctx.command)`
| | * | | | | Use `send_help` to invoke command helpGravatar Sebastiaan Zeeff2020-05-17-2/+1
| | | |/ / / | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After the refactoring of the help command, we need to use the built-in method of calling the help command: `Context.send_help`. As an argument, the qualified name (a string containing the full command path, including parents) of the command can be passed. Examples: - await ctx.send_help("reminders edit") This would send a help embed with information on `!reminders edit` to the Context. - await ctx.send_help(ctx.command.qualified_name) This would extract the qualified name of the command, which is the full command path, and send a help embed to Context. - await ctx.send_help() This will send the main "root" help embed to the Context.
| * / | | | Change tests to use the new timeout constantGravatar Numerlor2020-05-15-1/+5
| |/ / / /
* / / / / Improve LinePaginator to support long linesGravatar Kyle Stanley2020-06-04-7/+34
|/ / / /
* | | | Tests: change avatar_url_as assertion to use static_formatGravatar MarkKoz2020-04-30-1/+1
| | | |
* | | | Add DMChannel tests for in_whitelist decoratorGravatar Sebastiaan Zeeff2020-04-27-31/+63
| | | | | | | | | | | | | | | | | | | | | | | | The `in_whitelist` decorator should not fail when a decorated command was called in a DMChannel; it should simply conclude that the user is not allowed to use the command. I've added a test case that uses a DMChannel context with User, not Member, objects. In addition, I've opted to display a test case description in the `subTest`: Simply printing the actual arguments and context is messy and does not actually show you the information you'd like. This description is enough to figure out which test is failing and what the gist of the test is.
* | | | Add mock for discord.DMChannelsGravatar Sebastiaan Zeeff2020-04-27-0/+21
| | | |
* | | | Exclude never-run lines from coverageGravatar Sebastiaan Zeeff2020-04-27-2/+2
| | | |
* | | | Simplify `in_whitelisted_context` decorator APIGravatar Sebastiaan Zeeff2020-04-23-32/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The API of the `in_whitelisted_context` decorator was a bit clunky: - The long parameter names frequently required multiline decorators - Despite `#bot-commands` being the defacto default, it needed to be passed - The name of the function, `in_whitelisted_context` is fairly long in itself To shorten the call length of the decorator, the parameter names were shortened by dropping the `whitelisted_` prefix. This means that the parameter names are now just `channels`, `categories`, and `roles`. This already means that all current usages of the decorator are reduced to one line. In addition, `#bot-commands` has now been made the default redirect channel for the decorator. This means that if no `redirect` was passed, users will be redirected to `bot-commands` to use the command. If needed, `None` (or any falsey value) can be passed to disable redirection. Passing another channel id will trigger that channel to be used as the redirection target instead of bot-commands. Finally, the name of the decorator was shortened to `in_whitelist`, which already communicates what it is supposed to do.
* | | | Add tests for `in_whitelisted_context` decoratorGravatar Sebastiaan Zeeff2020-04-23-0/+115
| | | | | | | | | | | | | | | | I have added tests for the new `in_whitelisted_context` decorator. They work by calling the decorator with different kwargs to generate a specific predicate callable. That callable is then called to assess if it comes to the right conclusion.
* | | | Remove vestigial kwargs from MockTextChannel.__init__Gravatar Sebastiaan Zeeff2020-04-23-1/+1
| | | |
* | | | Replace `in_channel` decorator by `in_whitelisted_context`Gravatar Sebastiaan Zeeff2020-04-23-2/+2
| |/ / |/| | | | | | | | | | | | | | | | | | | | The `in_channel` decorator that served as a factory for `in_channel` checks was replaced by the broaded `in_whitelisted_context` decorator. This means that we can now whitelist commands using channel IDs, category IDs, and/or role IDs. The whitelists will be applied in an "OR" fashion, meaning that as soon as some part of the context happens to be whitelisted, the `predicate` check the decorator produces will return `True`. To reflect that this is now a broader decorator that checks for a whitelisted *context* (as opposed to just whitelisted channels), the exception the predicate raises has been changed to `InWhitelistedContextCheckFailure` to reflect the broader scope of the decorator. I've updated all the commands that used the previous version, `in_channel`, to use the replacement.
* | | (Syncer Tests): Replaced wrong side effectGravatar ks1292020-04-09-1/+2
|/ / | | | | Replaced `TimeoutError` with `asyncio.TimeoutError`.
* | Set unsilence permissions to inherit instead of trueGravatar Sebastiaan Zeeff2020-03-30-1/+1
| | | | | | | | | | | | The "unsilence" action of the silence/hush command used `send_messages=True` when unsilencing a hushed channel. This had the side effect of also enabling send messages permissions for those with the Muted rule, as an explicit True permission apparently overwrites an explicit False permission, even if the latter was set for a higher top-role. The solution is to revert back to the `Inherit` permission by assigning `None`. This is what we normally use when Developers are allowed to send messages to a channel.
* | Merge branch 'master' into hush-cogGravatar Eivind Teig2020-03-30-58/+131
|\ \
| * | Snekbox tests: use `get_code` in `test_continue_eval_does_continue`Gravatar MarkKoz2020-03-25-3/+6
| | |
| * | Snekbox tests: test `get_code`Gravatar MarkKoz2020-03-25-4/+32
| | | | | | | | | | | | | | | Should return 1st arg (or None) if eval cmd in message, otherwise return full content.
| * | Cog tests: comment some code for clarificationGravatar MarkKoz2020-03-16-0/+3
| | |
| * | Cog tests: fix error on import due to discord.ext.tasks.loopGravatar MarkKoz2020-03-13-3/+5
| | | | | | | | | | | | | | | The tasks extensions loop requires an event loop to exist. To work around this, it's been mocked.