aboutsummaryrefslogtreecommitdiffstats
path: root/tests/helpers.py (unfollow)
Commit message (Collapse)AuthorLines
2020-02-12Sync tests: test Sync cog's on_guild_role_create listenerGravatar MarkKoz-0/+29
A POST request should be sent with the new role's data. * Add a fixture to create a MockRole
2020-02-12Sync tests: create a test case for listener testsGravatar MarkKoz-0/+7
2020-02-12Sync tests: create a base TestCase class for Sync cog testsGravatar MarkKoz-2/+6
2020-02-12Sync tests: add helper function for testing patch_userGravatar MarkKoz-8/+15
Reduces redundancy in the tests by taking care of the mocks, calling of the function, and the assertion.
2020-02-12Sync tests: test patch_userGravatar MarkKoz-0/+26
A PATCH request should be sent. The error should only be raised if it is not a 404. * Add a fixture to create ResponseCodeErrors with a specific status
2020-02-12Sync tests: test sync_guildGravatar MarkKoz-0/+24
Roles and users should be synced only if a guild is successfully retrieved.
2020-02-12Sync tests: fix Syncer mocks not having async methodsGravatar MarkKoz-2/+23
While on 3.7, the CustomMockMixin needs to be leveraged so that coroutine members are replace with AsyncMocks instead.
2020-02-12Sync tests: use mock.patch for sync_guildGravatar MarkKoz-2/+4
This prevents persistence of changes to the cog instance; sync_guild would otherwise remain as a mock object for any subsequent tests.
2020-02-12Sync tests: instantiate a Sync cog in setUpGravatar MarkKoz-5/+19
* Move patches to setUp
2020-02-12Sync tests: test Sync cog __init__Gravatar MarkKoz-0/+21
Should instantiate syncers and run a sync for the guild.