aboutsummaryrefslogtreecommitdiffstats
path: root/tests/base.py (unfollow)
Commit message (Collapse)AuthorLines
2020-06-01Source: Update `get_source_link` docstringGravatar ks129-1/+1
2020-06-01Source: Move calling `get_source_link` to `build_embed`Gravatar ks129-10/+14
2020-06-01Source: Simplify tags name and location parsingGravatar ks129-9/+15
2020-06-01Tags: Add tag file location storage to cacheGravatar ks129-0/+1
2020-05-31Source: Include tag into converter's `BadArgument` raisingGravatar ks129-1/+1
2020-05-31Source: Show aliases on title of command source embedGravatar ks129-1/+2
2020-05-31Source: Simplify importsGravatar ks129-12/+12
2020-05-31Source: In converter move cog checking before commandGravatar ks129-4/+4
2020-05-31Source: Add command and cog prefixes to title of embedGravatar ks129-2/+2
2020-05-31Source: Few text fixes, made help command detection betterGravatar ks129-3/+3
2020-05-31Source: Add thumbnail to source command bot repo embedGravatar ks129-0/+1
2020-05-31Source: Show only first line of every source item docstring instead fullGravatar ks129-5/+4
2020-05-31Source: Implement file and line showing in source embed footerGravatar ks129-7/+10
2020-05-31Source: Move big unions to variable of typeGravatar ks129-3/+5
2020-05-31Source: Migrate from os.path to PathGravatar ks129-4/+6
2020-05-31Source: Implement tags file showing to source commandGravatar ks129-16/+27
2020-05-31Source: Direct aliases to their original commandsGravatar ks129-7/+17
2020-05-31Source: Remove checks running from source commandGravatar ks129-5/+2
2020-05-31Source: Fix docstringsGravatar ks129-4/+4
Co-authored-by: Mark <[email protected]>
2020-05-30Oops, add the return back.Gravatar Leon Sandøy-0/+1
We do not wanna process bot messages.
2020-05-30Free tag: link #how-to-get-helpGravatar kwzrd-2/+2
This creates a clickable link in the response embed. Referencing the category is no longer necessary.
2020-05-30Scheduler: Move space from f-string of `ctx.send` to `infr_message`Gravatar ks129-2/+2
2020-05-30Scheduler: Remove line splitting from `ctx.send` after 7f827abGravatar ks129-4/+1
2020-05-30Infr. Tests: Add `apply_infraction` awaiting assertion with argsGravatar ks129-0/+6
2020-05-30Scheduler: Fix spaces for modlog textGravatar ks129-1/+1
Co-authored-by: Mark <[email protected]>
2020-05-30Scheduler: Remove unnecessary `f` before stringGravatar ks129-1/+1
2020-05-30Scheduler: Add try-except to infraction deletionGravatar ks129-1/+6
2020-05-30Scheduler: Remove invalid commentGravatar ks129-1/+0
2020-05-30Scheduler: Move inline f-string if-else statement to normal if statementGravatar ks129-1/+4
2020-05-30Simplify infraction reason truncation testsGravatar ks129-13/+7
2020-05-30Tags: explicitly use UTF-8 to read filesGravatar MarkKoz-1/+1
Not all operating systems use UTF-8 as the default encoding. For systems that don't, reading tag files with Unicode would cause an unhandled exception. (cherry picked from commit adc75ff9bbcf8b905bd78c78f253522ae5e42fc3)
2020-05-30Removing the periodic ping from verification.Gravatar Leon Sandøy-43/+1
It's no longer needed, and causes problems with anti-raid and anti-spam.
2020-05-29Reduce the number of help channel name changesGravatar Sebastiaan Zeeff-29/+3
Discord has introduced a new, strict rate limit for individual channel edits that reduces the number of allow channel name/channel topic changes to 2 per 10 minutes per channel. Unfortunately, our help channel system frequently goes over that rate limit as it edits the name and topic of a channel on all three "move" actions we have: to available, to occupied, and to dormant. In addition, our "unanswered" feature adds another channel name change on top of the move-related edits. That's why I've removed the topic/emoji changing features from the help channel system. This means we now have a generic topic that fits all three categories and no status emojis in the channel names.
2020-05-29Fix `check_for_answer` breaking on missing cacheGravatar Sebastiaan Zeeff-2/+5
The `check_for_answer` method of the HelpChannels cog relies on the channel->claimant cache being available. However, as this cache is (currently) lost during bot restarts, this method may fail with a KeyError exception. I've used `dict.get` with an `if not claimant: return` to circumvent this issue.
2020-05-29Ignore response when posting python newsGravatar Matteo Bertucci-0/+1
Sometimes a mailing list user doesn't press respond correctly to the email, and so a response is sent as a separate thread. To keep only new threads in the channel, we need to ignore those.
2020-05-28Move the `self.redis_closed` into session create.Gravatar Leon Sandøy-1/+1
2020-05-28Prevent a state where a coro could wait forever.Gravatar Leon Sandøy-2/+6
This addresses a review comment by @aeros.
2020-05-28Add custom exceptions for each error state.Gravatar Leon Sandøy-8/+21
The bot can get into trouble in three distinct ways: - It has no Bot instance - It has no namespace - It has no parent instance. These happen only if you're using it wrong. To make the test more precise, and to add a little bit more readability (RuntimeError could be anything!), we'll introduce some custom exceptions for these three states. This addresses a review comment by @aeros.
2020-05-28Make prefix consts private and more precise.Gravatar Leon Sandøy-9/+9
2020-05-28Reduce complexity on some of the typestring stuff.Gravatar Leon Sandøy-31/+9
- Refactor error messages in _to_typestring and _from_typestring to just print the prefix tuples instead of that custom error string. - Create a RedisKeyOrValue type to simplify some annotations. - Simplify partialmethod calls. - Make the signatures for _to_typestring and _from_typestring one-liners - Fix a typo in the errors.
2020-05-27Fix ATROCIOUS comment.Gravatar Leon Sandøy-3/+5
I should be shot.
2020-05-27Refactor typestring converters to partialmethods.Gravatar Leon Sandøy-30/+24
We're using functools.partialmethod to make the code a little cleaner and more readable here. Read more about them here: https://docs.python.org/3/library/functools.html#functools.partial https://docs.python.org/3/library/functools.html#functools.partialmethod
2020-05-27Floats are no longer permitted as RedisCache keys.Gravatar Leon Sandøy-43/+86
Also added a test for this. This is the DRYest approach I could find. It's a little ugly, but I think it's probably good enough.
2020-05-27Add some tests for `in_whitelist_check`.Gravatar Leon Sandøy-0/+48
2020-05-27Remove the now deprecated in_channel_check.Gravatar Leon Sandøy-16/+0
This check was no longer being used anywhere, having been replaced by in_whitelist_check.
2020-05-27Refactor .increment and add lock test.Gravatar Leon Sandøy-65/+109
The way we were doing the asyncio.Lock() stuff for increment was slightly problematic. @aeros has adviced us that it's better to just initialize the lock as None in __init__, and then initialize it inside the first coroutine that uses it instead. This ensures that the correct loop gets attached to the lock, so we don't end up getting errors like this one: RuntimeError: got Future <Future pending> attached to a different loop This happens because the lock and the actual calling coroutines aren't on the same loop. When creating a new test, test_increment_lock, we discovered that we needed a small refactor here and also in the test class to make this new test pass. So, now we're creating a DummyCog for every test method, and this will ensure the loop streams never cross. Cause we all know we must never cross the streams.
2020-05-27Clear cache in asyncSetUp instead of tests.Gravatar Leon Sandøy-6/+1
2020-05-27Allow some commands to fail checks silently.Gravatar Leon Sandøy-2/+9
For example, we don't want the mod commands to produce any kind of error message when run by ordinary users in regular channels - these should have the perception of being invisible and unavailable.
2020-05-27No redirect for mod management.Gravatar Leon Sandøy-0/+1
2020-05-27Find + change all InWhitelistCheckFailure importsGravatar Leon Sandøy-9/+8