aboutsummaryrefslogtreecommitdiffstats
path: root/tests (follow)
Commit message (Collapse)AuthorAgeLines
* Fix imports in slowmode testsGravatar Den42002020-07-06-3/+3
|
* Improve set_slowmode tests by checking whether the channel was editedGravatar Den42002020-07-06-8/+22
|
* Add multiple test cases for set_slowmode testsGravatar Den42002020-07-06-10/+34
|
* Use local text_channel instead of instance attributeGravatar Den42002020-07-06-13/+10
|
* Add tests for set_slowmodeGravatar Den42002020-07-06-0/+20
|
* Add tests for reset_slowmodeGravatar Den42002020-07-06-3/+22
|
* Add tests for cog_check and get_slowmodeGravatar Den42002020-07-06-0/+37
|
* Merge branch 'master' into issue926-paginate-long-linesGravatar Kyle Stanley2020-06-26-191/+514
|\
| * Merge branch 'master' into bug/backend/bot-50/sync-ignore-guildsGravatar kwzrd2020-06-22-10/+85
| |\
| | * Merge branch 'master' into logging-testsGravatar Kieran Siek2020-06-22-200/+1047
| | |\
| | | * Merge branch 'master' into bug/mod/bot-2a/webhook-clydeGravatar kwzrd2020-06-20-10/+26
| | | |\
| | | | * Merge branch 'master' into bug/filters/bot-58/removers-ignore-dmsGravatar Dennis Pham2020-06-19-1/+3
| | | | |\
| | | | | * Merge branch 'master' into help_channel_rediscacheGravatar Kieran Siek2020-06-16-167/+361
| | | | | |\
| | | | | * \ Merge branch 'master' into help_channel_rediscacheGravatar Leon Sandøy2020-06-06-9/+8
| | | | | |\ \
| | | | | * | | Add support for bool values in RedisCacheGravatar Leon Sandøy2020-05-31-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We're gonna need this for the help channel handling, and it seems like a reasonable type to support anyway. It requires a tiny bit of special handling, but nothing outrageous.
| | | | * | | | Token remover: exit early if message already deletedGravatar MarkKoz2020-06-15-1/+14
| | | | | | | |
| | | | * | | | Token remover: move bot check to on_messageGravatar MarkKoz2020-06-15-16/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It just makes more sense to me to filter out messages at an earlier stage.
| | | | * | | | Token remover: ignore DMsGravatar MarkKoz2020-06-15-0/+10
| | | | | |_|/ | | | | |/| | | | | | | | | | | | | | | | | | | | | | | It's a private channel so there's no risk of a token "leaking". Furthermore, messages cannot be deleted in DMs.
| | | * / | | Write unit test for `sub_clyde`Gravatar kwzrd2020-06-20-0/+27
| | | |/ / /
| | * | | | Logging Tests: Simplify `DEBUG_MODE` `False` testGravatar ks1292020-05-22-11/+1
| | | | | | | | | | | | | | | | | | | | | | | | - Remove embed attributes checks - Replace `self.dev_log.assert_awaited_once_with` with `self.dev_log.assert_awaited_once`.
| | * | | | Merge branch 'master' into logging-testsGravatar ks1292020-05-17-10/+178
| | |\ \ \ \
| | * | | | | Created tests for `bot.cogs.logging` connected message.Gravatar ks1292020-04-14-0/+42
| | | | | | |
| * | | | | | Sync: fix guild ID checkGravatar MarkKoz2020-06-17-16/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Need to compare the IDs against each other rather than the Guild object against the ID.
| * | | | | | Sync: ignore 404s in on_user_updateGravatar MarkKoz2020-06-14-7/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 404s probably mean the user is from another guild.
| * | | | | | Sync tests: test listeners ignore events from other guildsGravatar MarkKoz2020-06-14-10/+54
| | |_|/ / / | |/| | | |
| * | | | | Merge pull request #937 from python-discord/bug/filters/928/non-ascii-tokenGravatar Mark2020-06-12-102/+285
| |\ \ \ \ \ | | | | | | | | | | | | | | Make token detection more robust and completely rewrite its tests
| | * \ \ \ \ Merge remote-tracking branch 'origin/master' into ↵Gravatar MarkKoz2020-06-02-40/+645
| | |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | bug/filters/928/non-ascii-token
| | * | | | | | Token remover: remove the `delete_message` functionGravatar MarkKoz2020-06-02-12/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's redundant; there's no benefit here in abstracting two lines of code into a function.
| | * | | | | | Test find_token_in_message returns None for invalid matchesGravatar MarkKoz2020-05-28-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This covers the case when a token is matched, but its user ID and timestamp turn out to be invalid.
| | * | | | | | Adjust find_token_in_message tests for the recent cog changesGravatar MarkKoz2020-05-28-19/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It now supports the changes that switched to finditer, added match groups, and added the Token NamedTuple. It also accounts for the is_maybe_token function being removed. For the sake of simplicity, call assertions on is_valid_user_id and is_valid_timestamp were not made.
| | * | | | | | Remove is_maybe_token testsGravatar MarkKoz2020-05-28-33/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The function was removed due to redundancy. Therefore, its tests are obsolete.
| | * | | | | | Add more thorough and realistic inputs for token ID and timestamp testsGravatar MarkKoz2020-05-27-18/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The tests for valid inputs and invalid inputs were split to make them more readable.
| | * | | | | | Adjust token remover tests to use the Token NamedTupleGravatar MarkKoz2020-05-27-6/+8
| | | | | | | |
| | * | | | | | Switch findall to finditer in assertionsGravatar MarkKoz2020-05-27-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `find_token_in_message` now uses the latter so the tests should adjust accordingly.
| | * | | | | | Use real token values for testing multiple matches in regexGravatar MarkKoz2020-05-25-3/+4
| | | | | | | |
| | * | | | | | Fix multiple match text for token regexGravatar MarkKoz2020-05-25-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It has to account for the addition of groups. It's easiest to compare the entire string so `finditer` is used to return re.Match objects; the tuples of `findall` would be cumbersome. Also threw in a change to use `assertCountEqual` cause the order doesn't really matter.
| | * | | | | | Fix valid token regex testGravatar MarkKoz2020-05-25-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It was broken due to the addition of groups. Rather than returning the full match, `findall` returns groups if any exist. The test was comparing a tuple of groups to the token string, which was of course failing. Now `fullmatch` is used cause it's simpler - just check for `None` and don't worry about iterating matches to search.
| | * | | | | | Add more valid tokens to test the regex withGravatar MarkKoz2020-05-25-3/+5
| | | | | | | |
| | * | | | | | Test token regex won't match non-base64 charactersGravatar MarkKoz2020-05-25-4/+3
| | | | | | | |
| | * | | | | | Fix a test needlessly being a coroutineGravatar MarkKoz2020-05-13-1/+1
| | | | | | | |
| | * | | | | | Use subtests for valid ID/timestamp tests and test non-ASCII inputsGravatar MarkKoz2020-05-11-18/+25
| | | | | | | |
| | * | | | | | Clean up token remover test importsGravatar MarkKoz2020-05-11-16/+12
| | | | | | | |
| | * | | | | | Replace deprecated assertion methodsGravatar MarkKoz2020-05-11-2/+2
| | | | | | | |
| | * | | | | | Refactor `TokenRemoverSetupTests` and add a more thorough testGravatar MarkKoz2020-05-11-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The test now ensures the cog is instantiated and that the instance is passed as an argument to `add_cog`.
| | * | | | | | Test TokenRemover.take_actionGravatar MarkKoz2020-05-11-43/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Remove `bot.get_cog` mocks in `setUp` * Mock the logger cause it's easier to assert logs * Remove subtests * Assert helper functions were called * Create an autospec for ModLog
| | * | | | | | Test TokenRemover.format_log_messageGravatar MarkKoz2020-05-11-0/+16
| | | | | | | |
| | * | | | | | Test token remover's message deletionGravatar MarkKoz2020-05-11-0/+9
| | | | | | | |
| | * | | | | | Simplify token remover's message mockGravatar MarkKoz2020-05-11-9/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Rely on default values for the author * Set the content to a non-empty string
| | * | | | | | Avoid instantiating the cog when testing static/class methodsGravatar MarkKoz2020-05-11-10/+5
| | | | | | | |
| | * | | | | | Correct the return type annotation for the autospec decoratorGravatar MarkKoz2020-05-11-2/+2
| | | | | | | |