From 2f9fea27403cd7da9c4210bc1e72aa9753b7f02e Mon Sep 17 00:00:00 2001 From: Luna Date: Mon, 13 Sep 2021 22:20:12 -0300 Subject: [PATCH] test_channels: validate new channels can be fetched on api --- tests/test_channels.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/test_channels.py b/tests/test_channels.py index 808a250..625b752 100644 --- a/tests/test_channels.py +++ b/tests/test_channels.py @@ -35,10 +35,17 @@ async def test_channel_create(test_cli_user): ) assert resp.status_code == 200 rjson = await resp.json + channel_id: str = rjson["id"] assert rjson["name"] == "hello-world" refetched_guild = await guild.refetch() assert len(refetched_guild.channels) == 2 + assert channel_id in (channel["id"] for channel in refetched_guild.channels) + + resp = await test_cli_user.get(f"/api/v6/channels/{channel_id}") + assert resp.status_code == 200 + rjson = await resp.json + assert rjson["id"] == channel_id async def test_channel_message_send(test_cli_user):