2014-02-28 01:39:04 +00:00
|
|
|
import os
|
|
|
|
import pytest
|
|
|
|
|
|
|
|
import yaml
|
|
|
|
|
|
|
|
@pytest.fixture
|
|
|
|
def testconfig():
|
2014-03-14 10:46:20 -07:00
|
|
|
config = yaml.load(open('tests/test_config.yaml'))
|
2014-02-28 01:39:04 +00:00
|
|
|
assert config
|
|
|
|
if 'index_paths' not in config:
|
|
|
|
# !!! assumes this module is in a sub-directory of project root.
|
|
|
|
config['index_paths'] = os.path.join(
|
|
|
|
os.path.dirname(os.path.realpath(__file__)),
|
|
|
|
'../sample_archive/cdx')
|
|
|
|
return config
|
|
|
|
|
|
|
|
#================================================================
|
|
|
|
# Reporter callback for replay view
|
|
|
|
class PrintReporter:
|
|
|
|
"""Reporter callback for replay view.
|
|
|
|
"""
|
|
|
|
def __call__(self, wbrequest, cdx, response):
|
2016-02-23 13:26:53 -08:00
|
|
|
print(wbrequest)
|
|
|
|
print(cdx)
|
2014-02-28 01:39:04 +00:00
|
|
|
pass
|