2014-03-03 18:27:04 -08:00
|
|
|
from pywb.cdx.cdxops import cdx_load
|
|
|
|
from pywb.cdx.query import CDXQuery
|
|
|
|
from pywb.cdx.cdxserver import CDXServer
|
|
|
|
from pywb.utils.wbexception import AccessException
|
2014-04-04 10:09:26 -07:00
|
|
|
from pywb.webapp.query_handler import QueryHandler
|
2014-03-03 18:27:04 -08:00
|
|
|
|
|
|
|
from pytest import raises
|
|
|
|
|
2014-03-06 18:06:05 -08:00
|
|
|
from tests.fixture import testconfig
|
2014-03-03 18:27:04 -08:00
|
|
|
|
|
|
|
|
|
|
|
#================================================================
|
|
|
|
def test_excluded(testconfig):
|
2014-03-23 12:44:28 -07:00
|
|
|
#sources = testconfig.get('index_paths')
|
|
|
|
#perms_policy = testconfig.get('perms_policy')
|
2014-03-03 18:27:04 -08:00
|
|
|
|
2014-03-23 12:44:28 -07:00
|
|
|
#cdx_server = CDXServer(sources)
|
|
|
|
#index_handler = IndexHandler(cdx_server, perms_policy=perms_policy)
|
|
|
|
query_handler = QueryHandler.init_from_config(testconfig)
|
2014-03-03 18:27:04 -08:00
|
|
|
|
|
|
|
url = 'http://www.iana.org/_img/bookmark_icon.ico'
|
|
|
|
|
|
|
|
params = dict(url=url)
|
|
|
|
|
|
|
|
with raises(AccessException):
|
2014-03-23 12:44:28 -07:00
|
|
|
cdxobjs = list(query_handler.load_cdx(None, params))
|
2016-02-23 13:26:53 -08:00
|
|
|
print(cdxobjs)
|