|
12 | 12 | ) |
13 | 13 | from ellar_cli.service.pyproject import PY_PROJECT_TOML |
14 | 14 |
|
15 | | -good_app_info = ( |
16 | | - b"Usage: good_app.py [OPTIONS] COMMAND [ARGS]...\n\n " |
17 | | - b"Ellar, ASGI Python Web framework\n\nOptions:\n --project TEXT " |
18 | | - b"Run Specific Command on a specific project [default:\n " |
19 | | - b"default]\n -v, --version Show the version and exit.\n --help " |
20 | | - b"Show this message and exit.\n\nCommands:\n create-module - Scaffolds Ellar Application Module -\n " |
21 | | - b"failing-1\n failing-2\n failing-3\n runserver - " |
22 | | - b"Starts Uvicorn Server -\n working\n" |
23 | | -) |
| 15 | +good_app_info = """Usage: good_app.py [OPTIONS] COMMAND [ARGS]... |
| 16 | +
|
| 17 | + Ellar, ASGI Python Web framework |
| 18 | +
|
| 19 | +Options: |
| 20 | + --project TEXT Run Specific Command on a specific project [default: |
| 21 | + default] |
| 22 | + -v, --version Show the version and exit. |
| 23 | + --help Show this message and exit. |
| 24 | +
|
| 25 | +Commands: |
| 26 | + create-module - Scaffolds Ellar Application Module - |
| 27 | + failing-1 |
| 28 | + failing-2 |
| 29 | + failing-3 |
| 30 | + runserver - Starts Uvicorn Server - |
| 31 | + working |
| 32 | +""" |
24 | 33 |
|
25 | 34 |
|
26 | 35 | def test_import_project_meta_returns_default_when_py_project_is_none(tmp_path): |
@@ -194,9 +203,11 @@ def test_version_works(write_empty_py_project, process_runner): |
194 | 203 |
|
195 | 204 |
|
196 | 205 | def test_apps_good_app_cli_works(change_os_dir): |
197 | | - result = subprocess.run(["python", "apps/good_app.py"], stdout=subprocess.PIPE) |
| 206 | + result = subprocess.run( |
| 207 | + ["python", "apps/good_app.py", "--help"], stdout=subprocess.PIPE |
| 208 | + ) |
198 | 209 | assert result.returncode == 0 |
199 | | - assert result.stdout == good_app_info |
| 210 | + assert result.stdout.decode("utf-8") == good_app_info |
200 | 211 |
|
201 | 212 |
|
202 | 213 | def test_apps_good_app_working_command(change_os_dir): |
|
0 commit comments