Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add WACZ support #770

Draft
wants to merge 14 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
Add test for wacz
machawk1 committed May 24, 2022
commit 25e91ad07c14c1c1e42677ef0a55656ab32d16fe
7 changes: 5 additions & 2 deletions tests/testUtil.py
Original file line number Diff line number Diff line change
@@ -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)
1 change: 1 addition & 0 deletions tests/test_replay.py
Original file line number Diff line number Diff line change
@@ -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)