1
0
mirror of https://github.com/ycd/manage-fastapi.git synced 2021-11-08 01:34:39 +03:00
Files
manage-fastapi/tests/test_startapp.py
Marcelo Trylesinski 41648fb46e Support Windows and MacOS (#36)
* Support Windows and MacOS

* Add questionary dependency

* Remove the tests

* Remove print
2021-09-02 22:24:13 +02:00

18 lines
501 B
Python

from pathlib import Path
from typer.testing import CliRunner
from manage_fastapi.main import app
runner = CliRunner()
CREATED_SUCCESSFULLY = "FastAPI app created successfully! 🎉\n"
ALREADY_EXISTS = "Folder 'potato' already exists. 😞\n"
def test_startproject_default(tmp_path: Path):
with runner.isolated_filesystem(temp_dir=tmp_path):
result = runner.invoke(app, ["startapp", "potato"])
assert result.output == CREATED_SUCCESSFULLY
assert result.exit_code == 0