Bläddra i källkod

tests: add tests on entering an unsupported template name

trgiangdo 1 år sedan
förälder
incheckning
d918553d24
1 ändrade filer med 8 tillägg och 0 borttagningar
  1. 8 0
      tests/templates/test_template_cli.py

+ 8 - 0
tests/templates/test_template_cli.py

@@ -21,3 +21,11 @@ def test_create_cli_with_wrong_arguments(caplog):
         with pytest.raises(SystemExit):
             _entrypoint()
         assert "Unknown arguments: --teamplaet. Did you mean: --template?" in caplog.text
+
+
+def test_create_cli_with_unsupported_template(capsys):
+    with patch("sys.argv", ["prog", "create", "--template", "not-a-template"]):
+        with pytest.raises(SystemExit):
+            _entrypoint()
+        _, err = capsys.readouterr()
+        assert "invalid choice: 'not-a-template'" in err