Skip to content

Commit

Permalink
fix: test
Browse files Browse the repository at this point in the history
  • Loading branch information
totalimmersion committed Dec 6, 2024
1 parent 8978ee2 commit 0b5a594
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions stream_chat/tests/test_channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,8 @@ def test_pin_channel(
self, client: StreamChat, channel: Channel, random_users: List[Dict]
):
user_id = random_users[0]["id"]
channel.add_members([user_id])

# Pin the channel
response = channel.pin(user_id)
assert response is not None
Expand All @@ -390,8 +392,9 @@ def test_pin_channel(
response = client.query_channels(
{"pinned": True, "cid": channel.cid}, user_id=user_id
)
print(response)
assert len(response["channels"]) == 1
assert response["channels"][0]["cid"] == channel.cid
assert response["channels"][0]["channel"]["cid"] == channel.cid

# Unpin the channel
response = channel.unpin(user_id)
Expand All @@ -402,4 +405,4 @@ def test_pin_channel(
{"pinned": False, "cid": channel.cid}, user_id=user_id
)
assert len(response["channels"]) == 1
assert response["channels"][0]["cid"] == channel.cid
assert response["channels"][0]["channel"]["cid"] == channel.cid

0 comments on commit 0b5a594

Please sign in to comment.