From 0249d69793b18379ed9149b9746d98754c93e67b Mon Sep 17 00:00:00 2001 From: Sina Atalay Date: Tue, 30 Apr 2024 21:20:44 +0300 Subject: [PATCH] tests: add new cli tests --- tests/test_cli.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tests/test_cli.py b/tests/test_cli.py index 55c5e3d..33969ad 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -550,3 +550,22 @@ def test_create_theme_command(tmp_path, input_file_path, based_on): assert html_file_path.exists() assert png_file_path.exists() assert "Your CV is rendered!" in result.stdout + + +def test_create_theme_command_invalid_based_on_theme(tmp_path): + result = runner.invoke( + cli.app, ["create-theme", "newtheme", "--based-on", "invalid_theme"] + ) + + assert "is not in the list of available themes" in result.stdout + + +def test_create_theme_command_theme_already_exists(tmp_path): + # change the current working directory to the temporary directory: + os.chdir(tmp_path) + + (tmp_path / "newtheme").mkdir() + + result = runner.invoke(cli.app, ["create-theme", "newtheme"]) + + assert "already exists!" in result.stdout