mirror of
https://github.com/internetarchive/warcprox.git
synced 2025-01-18 13:22:09 +01:00
Change the writer unit test
To be able to run in github.
This commit is contained in:
parent
e737a30ec1
commit
b2c47142de
@ -24,6 +24,7 @@ import fcntl
|
|||||||
from multiprocessing import Process, Queue
|
from multiprocessing import Process, Queue
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
import pytest
|
import pytest
|
||||||
|
import re
|
||||||
from warcprox.mitmproxy import ProxyingRecorder
|
from warcprox.mitmproxy import ProxyingRecorder
|
||||||
from warcprox.warcproxy import RecordedUrl
|
from warcprox.warcproxy import RecordedUrl
|
||||||
from warcprox.writer import WarcWriter
|
from warcprox.writer import WarcWriter
|
||||||
@ -180,10 +181,4 @@ def test_warc_writer_filename(tmpdir):
|
|||||||
wwriter.write_records(recorded_url)
|
wwriter.write_records(recorded_url)
|
||||||
warcs = [fn for fn in os.listdir(dirname)]
|
warcs = [fn for fn in os.listdir(dirname)]
|
||||||
assert warcs
|
assert warcs
|
||||||
target_warc = os.path.join(dirname, warcs[0])
|
assert re.match('\d{17}_foo_\d{14}_00000.warc.open', 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'
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user