mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
Attempt to fix the tests :s
This commit is contained in:
parent
677f4518e4
commit
a2a6e6fe7c
2 changed files with 9 additions and 24 deletions
|
@ -125,13 +125,8 @@ def moulinette_webapi(moulinette):
|
|||
|
||||
CookiePolicy.return_ok_secure = return_true
|
||||
|
||||
moulinette_webapi = moulinette.init_interface(
|
||||
"api",
|
||||
kwargs={"routes": {}, "use_websocket": False},
|
||||
actionsmap={"namespaces": ["moulitest"], "use_cache": True},
|
||||
)
|
||||
|
||||
return TestApp(moulinette_webapi._app)
|
||||
from moulinette.interfaces.api import Interface as Api
|
||||
return TestApp(Api(routes={})._app)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
|
@ -148,17 +143,11 @@ def moulinette_cli(moulinette, mocker):
|
|||
help="Log and print debug messages",
|
||||
)
|
||||
mocker.patch("os.isatty", return_value=True)
|
||||
moulinette_cli = moulinette.init_interface(
|
||||
"cli",
|
||||
actionsmap={
|
||||
"namespaces": ["moulitest"],
|
||||
"use_cache": False,
|
||||
"parser_kwargs": {"top_parser": parser},
|
||||
},
|
||||
)
|
||||
from moulinette.interfaces.cli import Interface as Cli
|
||||
cli = Cli(top_parser=parser)
|
||||
mocker.stopall()
|
||||
|
||||
return moulinette_cli
|
||||
return cli
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
|
|
|
@ -225,7 +225,7 @@ def test_extra_argument_parser_parse_args(iface, mocker):
|
|||
def test_actions_map_api():
|
||||
from moulinette.interfaces.api import ActionsMapParser
|
||||
|
||||
amap = ActionsMap(ActionsMapParser, use_cache=False)
|
||||
amap = ActionsMap(ActionsMapParser())
|
||||
|
||||
assert amap.parser.global_conf["authenticate"] == "all"
|
||||
assert "default" in amap.parser.global_conf["authenticator"]
|
||||
|
@ -235,7 +235,7 @@ def test_actions_map_api():
|
|||
|
||||
amap.generate_cache()
|
||||
|
||||
amap = ActionsMap(ActionsMapParser, use_cache=True)
|
||||
amap = ActionsMap(ActionsMapParser())
|
||||
|
||||
assert amap.parser.global_conf["authenticate"] == "all"
|
||||
assert "default" in amap.parser.global_conf["authenticator"]
|
||||
|
@ -274,9 +274,7 @@ def test_actions_map_cli():
|
|||
default=False,
|
||||
help="Log and print debug messages",
|
||||
)
|
||||
amap = ActionsMap(
|
||||
ActionsMapParser, use_cache=False, parser_kwargs={"top_parser": parser}
|
||||
)
|
||||
amap = ActionsMap(ActionsMapParser(top_parser=parser))
|
||||
|
||||
assert amap.parser.global_conf["authenticate"] == "all"
|
||||
assert "default" in amap.parser.global_conf["authenticator"]
|
||||
|
@ -295,9 +293,7 @@ def test_actions_map_cli():
|
|||
|
||||
amap.generate_cache()
|
||||
|
||||
amap = ActionsMap(
|
||||
ActionsMapParser, use_cache=True, parser_kwargs={"top_parser": parser}
|
||||
)
|
||||
amap = ActionsMap(ActionsMapParser(top_parser=parser))
|
||||
|
||||
assert amap.parser.global_conf["authenticate"] == "all"
|
||||
assert "default" in amap.parser.global_conf["authenticator"]
|
||||
|
|
Loading…
Reference in a new issue