Skip to content
This repository has been archived by the owner on Nov 10, 2023. It is now read-only.

Commit

Permalink
Add cli test
Browse files Browse the repository at this point in the history
  • Loading branch information
richfitz committed Oct 20, 2023
1 parent bd6afd1 commit caf1348
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,20 @@ def test_can_parse_export(tmp_path):
}


def test_can_parse_local_export():
res = _parse_argv(["export", "v", "--source=local"])
assert res.target == privateer2.cli.export_tar_local
assert res.kwargs == {
"volume": "v",
"to_dir": None,
"dry_run": False,
}
with pytest.raises(Exception, match="Don't use '--as'"):
_parse_argv(["export", "v", "--source=local", "--as=bob"])
with pytest.raises(Exception, match="Don't use '--path'"):
_parse_argv(["export", "v", "--source=local", "--path=p"])


def test_error_if_unknown_identity(tmp_path):
shutil.copy("example/simple.json", tmp_path / "privateer.json")
msg = "Can't determine identity; did you forget to configure"
Expand Down

0 comments on commit caf1348

Please sign in to comment.