Skip to content

Commit

Permalink
Add test for wacz
Browse files Browse the repository at this point in the history
  • Loading branch information
machawk1 committed May 24, 2022
1 parent a422b47 commit 25e91ad
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/testUtil.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions tests/test_replay.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 25e91ad

Please sign in to comment.