aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorGravatar ks129 <[email protected]>2020-05-23 18:22:02 +0300
committerGravatar ks129 <[email protected]>2020-06-11 08:59:42 +0300
commit6476d3ba6dfc28441d097aaa15a7c9e13f53f646 (patch)
treeb8a787e8f3657b0c2db6aa8c417293441adbda86 /tests
parentJam Tests: Created test for channel overwrites (diff)
Jam Tests: Make text channel creation test more specific
Diffstat (limited to 'tests')
-rw-r--r--tests/bot/cogs/test_jams.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/bot/cogs/test_jams.py b/tests/bot/cogs/test_jams.py
index d21c5ea29..94c48b995 100644
--- a/tests/bot/cogs/test_jams.py
+++ b/tests/bot/cogs/test_jams.py
@@ -59,11 +59,18 @@ class JamCreateTeamTests(unittest.IsolatedAsyncioTestCase):
utils_mock.get.assert_called_once()
self.ctx.guild.create_category_channel.assert_not_awaited()
- async def test_team_text_channel_creation(self):
+ @patch("bot.cogs.jams.utils")
+ async def test_team_text_channel_creation(self, utils_mock):
"""Should create text channel for team."""
+ utils_mock.get.return_value = "foo"
await self.cog.createteam(self.cog, self.ctx, "bar", (MockMember() for _ in range(5)))
+ # Make sure that we awaited function before getting call arguments
self.ctx.guild.create_text_channel.assert_awaited_once()
+ # All other arguments is possible to get somewhere else except this
+ overwrites = self.ctx.guild.create_text_channel.call_args[1]["overwrites"]
+ self.ctx.guild.create_text_channel.assert_awaited_once_with("bar", overwrites=overwrites, category="foo")
+
async def test_channel_overwrites(self):
"""Should have correct permission overwrites for users and roles."""
leader = MockMember()