Skip to content

Commit

Permalink
✅ add test
Browse files Browse the repository at this point in the history
  • Loading branch information
RF-Tar-Railt committed Sep 21, 2024
1 parent 8402c85 commit 4e018fe
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/components_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ def operate(cls, interface: "Arparma"):
assert com1.parse("comp1 --foo 1 --baz 2").matched
assert com1.parse("comp1 --foo 2 --baz 1").matched is False

com1.behaviors.clear()
com1.behaviors.append(conflict("foo", "baz.qux", target_limiter=lambda x: x == 1))

assert com1.parse("comp1 --foo 1").matched
assert com1.parse("comp1 --baz 2").matched
assert com1.parse("comp1 --foo 1 --baz 2").matched
assert com1.parse("comp1 --foo 1 --baz 1").matched is False

com1_1 = Alconna(
"comp1_1",
Option("-1", dest="one"),
Expand Down

0 comments on commit 4e018fe

Please sign in to comment.