feat(db): add video pages and up follower snapshot schema
This commit is contained in:
1 parent
707ed7d7d7
commit
4942d1d161
10 files changed
+521
-13
No files matched your search
@@ -216,6 +216,25 @@ def test_infos_invalid_attr_and_empty():
|
||||
assert len(transport.calls) == 1
|
||||
|
||||
|
||||
def test_infos_parses_page_count():
|
||||
payload = {"code": 0, "message": "0", "ttl": 1, "data": [VALID_INFO, INVALID_INFO]}
|
||||
client, _ = make_client(QueueTransport([http_json(payload)]))
|
||||
result = client.fav_infos(
|
||||
3700023351, [VALID_INFO["id"], INVALID_INFO["id"]]
|
||||
)
|
||||
assert result.items[VALID_INFO["id"]].pages == 2
|
||||
assert result.items[INVALID_INFO["id"]].pages == 1
|
||||
|
||||
# page 字段缺失或非法时保持 None,不把 0 当分 P 数
|
||||
broken = json.loads(json.dumps(VALID_INFO))
|
||||
broken["id"] = 999
|
||||
broken["page"] = 0
|
||||
client, _ = make_client(QueueTransport([http_json({
|
||||
"code": 0, "message": "0", "ttl": 1, "data": [broken],
|
||||
})]))
|
||||
assert client.fav_infos(3700023351, [999]).items[999].pages is None
|
||||
|
||||
|
||||
def test_infos_unexpected_aid_is_protocol_error():
|
||||
transport = QueueTransport([http_json({
|
||||
"code": 0, "message": "0", "ttl": 1, "data": [VALID_INFO],
|
||||
|
||||
Reference in new issue
Block a user