aboutsummaryrefslogtreecommitdiffstats
path: root/tests/helpers.py (unfollow)
Commit message (Collapse)AuthorLines
2020-02-18Use kwargs to set mock attributesGravatar Matteo-25/+11
2020-02-18Assert return value of Snekbox.post_evalGravatar Matteo-1/+3
2020-02-18Use a space instead of an empty string in test_get_status_emoji Gravatar Matteo Bertucci-1/+1
Because of the stripping, it should still be considered as empty Co-Authored-By: Mark <[email protected]>
2020-02-18Delete additional informations from subtest Gravatar Matteo Bertucci-1/+1
Reduce visual clutter Co-Authored-By: Mark <[email protected]>
2020-02-18Split assertions onto separate lines Gravatar Matteo Bertucci-4/+8
Reads better as separate lines Co-Authored-By: Mark <[email protected]>
2020-02-18Split assertion onto separate linesGravatar Matteo Bertucci-1/+2
Co-Authored-By: Mark <[email protected]>
2020-02-18Snekbox small refactoringGravatar Matteo-4/+3
Makes the code a bit clearer Co-authored-by: Shirayuki Nekomata <[email protected]>
2020-02-18Suppress HTTPException while deleting bot outputGravatar Matteo-2/+4
It was triggering an error if the user deleted the output before re-evaluating
2020-02-18Use pregenerated partialsGravatar Matteo-2/+5
This avoid recreating partials for each re-eval
2020-02-17Change snekbox api url to internal docker domain.Gravatar scragly-1/+1
NGINX has been dockerised, and proxy passes now reference internal container domains rather than referencing host or external domains. This will have a few extra benefits: - Less external factors involved for resolving the service address - Can work with the same address on development envs - Snekbox can be closed down entirely so it's inaccessible from external networks.
2020-02-14Stop scheduling expiration of permanent infractions on editGravatar Sebastiaan Zeeff-2/+5
https://github.com/python-discord/bot/issues/751 The infraction edit command defined in `bot.cogs.moderation.management` contained a bug causing it to attempt to schedule an expiration task when turning a temporary infraction into a permanent infraction. Since the "expires_at" field of a permanent infractions is `None`, this caused an exception to occur in the scheduler: Traceback (most recent call last): File "/bot/bot/cogs/moderation/scheduler.py", line 415, in _scheduled_task expiry = dateutil.parser.isoparse(infraction["expires_at"]).replace(tzinfo=None) File "/usr/local/lib/python3.7/site-packages/dateutil/parser/isoparser.py", line 37, in func return f(self, str_in, *args, **kwargs) File "/usr/local/lib/python3.7/site-packages/dateutil/parser/isoparser.py", line 134, in isoparse components, pos = self._parse_isodate(dt_str) File "/usr/local/lib/python3.7/site-packages/dateutil/parser/isoparser.py", line 208, in _parse_isodate return self._parse_isodate_common(dt_str) File "/usr/local/lib/python3.7/site-packages/dateutil/parser/isoparser.py", line 213, in _parse_isodate_common len_str = len(dt_str) TypeError: object of type 'NoneType' has no len() I have solved this by adding a check that makes sure we only schedule an expiration task when the `"expires_at"` field has a truthy value (which all valid datetime strings are) using `if request_data['expires_at']`. IMPORTANT NOTE: While it's tempting to just skip the entire scheduling block for permanent infractions, it's essential to unschedule existing expiration tasks for this infraction as we're changing a temporary infraction to a permanent infraction. This commit closes #751
2020-02-12Fix pagniation module for "last page" reactionGravatar mosguinz-1/+1
Fixes #746.
2020-02-09Remove clear reaction from paginatorsGravatar MarkKoz-17/+2
It could be confused with the delete reaction. Clearing reactions manually is rarely a useful feature anyway.