Skip to content

Commit 9b8b4d8

Browse files
committed
tests/typo fix: add tests for truncated record detection (see: ikreymer/webarchiveplayer#14) fix typo, closes #161
1 parent b12a24e commit 9b8b4d8

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

pywb/warc/archiveiterator.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import base64
1010

1111
import re
12+
import sys
1213

1314
try: # pragma: no cover
1415
from collections import OrderedDict

pywb/warc/test/test_indexing.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,13 @@
2525
org,iana)/domains/example 20140128051539 http://www.iana.org/domains/example text/html 302 JZ622UA23G5ZU6Y3XAKH4LINONUEICEG - - 854 4771 example.warc
2626
2727
# warc all
28+
# note: length of request record set to 1 byte less then record to test truncation handling
2829
>>> print_cdx_index('example.warc', include_all=True)
2930
CDX N b a m s k r M S V g
3031
com,example)/?example=1 20140103030321 http://example.com?example=1 text/html 200 B2LTWWPUOYAH7UIPQ7ZUPQ4VMBSVC36A - - 1987 460 example.warc
3132
com,example)/?example=1 20140103030321 http://example.com?example=1 - - - - - 706 2451 example.warc
3233
com,example)/?example=1 20140103030341 http://example.com?example=1 warc/revisit - B2LTWWPUOYAH7UIPQ7ZUPQ4VMBSVC36A - - 896 3161 example.warc
33-
com,example)/?example=1 20140103030341 http://example.com?example=1 - - - - - 706 4061 example.warc
34+
com,example)/?example=1 20140103030341 http://example.com?example=1 - - - - - 703 4061 example.warc
3435
org,iana)/domains/example 20140128051539 http://www.iana.org/domains/example text/html 302 JZ622UA23G5ZU6Y3XAKH4LINONUEICEG - - 854 4771 example.warc
3536
3637
# arc.gz

sample_archive/warcs/example.warc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ WARC/1.0
140140
WARC-Type: request
141141
WARC-Record-ID: <urn:uuid:c59f3330-b241-4fca-8513-d687cd85bcfb>
142142
WARC-Date: 2014-01-03T03:03:41Z
143-
Content-Length: 323
143+
Content-Length: 320
144144
Content-Type: application/http; msgtype=request
145145
WARC-Concurrent-To: <urn:uuid:3619f5b0-d967-44be-8f24-762098d427c4>
146146
WARC-Target-URI: http://example.com?example=1

0 commit comments

Comments
 (0)