aboutsummaryrefslogtreecommitdiffstats
path: root/tests (follow)
Commit message (Collapse)AuthorAgeLines
* Merge branch 'master' into bug/backend/906/converter-year-rangeGravatar Joseph Banks2020-06-10-47/+824
|\
| * Merge branch 'master' into staff_count_serverGravatar kwzrd2020-06-05-5/+0
| |\
| | * Merge branch 'master' into stop_sending_avatar_hashGravatar Leon Sandøy2020-05-31-31/+638
| | |\
| | * | Fix failing tests related to avatar_hashGravatar Leon Sandøy2020-05-27-5/+0
| | | |
| * | | Merge branch 'master' into staff_count_serverGravatar Leon Sandøy2020-05-31-0/+247
| |\ \ \ | | | |/ | | |/|
| | * | Merge branch 'master' into ban-kick-reason-lengthGravatar Mark2020-05-30-31/+550
| | |\ \
| | | * \ Merge branch 'master' into test_antimalwareGravatar Sebastiaan Zeeff2020-05-30-35/+398
| | | |\ \
| | | * | | AntiMalware tests - Switched from monkeypatch to unittest.patchGravatar Jannes Jonkers2020-05-25-2/+2
| | | | | |
| | | * | | AntiMalware Refactor - Moved embed descriptions into constants, added tests ↵Gravatar Jannes Jonkers2020-05-11-18/+30
| | | | | | | | | | | | | | | | | | | | | | | | for embed descriptions
| | | * | | AntiMalware Tests - Removed exact log content checksGravatar Jannes Jonkers2020-05-11-19/+2
| | | | | |
| | | * | | AntiMalware Tests - added a missing case for no extensions in ↵Gravatar Jannes Jonkers2020-05-11-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | test_get_disallowed_extensions
| | | * | | AntiMalware Tests - extracted the method for determining disallowed ↵Gravatar Jannes Jonkers2020-05-11-6/+23
| | | | | | | | | | | | | | | | | | | | | | | | extensions and added a test for it.
| | | * | | AntiMalware Tests - implemented minor feedbackGravatar Jannes Jonkers2020-05-11-12/+12
| | | | | |
| | | * | | Update tests/bot/cogs/test_antimalware.pyGravatar MrGrote2020-05-08-1/+1
| | | | | | | | | | | | | | | | | | Co-authored-by: Mark <[email protected]>
| | | * | | AntiMalware Tests - Switched to unittest.IsolatedAsyncioTestCaseGravatar Jannes Jonkers2020-05-07-29/+19
| | | | | |
| | | * | | AntiMalware Tests - Added unittest for txt file attachmentGravatar Jannes Jonkers2020-05-07-2/+23
| | | | | |
| | | * | | AntiMalware Tests - Added unittest for valid attachmentGravatar Jannes Jonkers2020-05-07-0/+9
| | | | | |
| | | * | | AntiMalware Tests - Added unittest message deletion logGravatar Jannes Jonkers2020-05-07-4/+28
| | | | | |
| | | * | | AntiMalware Tests - Added unittest for cog setupGravatar Jannes Jonkers2020-05-07-0/+10
| | | | | |
| | | * | | AntiMalware Tests - Added unittest for messages that were deleted in the ↵Gravatar Jannes Jonkers2020-05-07-1/+19
| | | | | | | | | | | | | | | | | | | | | | | | meantime.
| | | * | | AntiMalware Tests - Added unittest for the embed for a python file.Gravatar Jannes Jonkers2020-05-07-1/+24
| | | | | |
| | | * | | AntiMalware Tests - Added unittest for messages send by staffGravatar Jannes Jonkers2020-05-07-1/+12
| | | | | |
| | | * | | AntiMalware Tests - Added unittests for deletion of message and ignoring of dmsGravatar Jannes Jonkers2020-05-07-1/+21
| | | | | |
| | | * | | AntiMalware Tests - Added unittest for message without attachmentGravatar Jannes Jonkers2020-05-07-0/+20
| | | | | |
| | * | | | Infr. Tests: Add `apply_infraction` awaiting assertion with argsGravatar ks1292020-05-30-0/+6
| | | | | |
| | * | | | Simplify infraction reason truncation testsGravatar ks1292020-05-30-13/+7
| | | | | |
| | * | | | Infr Tests: Make `get_active_infraction` return `None`Gravatar ks1292020-05-20-1/+1
| | | | | |
| | * | | | Infr. Test: Replace `get_active_mock` return valueGravatar ks1292020-05-20-1/+1
| | | | | | | | | | | | | | | | | | Replace `{"foo": "bar"}` with `{"id": 1}`
| | * | | | Infr. Tests: Replace `str` with `dict`Gravatar ks1292020-05-20-1/+1
| | | | | | | | | | | | | | | | | | To allow `.get`, I had to replace `str` return value with `dict`
| | * | | | Infr. Tests: Add more content to await commentGravatar ks1292020-05-20-2/+2
| | | | | |
| | * | | | ModLog Tests: Fix embed description truncate testGravatar ks1292020-05-20-1/+1
| | | | | |
| | * | | | Merge branch 'master' into ban-kick-reason-lengthGravatar ks1292020-05-20-11/+183
| | |\ \ \ \ | | | | |_|/ | | | |/| |
| | * | | | Infraction Tests: Small fixesGravatar ks1292020-05-20-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | - Remove unnecessary space from placeholder - Rename `has_active_infraction` to `get_active_infraction`
| | * | | | ModLog Tests: Fix truncation tests docstringGravatar ks1292020-05-20-1/+1
| | | | | | | | | | | | | | | | | | Co-authored-by: Leon Sandøy <[email protected]>
| | * | | | (Infractions and ModLog Tests): Replaced `shortening` with `truncation`, ↵Gravatar ks1292020-04-16-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | removed unnecessary type hint and added comment to kick truncation test about awaiting `kick`.
| | * | | | (ModLog Tests): Created reason shortening tests for `send_log_message`.Gravatar ks1292020-04-16-0/+29
| | | | | |
| | * | | | (Infraction Tests): Created reason shortening tests for ban and kick.Gravatar ks1292020-04-16-0/+54
| | | | | |
| | * | | | (Test Helpers): Added `__ge__` function to `MockRole` for comparing.Gravatar ks1292020-04-15-0/+4
| | | | | |
| * | | | | Fix busted test_information test.Gravatar Leon Sandøy2020-05-30-4/+8
| | |_|_|/ | |/| | | | | | | | | | | | | I wish this test didn't exist.
| * | | | Add custom exceptions for each error state.Gravatar Leon Sandøy2020-05-28-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The bot can get into trouble in three distinct ways: - It has no Bot instance - It has no namespace - It has no parent instance. These happen only if you're using it wrong. To make the test more precise, and to add a little bit more readability (RuntimeError could be anything!), we'll introduce some custom exceptions for these three states. This addresses a review comment by @aeros.
| * | | | Merge branch 'master' into redis_persistenceGravatar Leon Sandøy2020-05-27-10/+49
| |\ \ \ \
| | * | | | Add some tests for `in_whitelist_check`.Gravatar Leon Sandøy2020-05-27-0/+48
| | | | | |
| | * | | | Remove the now deprecated in_channel_check.Gravatar Leon Sandøy2020-05-27-8/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This check was no longer being used anywhere, having been replaced by in_whitelist_check.
| | * | | | Find + change all InWhitelistCheckFailure importsGravatar Leon Sandøy2020-05-27-2/+1
| | | | | |
| | * | | | Refactor the in_whitelist deco to a check.Gravatar Leon Sandøy2020-05-27-2/+2
| | | |/ / | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We're moving the actual predicate into the `utils.checks` folder, just like we're doing with most of the other decorators. This is to allow us the flexibility to use it as a pure check, not only as a decorator. This commit doesn't actually change any functionality, just moves it around.
| * | | | Floats are no longer permitted as RedisCache keys.Gravatar Leon Sandøy2020-05-27-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also added a test for this. This is the DRYest approach I could find. It's a little ugly, but I think it's probably good enough.
| * | | | Refactor .increment and add lock test.Gravatar Leon Sandøy2020-05-27-64/+99
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The way we were doing the asyncio.Lock() stuff for increment was slightly problematic. @aeros has adviced us that it's better to just initialize the lock as None in __init__, and then initialize it inside the first coroutine that uses it instead. This ensures that the correct loop gets attached to the lock, so we don't end up getting errors like this one: RuntimeError: got Future <Future pending> attached to a different loop This happens because the lock and the actual calling coroutines aren't on the same loop. When creating a new test, test_increment_lock, we discovered that we needed a small refactor here and also in the test class to make this new test pass. So, now we're creating a DummyCog for every test method, and this will ensure the loop streams never cross. Cause we all know we must never cross the streams.
| * | | | Clear cache in asyncSetUp instead of tests.Gravatar Leon Sandøy2020-05-27-6/+1
| | | | |
| * | | | Add a test for RuntimeErrors.Gravatar Leon Sandøy2020-05-26-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This just tests that the various RuntimeErrors are reachable - that includes the error about not having a bot instance, the one about not being a class attribute, and the one about not having instantiated the class. This test addresses a concern raised by @MarkKoz in a review. I've decided not to test that actual contents of these RuntimeErrors, because I believe that sort of testing is a bit too brittle. It shouldn't break a test just to change the content of an error string.
| * | | | Improve output of section name in config validation subtestsGravatar MarkKoz2020-05-25-1/+1
| | | | |