aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorGravatar MarkKoz <[email protected]>2020-01-03 11:45:47 -0800
committerGravatar MarkKoz <[email protected]>2020-02-12 10:07:50 -0800
commit01d7b53180864b1e47ebc8c831a706dc1a3c0d79 (patch)
tree38779893d38c3408871c329cb3d2d72c28c34b42 /tests
parentSync tests: test diff for all 3 changes simultaneously (diff)
Sync tests: test diff is empty when DB has a user not in the guild
Diffstat (limited to 'tests')
-rw-r--r--tests/bot/cogs/sync/test_users.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/tests/bot/cogs/sync/test_users.py b/tests/bot/cogs/sync/test_users.py
index ff863a929..dfb9ac405 100644
--- a/tests/bot/cogs/sync/test_users.py
+++ b/tests/bot/cogs/sync/test_users.py
@@ -111,12 +111,12 @@ class UserSyncerDiffTests(unittest.TestCase):
self.assertEqual(actual_diff, expected_diff)
- def test_get_users_for_sync_does_not_duplicate_update_users(self):
- """When the API knows a user the guild doesn't, nothing is performed."""
- api_users = {43: fake_user(in_guild=False)}
- guild_users = {}
-
- self.assertEqual(
- get_users_for_sync(guild_users, api_users),
- (set(), set())
- )
+ def test_empty_diff_for_db_users_not_in_guild(self):
+ """When the DB knows a user the guild doesn't, no difference is found."""
+ self.bot.api_client.get.return_value = [fake_user(), fake_user(id=63, in_guild=False)]
+ guild = self.get_guild(fake_user())
+
+ actual_diff = asyncio.run(self.syncer._get_diff(guild))
+ expected_diff = (set(), set(), None)
+
+ self.assertEqual(actual_diff, expected_diff)