aboutsummaryrefslogtreecommitdiffstats
path: root/tests (follow)
Commit message (Collapse)AuthorAgeLines
* Move to timezone aware datetimes (#1895)Gravatar Boris Muratov2021-10-22-36/+41
| | | | | | | | | | | | | | | | * Move to timezone aware datetimes With the shift of the discord.py library to timezone aware datetimes, this commit changes datetimes throughout the bot to be in the UTC timezone accordingly. This has several advantages: - There's no need to discard the TZ every time the datetime of a Discord object is fetched. - Using TZ aware datetimes reduces the likelihood of silently adding bugs into the codebase (can't compare an aware datetime with a naive one). - Our DB already stores datetimes in UTC, but we've been discarding the TZ so far whenever we read from it. Specific places in the codebase continue using naive datetimes, mainly for UI purposes (for examples embed footers use naive datetimes to display local time). * Improve ISODateTime converter documentation Co-authored-by: Kieran Siek <[email protected]>
* Merge branch 'main' into new-appeals-processGravatar ChrisJL2021-10-17-74/+133
|\
| * Merge remote-tracking branch 'origin/main' into discord-2.0Gravatar Matteo Bertucci2021-10-17-26/+6
| |\
| | * Merge remote-tracking branch 'origin/main' into experiments/isortGravatar Matteo Bertucci2021-10-15-7/+10
| | |\
| | * | ISort: give the codebase a sortGravatar Matteo Bertucci2021-10-14-29/+6
| | | |
| * | | Merge branch 'main' into discord-2.0Gravatar Matteo Bertucci2021-10-15-9/+9
| |\ \ \ | | | |/ | | |/|
| | * | Fix newlines after imports and address reviewGravatar Izan2021-10-14-1/+0
| | | | | | | | | | | | | | | | There's now always one blank line (no more, no less) after an import
| | * | Migrate to `bot.log.get_logger` functionGravatar Izan2021-10-14-8/+9
| | |/
| * | Merge branch 'main' into discord-2.0Gravatar Matteo Bertucci2021-10-10-16/+32
| |\|
| | * Merge branch 'main' into ignore-infra-mods-errorsGravatar Joe Banks2021-10-05-10/+23
| | |\
| | | * Mock fetch_member in tests that user get_or_fetch nowGravatar Chris Lovering2021-09-29-6/+15
| | | |
| | | * Use scheduling create_task util instead of creating from loop directlyGravatar Numerlor2021-09-11-4/+8
| | | | | | | | | | | | | | | | | | | | The util attaches an error logging callback instead of relying on python's exception logging which only occurs when the task is destroyed
| | * | Fix testsGravatar Izan2021-09-01-6/+9
| | |/
| * | Test incidents: correct avatar referenceGravatar Matteo Bertucci2021-10-05-1/+1
| | |
| * | avatar.url -> display_avatar.urlGravatar Matteo Bertucci2021-10-05-3/+3
| | | | | | | | | | | | avatar can apparently be none, which means traceback and a very sad akarys
| * | Silence tests: use thread permsGravatar Matteo Bertucci2021-09-15-10/+54
| | |
| * | Migrate to Discord.py 2.0a0Gravatar Matteo Bertucci2021-09-06-13/+32
| |/ | | | | | | | | | | | | | | Since the Discord.py repository has been archived, we can switch to the latest commit of 2.0a0, knowing no breaking change will occur (still pinned to the commit just in case). This commits fixes any problem related to the migration: - New avatar interface - TZ aware datetimes - Various inernal API changes
* / Update infraction DM tests to reflect new outputGravatar Chris Lovering2021-09-24-10/+10
|/
* Merge branch 'main' into converter-typehintsGravatar ChrisJL2021-08-24-6/+24
|\
| * Fix testsGravatar Izan2021-08-24-2/+2
| |
| * Merge branch 'main' into antispam-ignore-bot-mentionsGravatar Boris Muratov2021-08-23-5/+219
| |\
| * | Added some more test cases to ensure bot mentions aren't countedGravatar wookie1842021-08-23-1/+17
| | |
| * | Fix current tests by using MockMember in mention listsGravatar wookie1842021-08-23-3/+5
| | |
* | | Remove TagContentConverterGravatar Numerlor2021-08-23-38/+0
| |/ |/|
* | Merge branch 'main' into mbaruh/anti-spamGravatar Matteo Bertucci2021-08-23-5/+5
|\ \
| * | Merge branch 'main' into feat/mod/1665/override-auto-muteGravatar Boris Muratov2021-08-23-88/+68
| |\|
| * | Remove redundant parameter from pardon_voice_banGravatar MarkKoz2021-07-15-3/+3
| | |
| * | Fix get_active_infraction testGravatar MarkKoz2021-07-15-2/+2
| | |
* | | Additional comments and tests for slicingGravatar mbaruh2021-08-21-2/+2
| | |
* | | Fix MessageCache slicing bugs, improve testsGravatar mbaruh2021-08-21-19/+25
| | |
* | | AntiSpam modified to work with cacheGravatar mbaruh2021-08-21-0/+208
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | The anti-spam cog now uses a cache instead of reading channel history. The cache is for all channels in the guild, and does not remove deleted messages. That means that the anti-spam logic now works cross-channel and counts deleted messages. The size of the cache is determined via a new field in the config YAML file. The cache was implemented as a separate class, MessageCache, which uses circular buffer logic. This allows for constant time addition and removal form either side, and lookup. The cache does not support removal from the middle of the cache. The cache additionally stores a mapping from message ID's to the index of the message in the cache, to allow constant time lookup by message ID. The commit additionally adds accompanying tests, and renames `cache.py` to `caching.py` to better distinguish it from the new `message_cache.py` and convey that it's for general caching utilities.
* | Merge branch 'main' into mbaruh/jam-managementGravatar Boris Muratov2021-08-16-153/+675
|\ \
| * | Merge branch 'main' into new-discord-featuresGravatar Xithrius2021-07-20-167/+761
| |\|
| | * Merge branch 'main' into drop-gpl-depsGravatar Xithrius2021-07-08-98/+613
| | |\
| | | * Merge branch 'main' into voicechannel-muteGravatar Xithrius2021-07-08-86/+162
| | | |\
| | | * | Properly Handles Indefinite SilencesGravatar Hassan Abouelela2021-06-05-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes a bug that stopped the duration `forever` from getting used as a valid duration for silence. Signed-off-by: Hassan Abouelela <[email protected]>
| | | * | Merge branch 'main' into voicechannel-muteGravatar Kieran Siek2021-06-05-20/+7
| | | |\ \
| | | * | | Updates Shh Command To Mirror SilenceGravatar Hassan Abouelela2021-05-13-10/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Updates the shh and unshh commands from the error handler to accept channel and kick arguments, to give them the same interface as the silence and unsilence command. Signed-off-by: Hassan Abouelela <[email protected]>
| | | * | | Updates Silence To Accept Duration Or ChannelGravatar Hassan Abouelela2021-05-13-8/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Updates the silence command to accept the silence duration or channel as the first argument to the command. Updates tests. Signed-off-by: Hassan Abouelela <[email protected]>
| | | * | | Updates Silence To Use `.format`Gravatar Hassan Abouelela2021-05-12-10/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Uses `.format` to create silence and unsilence messages instead of `.replace`. Signed-off-by: Hassan Abouelela <[email protected]>
| | | * | | Merge remote-tracking branch 'fork/voicechannel-mute' into voicechannel-muteGravatar Hassan Abouelela2021-05-09-0/+554
| | | |\ \ \
| | | | * \ \ Merge branch 'main' into voicechannel-muteGravatar Hassan Abouelela2021-05-04-0/+554
| | | | |\ \ \
| | | * | | | | Uses Itertools Product To Reduce NestingGravatar Hassan Abouelela2021-05-09-24/+26
| | | |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Uses itertools.product to eliminate some nested for loops in tests. Signed-off-by: Hassan Abouelela <[email protected]>
| | | * | | | Adds Missing Voice Version Of TestsGravatar Hassan Abouelela2021-05-04-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Hassan Abouelela <[email protected]>
| | | * | | | Adds Voice Test Cases To Already Silenced TestGravatar Hassan Abouelela2021-05-04-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Hassan Abouelela <[email protected]>
| | | * | | | Copy Existing Text Channel Cache Tests For VoiceGravatar Hassan Abouelela2021-05-04-82/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Duplicates existing silence and unsilence cache tests for voice channels. Signed-off-by: Hassan Abouelela <[email protected]>
| | | * | | | Uses Async Asserts Where PossibleGravatar Hassan Abouelela2021-04-24-21/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Hassan Abouelela <[email protected]>
| | | * | | | Removes Unnecessary Members In Silence TestsGravatar Hassan Abouelela2021-04-21-16/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reduces the number of members created for each test to the bare minimum required. Signed-off-by: Hassan Abouelela <[email protected]>
| | | * | | | Merge branch 'main' into voicechannel-muteGravatar Hassan Abouelela2021-04-20-12/+77
| | | |\ \ \ \
| | | * \ \ \ \ Merge branch 'main' into voicechannel-muteGravatar Hassan Abouelela2021-04-06-18/+18
| | | |\ \ \ \ \