From b1bc7dca275deb50e7a00de0898165009cfb23c1 Mon Sep 17 00:00:00 2001 From: Jusong Yu Date: Tue, 5 Sep 2023 10:44:15 +0200 Subject: [PATCH] Add test --- tests/test_cli.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/test_cli.py b/tests/test_cli.py index 3bd7697..f6f2408 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -101,6 +101,9 @@ def test_add_remove_profile(): assert result.exit_code == 0 assert "Added profile 'new-profile'." in result.output + # Add second profile to be clean with delete volume + runner.invoke(cli.cli, ["profile", "add", "second-profile"], input="n\n") + # Check that new-profile exists result: Result = runner.invoke(cli.cli, ["profile", "list"]) assert "new-profile" in result.output @@ -138,6 +141,10 @@ def test_add_remove_profile(): assert result.exit_code == 1 assert "Profile with name 'new-profile' does not exist." in result.output + # Remove second-profile with reset (`--purge` option) + result: Result = runner.invoke(cli.cli, ["profile", "remove", "--purge", "second-profile"], input="second-profile\ny\n") + assert result.exit_code == 0 + assert "Please enter the name of the profile to continue" in result.output def test_add_profile_invalid_name(): runner: CliRunner = CliRunner()