From b2c47142de435a83553bbb0c77c9ba2d9419978e Mon Sep 17 00:00:00 2001 From: Vangelis Banos Date: Wed, 10 Jan 2018 20:38:06 +0000 Subject: [PATCH] Change the writer unit test To be able to run in github. --- tests/test_writer.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/tests/test_writer.py b/tests/test_writer.py index f9fb339..5bce6b7 100644 --- a/tests/test_writer.py +++ b/tests/test_writer.py @@ -24,6 +24,7 @@ import fcntl from multiprocessing import Process, Queue from datetime import datetime import pytest +import re from warcprox.mitmproxy import ProxyingRecorder from warcprox.warcproxy import RecordedUrl from warcprox.writer import WarcWriter @@ -180,10 +181,4 @@ def test_warc_writer_filename(tmpdir): wwriter.write_records(recorded_url) warcs = [fn for fn in os.listdir(dirname)] assert warcs - target_warc = os.path.join(dirname, warcs[0]) - assert target_warc - parts = os.path.basename(warcs[0]).split('_') - assert len(parts[0]) == 17 - assert parts[1] == 'foo' - assert len(parts[2]) == 14 - assert parts[3] == '00000.warc.open' + assert re.match('\d{17}_foo_\d{14}_00000.warc.open', warcs[0])