aboutsummaryrefslogtreecommitdiffstats
path: root/tests (follow)
Commit message (Collapse)AuthorAgeLines
* Merge branch 'master' into mod-utils-testsGravatar ks1292020-09-21-352/+1807
|\
| * Merge branch 'master' into feat/backend/160/cog-subdirsGravatar kosayoda2020-09-21-82/+157
| |\
| | * Merge branch 'master' into truncate-internal-evalGravatar Kieran Siek2020-09-16-122/+1305
| | |\
| | | * Merge branch 'master' into remove-wolframGravatar Leon Sandøy2020-09-02-0/+22
| | | |\
| | | | * Fixed old tests and added 2 new onesGravatar wookie1842020-09-01-0/+22
| | | | |
| | | * | Removed ImagePaginator testing.Gravatar Xithrius2020-08-31-15/+0
| | | |/
| | | * Merge branch 'master' into feat/backend/707/alias-decoratorGravatar Shirayuki Nekomata2020-08-26-32/+55
| | | |\
| | | | * Update tests for user commandsGravatar Joseph Banks2020-08-14-32/+55
| | | | |
| | | * | Include root aliases in the command name conflict testGravatar MarkKoz2020-08-22-0/+1
| | | |/
| | * | Change tests to work with the new file layout.Gravatar Numerlor2020-07-15-3/+3
| | | | | | | | | | | | | | | | 326beebe9b097731a39ecc9868e5e1f2bd762aae
| | * | Merge branch 'master' into truncate-internal-evalGravatar Numerlor2020-06-21-179/+662
| | |\ \ | | | | | | | | | | | | | | | | | | | | # Conflicts: # bot/utils/__init__.py
| | * \ \ Merge branch 'master' into truncate-internal-evalGravatar Numerlor2020-05-30-33/+390
| | |\ \ \
| | * | | | Add tests for `send_to_paste_service`.Gravatar Numerlor2020-05-08-0/+74
| | | | | |
| | * | | | Adjust behaviour for new func usage.Gravatar Numerlor2020-05-07-14/+5
| | | | | |
| | * | | | Remove tests from moved function.Gravatar Numerlor2020-05-07-15/+0
| | | | | |
| * | | | | Categorise most of the uncategorised extensionsGravatar MarkKoz2020-08-19-5/+5
| | | | | |
| * | | | | Rename "cogs" directory to "exts"Gravatar MarkKoz2020-08-14-97/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The directory contains modules, which are extensions. It only indirectly contains cogs through the extensions. Therefore, a technically more accurate name is "extensions", or "exts" when abbreviated. Furthermore, "exts" is consistent with SeasonalBot.
| * | | | | Fix ModLog importsGravatar MarkKoz2020-08-14-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bunch of modules still rely on importing the cog directly from the moderation package.
| * | | | | Prefix names of non-extension modules with _Gravatar MarkKoz2020-08-14-13/+14
| | | | | | | | | | | | | | | | | | | | | | | | This naming scheme will make them easy to distinguish from extensions.
| * | | | | Restructure tests and fix broken testsGravatar MarkKoz2020-08-14-37/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The cog tests structure should mirror the structure of the cogs folder. Fix some import/patch paths which broke due to the restructure.
| * | | | | Move extensions into sub-directoriesGravatar MarkKoz2020-08-13-14/+14
| | |_|_|/ | |/| | |
| * | | | Merge branch 'master' into whitelist_systemGravatar Leon Sandøy2020-08-03-3/+946
| |\ \ \ \
| | * | | | Jam tests: use the MAX_CHANNELS constant moreGravatar MarkKoz2020-07-22-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | It's clearer to write MAX_CHANNELS - 2 than a literal 48.
| | * | | | Jam tests: assert equality of new categoryGravatar MarkKoz2020-07-22-1/+2
| | | | | |
| | * | | | Jam tests: add subtests to non-existent category testGravatar MarkKoz2020-07-22-7/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The test has to account for not only the name not matching, but also a lack of available spaces for new channels.
| | * | | | Jam tests: fix category testGravatar MarkKoz2020-07-22-14/+24
| | | | | |
| | * | | | Merge branch 'master' into jam-testGravatar Mark2020-07-22-185/+1384
| | |\ \ \ \
| | | * | | | Edited tests to reflect changes (removed py formatting)Gravatar wookie1842020-07-20-3/+3
| | | | | | |
| | | * | | | Merge 'master' into 'kwzrd/incidents'; resolve config conflictsGravatar kwzrd2020-07-16-39/+24
| | | |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add upstream changes & resolve config conflicts introduced by #1041. In the conflicting parts of the diff, this commit also re-sorts constants which were added upstream to lexicographical order. This does **not** re-sort all constants added upstream.
| | | * | | | | Incidents: reduce log level of 404 exceptionGravatar kwzrd2020-07-16-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Co-authored-by: MarkKoz <[email protected]>
| | | * | | | | Incidents: link `proxy_url` if attachment fails to downloadGravatar kwzrd2020-07-14-37/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Suggested by Mark during review. If the download fails, we fallback on showing an informative message, which will link the attachment cdn link. The attachment-handling logic was moved from the `archive` coroutine into `make_embed`, which now also returns the file, if available. In the end, this appears to be the smoothest approach. Co-authored-by: MarkKoz <[email protected]>
| | | * | | | | Incidents: add `download_file` helper & testsGravatar kwzrd2020-07-13-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Co-authored-by: MarkKoz <[email protected]>
| | | * | | | | Incidents tests: improve in-line comment wordingGravatar kwzrd2020-07-09-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Co-authored-by: MarkKoz <[email protected]>
| | | * | | | | Merge 'master' into 'kwzrd/incidents'; resolve mod pkg init conflictGravatar kwzrd2020-07-08-24/+242
| | | |\ \ \ \ \
| | | * | | | | | Incidents: archive incident attachmentsGravatar kwzrd2020-07-03-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is no handling of file types as explained in the `archive` docstring. Testing indicates that relaying incidents with e.g. a text file attachment is simply a noop in the Discord GUI. If there is at least one attachment, we always only relay the one at index 0, as it is believed the user-sent messages can only contain one attachment at maximum. This also adds an extra test asserting the behaviour when an incident with an attachment is archived. The existing test for `archive` is adjusted to assume no attachments. Joe helped me conceive & test this. Co-authored-by: Joseph Banks <[email protected]>
| | | * | | | | | Incidents: relay incidents as embeds rather than raw contentGravatar kwzrd2020-07-01-21/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This applies the previously defined `make_embed` function. As the `archive` function is now simpler, I decided to reduce the amount of whitespace ~ it's a lot more compact now. Tests are adjusted as appropriate.
| | | * | | | | | Incidents: implement `make_embed` helper & testsGravatar kwzrd2020-07-01-0/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | See `make_embed` docstring for further information. The tests are fairly loose and should be easily adjustable in the future should changes be made.
| | | * | | | | | Incidents: pass `actioned_by` to `archive`Gravatar kwzrd2020-06-30-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is an important piece of information that shall be relayed.
| | | * | | | | | Incidents: revert latest 2 commitsGravatar kwzrd2020-06-30-46/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Decision was made to use embeds to archive incidents instead of webhooking the raw message. As such, we're reverting the branch to a state from which the adjustments will be easier to make. Reverted commits: * a8d179d9b04f54b20c5e870bcfa85c78c42c8dca * 6fa8caed037b247a7c194f58a4635de7dae21fd2
| | | * | | | | | Incidents: append `actioned_by` to webhook usernameGravatar kwzrd2020-06-21-6/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Incident author and the moderator who actioned report are now passed through `make_username` to create the webhook username. Tests adjusted as appropriate.
| | | * | | | | | Incidents: implement `make_username` helperGravatar kwzrd2020-06-21-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The justification is to incorporate the `actioned_by` name into the username in some way, and so the logical thing to do is to abstract this process into a helper so that it can easily be adjusted in the future. For now, I've chosen to separate the names by a pipe. Discord webhook username cannot exceed 80 characters in length, and so we cap it at this length by default. This is seen as more of an edge-case, but it should be accounted for, as we're not joining two names. The `max_length` param is configurable primarily for testing purposes, it probably should never be passed explicitly. This commit also provides two tests for the function.
| | | * | | | | | Incidents tests: assert webhook username is de-clydedGravatar kwzrd2020-06-20-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | See: a8b4e394d9da57287cd9497cd9bb0a97fa467e84
| | | * | | | | | Merge branch 'origin/master' into kwzrd/incidentsGravatar kwzrd2020-06-20-9/+50
| | | |\ \ \ \ \ \ | | | | | |_|_|_|/ | | | | |/| | | | | | | | | | | | | Adds the `sub_clyde` function, which we'll apply to our webhook.
| | | * | | | | | Incidents tests: remove unnecessary patchGravatar kwzrd2020-06-20-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is already being patched at class-level.
| | | * | | | | | Incidents: try-except Signal creationGravatar kwzrd2020-06-20-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Suggested by Mark during review. This follows the "ask for forgiveness rather than permission" paradigm, ends up being less code to read, and may be seen as more logical / safer. The `ALLOWED_EMOJI` set was renamed to `ALL_SIGNALS` as this now better communicates the set's purpose. Tests adjusted as appropriate. Co-authored-by: MarkKoz <[email protected]>
| | | * | | | | | Incidents tests: write tests for `on_raw_reaction_add`Gravatar kwzrd2020-06-19-0/+128
| | | | | | | | |
| | | * | | | | | Incidents tests: write tests for `crawl_incidents`Gravatar kwzrd2020-06-19-0/+58
| | | | | | | | |
| | | * | | | | | Incidents tests: add helper for mocking async for-loopsGravatar kwzrd2020-06-19-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | See the docstring. This does not make the ambition to be powerful enough to be included in `tests.helpers`, and is only intended for local purposes.
| | | * | | | | | Merge branch 'origin/master' into kwzrd/incidentsGravatar kwzrd2020-06-19-107/+302
| | | |\ \ \ \ \ \
| | | * | | | | | | Incidents tests: write tests for `process_event`Gravatar kwzrd2020-06-18-1/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This also breaks the helpers import statement into a vertical list, as the amount of imports has grown too much. I still believe that this is a preferred alternative to accessing the helpers via module namespace, as we use them a lot, and the added visual noise would be annoying to read - their names are already descriptive enough.