From 82fee1c592c1a9c3048fbad59bc144daa9b4a45a Mon Sep 17 00:00:00 2001 From: Nanguage Date: Fri, 16 Sep 2022 11:16:12 +0800 Subject: [PATCH] add test --- docs/wrap_cli.md | 2 +- tests/test_dash.py | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/docs/wrap_cli.md b/docs/wrap_cli.md index d48ae43..8e71e5c 100644 --- a/docs/wrap_cli.md +++ b/docs/wrap_cli.md @@ -54,7 +54,7 @@ $ python -m oneface.wrap_cli run example.yaml dash_app ``` -## Command insert +## Flag insertion Extra string can insert to the actually executed command when the parameter is a `bool` type. It's useful when the command contains some diff --git a/tests/test_dash.py b/tests/test_dash.py index a914773..8e82924 100644 --- a/tests/test_dash.py +++ b/tests/test_dash.py @@ -23,7 +23,6 @@ def func(a: Arg[int, [-10, 10]] = 0, assert 0 == func.dash_app.layout.children[1].children[1].value assert 20 == func.dash_app.layout.children[2].children[1].value - @app @one def func1(a: bool): @@ -31,3 +30,11 @@ def func1(a: bool): assert 'True' == func1.dash_app.layout.children[1].children[1].value + +def test_download_type(): + @app(result_type="download") + @one + def func(a: str): + return "" + + assert func.dash_app is not None