mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
moulinette_cli fixture
This commit is contained in:
parent
9315cab495
commit
535f4bcb3b
1 changed files with 18 additions and 0 deletions
|
@ -127,6 +127,24 @@ def moulinette_webapi(moulinette):
|
||||||
return TestApp(moulinette_webapi._app)
|
return TestApp(moulinette_webapi._app)
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture
|
||||||
|
def moulinette_cli(moulinette):
|
||||||
|
# Dirty hack needed, otherwise cookies ain't reused between request .. not
|
||||||
|
# sure why :|
|
||||||
|
import argparse
|
||||||
|
parser = argparse.ArgumentParser(add_help=False)
|
||||||
|
parser.add_argument('--debug',
|
||||||
|
action='store_true', default=False,
|
||||||
|
help="Log and print debug messages",
|
||||||
|
)
|
||||||
|
moulinette_cli = moulinette.core.init_interface(
|
||||||
|
"cli",
|
||||||
|
actionsmap={"namespaces": ["moulitest"], "use_cache": False, "parser_kwargs": {'top_parser': parser}},
|
||||||
|
)
|
||||||
|
|
||||||
|
return moulinette_cli
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def test_file(tmp_path):
|
def test_file(tmp_path):
|
||||||
test_text = "foo\nbar\n"
|
test_text = "foo\nbar\n"
|
||||||
|
|
Loading…
Add table
Reference in a new issue