mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-07-10 22:32:16 +02:00
chore: bumped version to 0.0.31
This commit is contained in:
parent
8df8565e0a
commit
1c9ab207ef
56 changed files with 520 additions and 190 deletions
|
|
@ -274,8 +274,13 @@ def test_parse_serp_extracts_all_blocks():
|
|||
assert prod.prices == ["$24.99", "$30"]
|
||||
|
||||
# Related searches exclude the numeric pagination anchor (a.fl).
|
||||
assert [r.title for r in item.relatedQueries] == ["easy apple pie", "apple pie recipe"]
|
||||
assert item.relatedQueries[0].url == "https://www.google.com/search?q=easy+apple+pie"
|
||||
assert [r.title for r in item.relatedQueries] == [
|
||||
"easy apple pie",
|
||||
"apple pie recipe",
|
||||
]
|
||||
assert (
|
||||
item.relatedQueries[0].url == "https://www.google.com/search?q=easy+apple+pie"
|
||||
)
|
||||
|
||||
# suggestedResults are the related queries re-shaped with type/position.
|
||||
assert [(s.position, s.title, s.type) for s in item.suggestedResults] == [
|
||||
|
|
|
|||
|
|
@ -95,8 +95,15 @@ def test_flatten_comments_counts_replies_and_stops_at_more():
|
|||
"kind": "Listing",
|
||||
"data": {
|
||||
"children": [
|
||||
{"kind": "t1", "data": {"name": "t1_2", "id": "2",
|
||||
"body": "reply", "replies": ""}},
|
||||
{
|
||||
"kind": "t1",
|
||||
"data": {
|
||||
"name": "t1_2",
|
||||
"id": "2",
|
||||
"body": "reply",
|
||||
"replies": "",
|
||||
},
|
||||
},
|
||||
{"kind": "more", "data": {}}, # stub -> ignored
|
||||
]
|
||||
},
|
||||
|
|
@ -112,8 +119,10 @@ def test_flatten_comments_counts_replies_and_stops_at_more():
|
|||
|
||||
def test_flatten_comments_honors_max():
|
||||
tree = [
|
||||
{"kind": "t1", "data": {"name": f"t1_{i}", "id": str(i), "body": "x",
|
||||
"replies": ""}}
|
||||
{
|
||||
"kind": "t1",
|
||||
"data": {"name": f"t1_{i}", "id": str(i), "body": "x", "replies": ""},
|
||||
}
|
||||
for i in range(5)
|
||||
]
|
||||
assert len(flatten_comments(tree, max_comments=2)) == 2
|
||||
|
|
@ -128,9 +137,17 @@ def test_children_and_after():
|
|||
|
||||
|
||||
def test_parse_community_maps_members():
|
||||
thing = {"kind": "t5", "data": {"name": "t5_s", "id": "s",
|
||||
"display_name": "py", "display_name_prefixed": "r/py",
|
||||
"subscribers": 1234, "url": "/r/py/"}}
|
||||
thing = {
|
||||
"kind": "t5",
|
||||
"data": {
|
||||
"name": "t5_s",
|
||||
"id": "s",
|
||||
"display_name": "py",
|
||||
"display_name_prefixed": "r/py",
|
||||
"subscribers": 1234,
|
||||
"url": "/r/py/",
|
||||
},
|
||||
}
|
||||
item = parse_community(thing)
|
||||
assert item["dataType"] == "community"
|
||||
assert item["numberOfMembers"] == 1234
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue