aboutsummaryrefslogtreecommitdiffstats
path: root/tests (follow)
Commit message (Collapse)AuthorAgeLines
...
| * | | | 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
| | | | |\ \ \ \ \ \
| | | | * | | | | | | Removes Unused Mock ResetGravatar Hassan Abouelela2021-03-12-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Hassan Abouelela <[email protected]>
| | | | * | | | | | | Use Mock Side Effect Instead Of Extra FunctionGravatar Hassan Abouelela2021-03-10-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changes the mock used for creating an erroneous function in the silence tests cog to use the side effect property instead of an extra function. Signed-off-by: Hassan Abouelela <[email protected]>
| | | | * | | | | | | Simplifies Redundant Unsilence Target TestGravatar Hassan Abouelela2021-03-10-33/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Removes redundant functionality from the `test_unsilence_helper_fail` test as it is covered by another test. Keeps the functionality that isn't being tested elsewhere. Signed-off-by: Hassan Abouelela <[email protected]>
| | | | * | | | | | | Combine Silence Target TestsGravatar Hassan Abouelela2021-03-10-38/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Combine two tests that are responsible for checking the silence helper uses the correct channel and message. Signed-off-by: Hassan Abouelela <[email protected]>
| | | | * | | | | | | Merge branch 'master' into voicechannel-muteGravatar Hassan Abouelela2021-03-10-3/+3
| | | | |\ \ \ \ \ \ \
| | | | * | | | | | | | Modifies Silence TestsGravatar Hassan Abouelela2021-02-05-15/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds a missing test assertion, and seperates the voice and text components of a test. Signed-off-by: Hassan Abouelela <[email protected]>
| | | | * | | | | | | | Modifies Silence TestsGravatar Hassan Abouelela2021-02-05-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds a missing test assertion, and seperates the voice and text components of a test. Signed-off-by: Hassan Abouelela <[email protected]>
| | | | * | | | | | | | Separates Voice Overwrite TestsGravatar Hassan Abouelela2021-02-04-9/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Hassan Abouelela <[email protected]>
| | | | * | | | | | | | Adds Move To Failure TestsGravatar Hassan Abouelela2021-02-04-0/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Hassan Abouelela <[email protected]>
| | | | * | | | | | | | Updates Voice Kick Restriction TestsGravatar Hassan Abouelela2021-02-04-9/+17
| | | | | | | | | | | |
| | | | * | | | | | | | Merge branch 'master' into voicechannel-muteGravatar Hassan Abouelela2021-02-04-39/+64
| | | | |\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | # Conflicts: # bot/constants.py
| | | | * | | | | | | | | Cleans Up Voice Sync TestsGravatar Hassan Abouelela2021-01-10-18/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cleans up the tests related to the voice sync/kick functions by adding a helper method to simplify mocking.
| | | | * | | | | | | | | Cleans Up & Simplifies TestsGravatar Hassan Abouelela2021-01-10-78/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cleans up the silence tests by removing unneeded or repeated mocks. Simplifies tests where possible by joining similar tests.
| | | | * | | | | | | | | Breaks Out Send Message TestsGravatar Hassan Abouelela2020-12-29-75/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Moves the tests for the helper method `send_message` to simplify tests, and avoid repeated code.
| | | | * | | | | | | | | Makes Kick Keyword Only ParameterGravatar Hassan Abouelela2020-12-29-1/+1
| | | | | | | | | | | | |
| | | | * | | | | | | | | Refractors Helper Method SignaturesGravatar Hassan Abouelela2020-12-29-11/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changes the signatures of a few helper methods to make them more concise and understandable.
| | | | * | | | | | | | | Merge branch 'master' into voicechannel-muteGravatar Hassan Abouelela2020-12-22-23/+7
| | | | |\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Hassan Abouelela<[email protected]> # Conflicts # bot/exts/moderation/silence.py # bot/exts/moderation/test_silence.py
| | | | * | | | | | | | | | Fixes Voice Silence TestsGravatar Hassan Abouelela2020-12-01-34/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Hassan Abouelela <[email protected]>
| | | | * | | | | | | | | | Refractors According To Style GuideGravatar Hassan Abouelela2020-11-28-64/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Updates changes made in the PR to be more inline with style guide. Signed-off-by: Hassan Abouelela <[email protected]>
| | | | * | | | | | | | | | Refractors Voice Sync HelperGravatar Hassan Abouelela2020-11-28-49/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Refractors the voice sync helper function into two different functions, one for each purpose. Moves the afk_channel get/creation code to its own function. Updates tests. Signed-off-by: Hassan Abouelela <[email protected]>
| | | | * | | | | | | | | | Clarifies Constants Use in SilenceGravatar Hassan Abouelela2020-11-28-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changes all usages of bot.constant to use dotted path to remove confusion and namespace collision. Signed-off-by: Hassan Abouelela <[email protected]>
| | | | * | | | | | | | | | Fixes Typo in Silence TestsGravatar Hassan Abouelela2020-11-24-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Hassan Abouelela <[email protected]>
| | | | * | | | | | | | | | Moves VoiceChat Sync Out of Overwrites FunctionGravatar Hassan Abouelela2020-11-24-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | VoiceChat sync only needs to be called when the command is invoked, instead of while updating permissions. Moved call to command function to reflect that, and fixed failing tests. Signed-off-by: Hassan Abouelela <[email protected]>
| | | | * | | | | | | | | | Refractors SendMessage FunctionGravatar Hassan Abouelela2020-11-24-22/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Refractors the send message function in silence to make it more understandable and flexible. Signed-off-by: Hassan Abouelela <[email protected]>