Skip to content

Commit

Permalink
Added test for validate_context_params
Browse files Browse the repository at this point in the history
  • Loading branch information
coordt committed Feb 13, 2023
1 parent 02a4bf3 commit a52d28d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pytest
from click import BadParameter
from click.testing import CliRunner

from cookie_composer import cli
Expand All @@ -9,6 +10,14 @@ def runner():
return CliRunner()


def test_validate_context_params():
"""Make sure the context params are validated"""
with pytest.raises(BadParameter):
cli.validate_context_params(None, None, ("iaminvalid", "key=value"))

assert cli.validate_context_params(None, None, ("key1=value1", "key=value")) == {"key1": "value1", "key": "value"}


def test_helps(runner):
result = runner.invoke(cli.create, "--help")
assert result.exit_code == 0
Expand Down

0 comments on commit a52d28d

Please sign in to comment.