Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion stream_chat/tests/async_chat/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,7 @@ async def test_create_blocklist(self, client: StreamChatAsync):

async def test_list_blocklists(self, client: StreamChatAsync):
response = await client.list_blocklists()
assert len(response["blocklists"]) == 2
assert len(response["blocklists"]) == 3
blocklist_names = {blocklist["name"] for blocklist in response["blocklists"]}
assert "Foo" in blocklist_names

Expand Down
43 changes: 35 additions & 8 deletions stream_chat/tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,15 +128,42 @@ def test_get_app_settings(self, client: StreamChat):
assert "app" in configs

def test_update_app_settings(self, client: StreamChat):
client.update_app_settings(
async_moderation_config={
"callback": {
"mode": "CALLBACK_MODE_REST",
"server_url": "http://example.com/callback",
response = client.update_app_settings(
event_hooks=[
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this test do any assertions?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added assertions

{
"hook_type": "webhook",
"webhook_url": "https://example.com/webhook",
"event_types": ["message.new", "message.updated"],
},
"timeout_ms": 10000, # how long messages should stay pending before being deleted
}
{
"hook_type": "webhook",
"webhook_url": "https://google.com",
"event_types": [],
},
{
"hook_type": "pending_message",
"webhook_url": "http://google.com",
"timeout_ms": 500,
"callback": {
"mode": "CALLBACK_MODE_REST",
},
},
]
)
assert response.is_ok()

settings = client.get_app_settings()
assert "app" in settings
assert "event_hooks" in settings["app"]
assert len(settings["app"]["event_hooks"]) == 3

response = client.update_app_settings(event_hooks=[])
assert response.is_ok()

settings = client.get_app_settings()
assert "app" in settings
assert "event_hooks" in settings["app"]
assert len(settings["app"]["event_hooks"]) == 0

def test_update_user(self, client: StreamChat):
user = {"id": str(uuid.uuid4())}
Expand Down Expand Up @@ -703,7 +730,7 @@ def test_create_blocklist(self, client: StreamChat):

def test_list_blocklists(self, client: StreamChat):
response = client.list_blocklists()
assert len(response["blocklists"]) == 2
assert len(response["blocklists"]) == 3
blocklist_names = {blocklist["name"] for blocklist in response["blocklists"]}
assert "Foo" in blocklist_names

Expand Down