Skip to content

Commit

Permalink
Address coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
inno committed May 26, 2024
1 parent 7486ab5 commit 10bf4c1
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/test_param.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,3 +190,25 @@ def test_param_boolean_implied_false():
assert p1.required is False
assert p1.optional is False
assert p1.value is False


def test_param_validate_list():
p1 = Param(name="testparam1", annotation=list[str])
assert p1.validate(["foo", "bar"]) is True
assert p1.required is True
assert p1.optional is False


def test_param_set_value_as_seq_valid():
p1 = Param(name="testparam1", annotation=list[str])
p1.set_value_as_seq([123, "bar"])
assert p1.required is True
assert p1.optional is False


def test_param_set_value_as_seq_invalid():
p1 = Param(name="testparam1", annotation=list[int])
with pytest.raises(ValueError, match="int"):
p1.set_value_as_seq([123, "bar"])
assert p1.required is True
assert p1.optional is False

0 comments on commit 10bf4c1

Please sign in to comment.