Skip to content

Commit

Permalink
feat: Add command snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxG87 committed Sep 12, 2023
1 parent f708404 commit 1e7c2a3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/root_subvol_snapshot/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,10 @@ def close(device: t.Annotated[t.Optional[Path], typer.Argument()] = None) -> Non
typer.echo(f"Closing {device}...")


@app.command()
def snapshot(device: t.Annotated[t.Optional[Path], typer.Argument()] = None) -> None:
typer.echo("Making a snapshot of the root subvolume...")


if __name__ == "__main__":
app()
6 changes: 6 additions & 0 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,9 @@ def test_close_with_argument(tmp_path):
result = runner.invoke(app, ["close", str(tmp_path)])
assert result.exit_code == 0
assert result.output.endswith(f"{tmp_path}...\n")


def test_snapshot():
result = runner.invoke(app, ["snapshot"])
assert result.exit_code == 0
assert result.output.startswith("Making a snapshot of the root subvolume...")

0 comments on commit 1e7c2a3

Please sign in to comment.