Mercurial > hg > cc > cirrus_work
changeset 63:9837840f3328
more tests
author | Henry S. Thompson <ht@inf.ed.ac.uk> |
---|---|
date | Fri, 14 Jul 2023 17:39:14 +0100 |
parents | 11cbaee8bbc8 |
children | b14187ccfb46 |
files | bin/test_warc.py |
diffstat | 1 files changed, 10 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/bin/test_warc.py Fri Jul 14 17:38:54 2023 +0100 +++ b/bin/test_warc.py Fri Jul 14 17:39:14 2023 +0100 @@ -5,6 +5,8 @@ if (debug:=(sys.argv[1]=='-d')): sys.argv.pop(1) +tt=int(sys.argv.pop(1)) + def showme(wtype,buf,part): # This should exactly reproduce a complete warc file if called # as per version 1 below @@ -19,8 +21,11 @@ OUT.write(b"----end %d-----\n"%part) return OUT -# 1 -warc.warc(sys.argv[1],showme,[b'response','warcinfo','request','metadata'],parts=int(sys.argv[2]),debug=debug) - -# 2 -#warc.warc(sys.argv[1],showme,[b'warcinfo'],parts=int(sys.argv[2]),debug=debug) +if tt==1: + warc.warc(sys.argv[1],showme,[b'response','warcinfo','request','metadata'],parts=int(sys.argv[2]),debug=debug) +elif tt==2: + warc.warc(sys.argv[1],showme,[b'warcinfo'],parts=int(sys.argv[2]),debug=debug) +elif tt==3: + warc.warc(sys.argv[1],showme,[b'warcinfo'],whole=True,debug=debug) +elif tt==4: + warc.warc(sys.argv[1],showme,[b'response','warcinfo','request','metadata'],whole=True,debug=debug)