Ejemplo n.º 1
0
def test_clean(runner: CliRunner):
    with runner.isolated_filesystem() as path:
        path = Path(path) / "dist"
        path.mkdir()

        result = runner.invoke(app, "clean")
        assert result.exit_code == 0
        assert not path.exists()
Ejemplo n.º 2
0
def isolated_cli_runner(cli_runner: CliRunner) -> Iterator[CliRunner]:
    """Instance of `typer.testing.CliRunner` running under a temporary working directory for isolated filesystem tests."""
    with cli_runner.isolated_filesystem():
        yield cli_runner
Ejemplo n.º 3
0
def test_build(runner: CliRunner):
    with runner.isolated_filesystem() as path:
        result = runner.invoke(app, "build")
        assert result.exit_code == 0
        index = Path(path) / "dist" / "index.html"
        assert index.exists()
Ejemplo n.º 4
0
def test_version(runner: CliRunner):
    with runner.isolated_filesystem():
        result = runner.invoke(app, "version")
        assert result.exit_code == 0
        assert result.stdout == "Version: 0.1.0\n"