Skip to content

Commit

Permalink
Strip empty lines from index_content for test
Browse files Browse the repository at this point in the history
  • Loading branch information
tw4l committed Apr 23, 2024
1 parent e71159c commit 7862059
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 0 additions & 2 deletions pywb/manager/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,6 @@ def _add_wacz_index(self, collection_index_path, wacz_index_path, filename_mappi
wacz_index = open(wacz_index_path, 'rb')

for line in wacz_index:
if not line:
continue
cdx_object = CDXObject(cdxline=line)
if cdx_object['filename'] in filename_mapping:
cdx_object['filename'] = filename_mapping[cdx_object['filename']]
Expand Down
1 change: 1 addition & 0 deletions tests/test_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ def test_merge_wacz_index_gzip(self, tmp_path):
{'example-collection.warc': 'rewritten.warc'})
with open(os.path.join(manager.indexes_dir, manager.DEF_INDEX_FILE), 'r') as f:
index_content = f.read()
index_content = index_content.strip()

assert 'example-collection.warc' not in index_content
assert 'rewritten.warc' in index_content
Expand Down

0 comments on commit 7862059

Please sign in to comment.