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
|
|
@ -101,7 +101,11 @@ async def test_aggregated_contacts_carry_provenance_and_site_wide_flag() -> None
|
|||
class _ContactsEngine:
|
||||
async def crawl_url(self, url: str) -> CrawlOutcome:
|
||||
socials = [footer] + ([person] if url.endswith("/about") else [])
|
||||
links = ["https://e.com/about", "https://e.com/blog"] if url == "https://e.com/" else []
|
||||
links = (
|
||||
["https://e.com/about", "https://e.com/blog"]
|
||||
if url == "https://e.com/"
|
||||
else []
|
||||
)
|
||||
return CrawlOutcome(
|
||||
status=_SUCCESS,
|
||||
result={
|
||||
|
|
|
|||
|
|
@ -43,18 +43,20 @@ def test_estimated_units_for_single_url_is_seed_count() -> None:
|
|||
|
||||
|
||||
def test_estimated_units_for_spider_is_max_pages() -> None:
|
||||
model = CrawlInput(
|
||||
startUrls=["https://a.com"], maxCrawlDepth=2, maxCrawlPages=25
|
||||
)
|
||||
model = CrawlInput(startUrls=["https://a.com"], maxCrawlDepth=2, maxCrawlPages=25)
|
||||
assert model.estimated_units == 25
|
||||
|
||||
|
||||
def test_billable_units_counts_only_successes() -> None:
|
||||
out = CrawlOutput(
|
||||
items=[
|
||||
CrawlItem(url="a", status="success", crawl=CrawlMeta(loadedUrl="a", depth=0)),
|
||||
CrawlItem(
|
||||
url="a", status="success", crawl=CrawlMeta(loadedUrl="a", depth=0)
|
||||
),
|
||||
CrawlItem(url="b", status="empty", crawl=CrawlMeta(loadedUrl="b", depth=1)),
|
||||
CrawlItem(url="c", status="failed", crawl=CrawlMeta(loadedUrl="c", depth=1)),
|
||||
CrawlItem(
|
||||
url="c", status="failed", crawl=CrawlMeta(loadedUrl="c", depth=1)
|
||||
),
|
||||
]
|
||||
)
|
||||
assert out.billable_units == 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue