From 786205921cc83411aea12deee66b5a881762bf6a Mon Sep 17 00:00:00 2001 From: Tessa Walsh Date: Wed, 24 Apr 2024 01:32:30 +0200 Subject: [PATCH] Strip empty lines from index_content for test --- pywb/manager/manager.py | 2 -- tests/test_manager.py | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/pywb/manager/manager.py b/pywb/manager/manager.py index a770b725..06de6e57 100644 --- a/pywb/manager/manager.py +++ b/pywb/manager/manager.py @@ -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']] diff --git a/tests/test_manager.py b/tests/test_manager.py index 88ea517e..f8245ab0 100644 --- a/tests/test_manager.py +++ b/tests/test_manager.py @@ -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