| Commit message (Collapse) | Author | Age | Lines |
| ... | |
| | | | | | | | | | |
|
| | | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
It's not really necessary to set to True when mocking functions.
|
| | | | | | | | | | |
|
| | | | | | | | | | |
|
| | | | | | | | | | |
|
| | | | | | | | | | |
|
| | | | | | | | | | |
|
| | | | | | | | | | |
|
| | | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
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.
|
| | | | | | | | | | |
|
| | | | | | | | | | |
|
| |\ \ \ \ \ \ \ \ \
| | |_|/ / / / / /
| |/| | | | | | | |
|
| | |\ \ \ \ \ \ \ \
| | |_|/ / / / / /
| |/| | | | | | | |
Add userid decoding and user token detection to the token removal moderation feature
|
| | | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
extract_user_id(id) is not None does the same job and is not worth the extra function
|
| | | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
Clean up mock usage, docstrings, unnecessarily split-lined function calls
|
| | | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
the current server
Also adjust the naming and purposes of the format messages to KNOWN and UNKNOWN token messages.
|
| | | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
userid -> user ID
maybevalid -> maybe_valid
remove collections import
and added a new function that handles the "format user ID log message" and should_ping_everyone feature
|
| | | |\ \ \ \ \ \ \
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
Resynchronize changes with the new cog folder arrangement
|
| | | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
Handles cases like xxx.xxxxx.xxxxxxxx where a user has intentionally censored part of a token, and will not consider them "valid"
|
| | | | |_|_|_|_|_|/
| | |/| | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
in the server
Updated tests
This comes with a change that a user ID must actually be able to be decoded into an integer to be considered a valid token
|