@@ -150,7 +150,7 @@ def test_record_warc_1(self):
150150
151151 resp = self ._test_warc_write (recorder_app , 'httpbin.org' , '/get?foo=bar' )
152152 assert b'HTTP/1.1 200 OK' in resp .body
153- assert b'"foo": "bar"' in resp .body
153+ assert b'"foo":"bar"' in resp .body . replace ( b' ' , b'' )
154154
155155 self ._test_all_warcs ('/warcs/' , 1 )
156156
@@ -160,7 +160,7 @@ def test_record_warc_2(self):
160160
161161 resp = self ._test_warc_write (recorder_app , 'httpbin.org' , '/get?foo=bar' )
162162 assert b'HTTP/1.1 200 OK' in resp .body
163- assert b'"foo": "bar"' in resp .body
163+ assert b'"foo":"bar"' in resp .body . replace ( b' ' , b'' )
164164
165165 self ._test_all_warcs ('/warcs/' , 2 )
166166
@@ -262,7 +262,7 @@ def test_record_skip_wrong_coll(self):
262262
263263 resp = self ._test_warc_write (recorder_app , 'httpbin.org' , '/get?foo=bar' )
264264 assert b'HTTP/1.1 200 OK' in resp .body
265- assert b'"foo": "bar"' in resp .body
265+ assert b'"foo":"bar"' in resp .body . replace ( b' ' , b'' )
266266
267267 self ._test_all_warcs ('/warcs/' , 2 )
268268
@@ -279,7 +279,7 @@ def test_record_param_user_coll(self):
279279 resp = self ._test_warc_write (recorder_app , 'httpbin.org' , '/user-agent' ,
280280 '¶m.recorder.user=USER¶m.recorder.coll=COLL' )
281281
282- assert '"user-agent": "{0}"' .format (UA ) in resp .text
282+ assert '"user-agent":"{0}"' .format (UA . replace ( ' ' , '' )) in resp .text . replace ( ' ' , '' )
283283 #assert b'HTTP/1.1 200 OK' in resp.body
284284 #assert b'"foo": "bar"' in resp.body
285285
@@ -312,12 +312,12 @@ def test_record_param_user_coll_same_dir(self):
312312 resp = self ._test_warc_write (recorder_app , 'httpbin.org' ,
313313 '/get?foo=bar' , '¶m.recorder.user=USER2¶m.recorder.coll=COLL2' )
314314 assert b'HTTP/1.1 200 OK' in resp .body
315- assert b'"foo": "bar"' in resp .body
315+ assert b'"foo":"bar"' in resp .body . replace ( b' ' , b'' )
316316
317317 resp = self ._test_warc_write (recorder_app , 'httpbin.org' ,
318318 '/get?foo=bar' , '¶m.recorder.user=USER2¶m.recorder.coll=COLL3' )
319319 assert b'HTTP/1.1 200 OK' in resp .body
320- assert b'"foo": "bar"' in resp .body
320+ assert b'"foo":"bar"' in resp .body . replace ( b' ' , b'' )
321321
322322 self ._test_all_warcs ('/warcs2' , 2 )
323323
@@ -334,7 +334,7 @@ def test_record_param_user_coll_revisit(self):
334334 resp = self ._test_warc_write (recorder_app , 'httpbin.org' , '/user-agent' ,
335335 '¶m.recorder.user=USER¶m.recorder.coll=COLL' )
336336
337- assert '"user-agent": "{0}"' .format (UA ) in resp .text
337+ assert '"user-agent":"{0}"' .format (UA . replace ( ' ' , '' )) in resp .text . replace ( ' ' , '' )
338338 #assert b'HTTP/1.1 200 OK' in resp.body
339339 #assert b'"foo": "bar"' in resp.body
340340
@@ -387,7 +387,7 @@ def test_record_param_user_coll_skip(self):
387387 resp = self ._test_warc_write (recorder_app , 'httpbin.org' , '/user-agent' ,
388388 '¶m.recorder.user=USER¶m.recorder.coll=COLL' )
389389
390- assert '"user-agent": "{0}"' .format (UA ) in resp .text
390+ assert '"user-agent":"{0}"' .format (UA . replace ( ' ' , '' )) in resp .text . replace ( ' ' , '' )
391391 #assert b'HTTP/1.1 200 OK' in resp.body
392392 #assert b'"foo": "bar"' in resp.body
393393 self ._test_all_warcs ('/warcs/USER/COLL/' , 2 )
@@ -409,7 +409,7 @@ def test_record_param_user_coll_write_dupe_no_revisit(self):
409409 resp = self ._test_warc_write (recorder_app , 'httpbin.org' ,
410410 '/get?foo=bar' , '¶m.recorder.user=USER¶m.recorder.coll=COLL' )
411411 assert b'HTTP/1.1 200 OK' in resp .body
412- assert b'"foo": "bar"' in resp .body
412+ assert b'"foo":"bar"' in resp .body . replace ( b' ' , b'' )
413413
414414 self ._test_all_warcs ('/warcs/USER/COLL/' , 3 )
415415
@@ -432,7 +432,7 @@ def test_record_file_warc_keep_open(self):
432432
433433 resp = self ._test_warc_write (recorder_app , 'httpbin.org' , '/get?foo=bar' )
434434 assert b'HTTP/1.1 200 OK' in resp .body
435- assert b'"foo": "bar"' in resp .body
435+ assert b'"foo":"bar"' in resp .body . replace ( b' ' , b'' )
436436
437437 assert os .path .isfile (path )
438438 assert len (writer .fh_cache ) == 1
@@ -455,15 +455,15 @@ def test_record_multiple_writes_keep_open(self):
455455 '/get?foo=bar' , '¶m.recorder.coll=FOO' )
456456
457457 assert b'HTTP/1.1 200 OK' in resp .body
458- assert b'"foo": "bar"' in resp .body
458+ assert b'"foo":"bar"' in resp .body . replace ( b' ' , b'' )
459459
460460
461461 # Second Record
462462 resp = self ._test_warc_write (recorder_app , 'httpbin.org' ,
463463 '/get?boo=far' , '¶m.recorder.coll=FOO' )
464464
465465 assert b'HTTP/1.1 200 OK' in resp .body
466- assert b'"boo": "far"' in resp .body
466+ assert b'"boo":"far"' in resp .body . replace ( b' ' , b'' )
467467
468468 self ._test_all_warcs ('/warcs/FOO/' , 1 )
469469
@@ -523,14 +523,14 @@ def test_record_multiple_writes_rollover_idle(self):
523523 '/get?foo=bar' , '¶m.recorder.coll=GOO' )
524524
525525 assert b'HTTP/1.1 200 OK' in resp .body
526- assert b'"foo": "bar"' in resp .body
526+ assert b'"foo":"bar"' in resp .body . replace ( b' ' , b'' )
527527
528528 # Second Record
529529 resp = self ._test_warc_write (recorder_app , 'httpbin.org' ,
530530 '/get?boo=far' , '¶m.recorder.coll=GOO' )
531531
532532 assert b'HTTP/1.1 200 OK' in resp .body
533- assert b'"boo": "far"' in resp .body
533+ assert b'"boo":"far"' in resp .body . replace ( b' ' , b'' )
534534
535535 self ._test_all_warcs ('/warcs/GOO/' , 1 )
536536
@@ -542,7 +542,7 @@ def test_record_multiple_writes_rollover_idle(self):
542542 '/get?goo=bar' , '¶m.recorder.coll=GOO' )
543543
544544 assert b'HTTP/1.1 200 OK' in resp .body
545- assert b'"goo": "bar"' in resp .body
545+ assert b'"goo":"bar"' in resp .body . replace ( b' ' , b'' )
546546
547547 self ._test_all_warcs ('/warcs/GOO/' , 2 )
548548
0 commit comments