swh_local_vault_config = {'vault': {'args': {'cache': {'args': {'allow_delete': True, 'root': '/tmp/pytest-of-jenkins/pytest-0/test_make_app_fr...-of-jenkins/pytest-0/test_make_app_from_config_file0', 'slicing': '0:1/1:5'}, 'cls': 'pathslicing'}}}, 'cls': 'local'}}
tmp_path = PosixPath('/tmp/pytest-of-jenkins/pytest-0/test_make_app_from_config_file0')
def test_make_app_from_config_file(swh_local_vault_config, tmp_path):
"""Instantiation of the server should happen once (through config filepath)
"""
conf_path = str(tmp_path / "vault.yml")
with open(conf_path, "w") as f:
f.write(yaml.dump(swh_local_vault_config))
> app0 = make_app_from_configfile(conf_path)
.tox/py3/lib/python3.7/site-packages/swh/vault/tests/test_server.py:40:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/py3/lib/python3.7/site-packages/swh/vault/api/server.py:123: in make_app_from_configfile
app = make_app(api_cfg)
.tox/py3/lib/python3.7/site-packages/swh/vault/api/server.py:101: in make_app
backend_factory=lambda: get_vault(config_ok),
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Application 0x7f6cf6923630>
middlewares = (<function negotiation_middleware.<locals>.factory at 0x7f6cf6062598>, <function error_middleware at 0x7f6cf6bccae8>)
args = ('swh.vault.api.server',)
kwargs = {'backend_class': <class 'swh.vault.interface.VaultInterface'>, 'backend_factory': <function make_app.<locals>.<lambda> at 0x7f6cf6062510>}
renderers = OrderedDict([('application/json', <function render_json at 0x7f6cf6bcc9d8>), ('application/x-msgpack', <function render_msgpack at 0x7f6cf6c44f28>)])
nego_middleware = <function negotiation_middleware.<locals>.factory at 0x7f6cf6062598>
def __init__(self, *args, middlewares=(), **kwargs):
middlewares = (error_middleware,) + middlewares
# renderers are sorted in order of increasing desirability (!)
# see mimeparse.best_match() docstring.
renderers = OrderedDict(
[
("application/json", render_json),
("application/x-msgpack", render_msgpack),
]
)
nego_middleware = negotiation.negotiation_middleware(
renderers=renderers, force_rendering=True
)
middlewares = (nego_middleware,) + middlewares
> super().__init__(*args, middlewares=middlewares, **kwargs)
E TypeError: __init__() got an unexpected keyword argument 'backend_class'
.tox/py3/lib/python3.7/site-packages/swh/core/api/asynchronous.py:95: TypeError
TEST RESULT
TEST RESULT
- Run At
- Oct 22 2020, 12:17 PM