| 123456789101112131415161718192021222324252627282930313233343536373839404142 |
- """QiWe 模块 — 真实联调(proxy / sync / 在线状态)"""
- import pytest
- pytestmark = [pytest.mark.integration, pytest.mark.qiwei_live]
- def test_live_check_login(api, live_guid):
- data = api.assert_success(api.get(f"/qiwei/staff/{live_guid}/status"))
- assert data.get("guid") == live_guid or data.get("userId")
- assert data["userOnlineStatus"] in (1, 2)
- assert data.get("nickname") or data.get("userId")
- def test_live_proxy_get_room_list(api, live_guid):
- data = api.assert_success(
- api.post(
- "/qiwei/proxy",
- json={
- "method": "/room/getRoomList",
- "params": {"guid": live_guid, "nextStartIndex": 0},
- },
- )
- )
- assert isinstance(data, dict)
- assert "roomList" in data or "roomCount" in data
- def test_live_sync_messages(api, live_guid):
- data = api.assert_success(
- api.post("/qiwei/sync", json={"guid": live_guid, "msgSeq": 0, "limit": 20})
- )
- assert "messages" in data
- assert "hasMore" in data
- def test_live_batch_status(api, live_guid):
- data = api.assert_success(
- api.post("/qiwei/staff/batch-status", json={"guids": [live_guid]})
- )
- assert len(data) == 1
- assert data[0].get("guid") == live_guid or data[0].get("userId")
|