From 4b7e504d99dfab5468765f600a46fa36c8887e8c Mon Sep 17 00:00:00 2001 From: renaud gaudin Date: Tue, 31 Jan 2023 11:12:36 +0000 Subject: [PATCH] Updated test and stats to new crawl.json format --- test/integration.py | 5 +++-- zimit.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/test/integration.py b/test/integration.py index 6b550f6..54f4d99 100644 --- a/test/integration.py +++ b/test/integration.py @@ -47,8 +47,9 @@ def test_user_agent(): def test_stats_output(): with open("/output/crawl.json") as fh: assert json.loads(fh.read()) == { - "numCrawled": 5, - "workersRunning": 0, + "crawled": 5, + "pending": 0, + "pendingPages": [], "total": 5, "limit": {"max": 0, "hit": False}, } diff --git a/zimit.py b/zimit.py index af3ca53..f74b307 100755 --- a/zimit.py +++ b/zimit.py @@ -79,7 +79,7 @@ class ProgressFileWatcher: limit.max = data["limit"]["max"] limit.hit = data["limit"]["hit"] return { - "done": data["numCrawled"], + "done": data["crawled"], "total": int(data["total"] / 0.9), "limit": limit.as_dict, }