From 25e91ad07c14c1c1e42677ef0a55656ab32d16fe Mon Sep 17 00:00:00 2001 From: Mat Kelly Date: Tue, 24 May 2022 15:54:56 -0400 Subject: [PATCH] Add test for wacz --- tests/testUtil.py | 7 +++++-- tests/test_replay.py | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/testUtil.py b/tests/testUtil.py index d2927227..a9d14468 100644 --- a/tests/testUtil.py +++ b/tests/testUtil.py @@ -57,11 +57,14 @@ def count_cdxj_entries(cdxj_data): return urim_count -def start_replay(warc_filename): +def start_replay(filename, samples_dir='warc'): global p + if filename.endswith('.wacz'): + samples_dir = 'wacz' + path_of_warc = os.path.join( Path(os.path.dirname(__file__)).parent, - 'samples', 'warcs', warc_filename) + 'samples', samples_dir, filename) fh, tempfile_path = tempfile.mkstemp(suffix='.cdxj') os.close(fh) diff --git a/tests/test_replay.py b/tests/test_replay.py index bb894bd4..7caf34c0 100644 --- a/tests/test_replay.py +++ b/tests/test_replay.py @@ -49,6 +49,7 @@ def test_replay_404(warc, lookup, has_md_header): ('2mementos_queryString.warc', '/memento/20130202100000/memento.us/' + 'index.php?anotherval=ipsum&someval=lorem', 200, None), + ('my-collection.wacz', 'memento/*/memento.us', 200, None), ]) def test_replay_search(warc, lookup, status, location): ipwb_test.start_replay(warc)