Explorar o código

fix: update taipy help test

trgiangdo hai 1 ano
pai
achega
fc7a303dc7
Modificáronse 1 ficheiros con 9 adicións e 17 borrados
  1. 9 17
      tests/cli/test_cli.py

+ 9 - 17
tests/cli/test_cli.py

@@ -48,28 +48,26 @@ def clean_argparser():
     yield
 
 
-def test_taipy_help(capsys):
-    expected_help = """{manage-versions,create,help} ...
+expected_help = """{run,manage-versions,create,help} ...
 
 positional arguments:
-  {manage-versions,create,help}
-    manage-versions         Taipy version control system.
-    create          Create a new Taipy application.
+  {run,manage-versions,create,help}
+    run                 Run a Taipy application.
+    manage-versions     Taipy version control system.
+    create              Create a new Taipy application.
     help                Show the Taipy help message.
 """
 
+
+def test_taipy_command_alone_print_help(capsys):
     with patch("sys.argv", ["prog"]):
         _entrypoint()
         out, _ = capsys.readouterr()
         assert preprocess_stdout(expected_help) in preprocess_stdout(out)
 
-    with patch("sys.argv", ["prog", "help"]):
-        with pytest.raises(SystemExit):
-            _entrypoint()
-        out, _ = capsys.readouterr()
-        assert preprocess_stdout(expected_help) in preprocess_stdout(out)
 
-    with patch("sys.argv", ["prog", "--help"]):
+def test_taipy_help_command(capsys):
+    with patch("sys.argv", ["prog", "help"]):
         with pytest.raises(SystemExit):
             _entrypoint()
         out, _ = capsys.readouterr()
@@ -91,9 +89,3 @@ def test_taipy_create_help(capsys):
             _entrypoint()
         out, _ = capsys.readouterr()
         assert preprocess_stdout(expected_help) in preprocess_stdout(out)
-
-    with patch("sys.argv", ["prog", "create", "--help"]):
-        with pytest.raises(SystemExit):
-            _entrypoint()
-        out, _ = capsys.readouterr()
-        assert preprocess_stdout(expected_help) in preprocess_stdout(out)