| Commit message (Collapse) | Author | Age | Lines |
| ... | |
| | | | | | | | | | | |
|
| | | | | | | | | | | |
|
| | | | | | | | | | | |
|
| | | | | | | | | | | |
|
| | | | | | | | | | | |
|
| | | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
They don't do anything because they patch the class rather than the
instance. It's too late for patching the instance to work since the
`setUp` fixture, which instantiates the cog, executes before the patches
do. Patching `setUp` would work (and its done in the other test cases),
but some tests in this case will need the unpatched function too.
Patching it doesn't serve much benefit to most tests anyway, so it's
not worth the effort trying to make them work where they aren't needed.
|
| | | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
The module is imported anyway to keep imports short and clean. Using it
in patch targets is shorter and allows for the two imports from the
module to be removed.
|
| | | | | | | | | | | |
|
| | | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
Duplicating strings in assertions is redundant, closely coupled, and
less maintainable.
|
| | | | | | | | | | | |
|
| | | | | | | | | | | |
|
| | | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
Use a False for `add_reactions` in the mock overwrite rather than None
to be sure the default (also None) is actually set for it.
Fix channels set by `_init_cog` not being mocked properly.
|
| | | | | | | | | | | |
|
| | | | | | | | | | | |
|
| | | | | | | | | | | |
|
| | | | | | | | | | | |
|
| | | | | | | | | | | |
|
| | | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
An `AsyncMock` fails because it returns a coroutine which may only be
awaited once. However, an `asyncio.Future` is perfect because it is
easy to create and can be awaited repeatedly, just like the actual
`asyncio.Task` that is being mocked.
|
| | | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
Reduce code redundancy by only defining them once.
|
| | | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
Now that there are separate test cases, there's no need to keep the
fixtures separate.
|
| | | | | | | | | | | |
|
| | | | | | | | | | | |
|
| | | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
Add a fixture to set up mocks for a successful `unsilence` call. This
reduces code redundancy.
|
| | | | | | | | | | | |
|
| | | | | | | | | | | |
|
| | | | | | | | | | | |
|
| | | | | | | | | | | |
|
| | | | | | | | | | | |
|
| | | | | | | | | | | |
|
| | | | | | | | | | | |
|
| | | | | | | | | | | |
|
| | | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
Moderation notifications are no longer sent so that doesn't need to be
tested.
|
| | | | | | | | | | | |
|
| | | | | | | | | | | |
|
| | | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
Not everything that's decorated needs the mocks that are patched. Being
required to add the args to the test function anyway is annoying. It's
especially bad if trying to decorate an entire test suite, as every
test would need the args.
Move the definition to a separate module to keep things cleaner.
|
| |/ / / / / / / / /
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
It's a more accurate name since it also reschedules unsilences now.
|
| |\ \ \ \ \ \ \ \ \
| | |/ / / / / / /
| |/| | | | | | | |
|
| | | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
It's clearer to write MAX_CHANNELS - 2 than a literal 48.
|
| | | | | | | | | | |
|
| | | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
The test has to account for not only the name not matching, but also
a lack of available spaces for new channels.
|
| | | | | | | | | | |
|
| | |\| | | | | | | |
|
| | | | | | | | | | |
|
| | | |\ \ \ \ \ \ \
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
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.
|
| | | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
Co-authored-by: MarkKoz <[email protected]>
|
| | | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
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]>
|
| | | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
Co-authored-by: MarkKoz <[email protected]>
|
| | | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
Co-authored-by: MarkKoz <[email protected]>
|
| | | |\ \ \ \ \ \ \ \ |
|
| | | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | | |
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]>
|