Skip to content

Commit 4e018fe

Browse files
committed
✅ add test
1 parent 8402c85 commit 4e018fe

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/components_test.py

+8
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,14 @@ def operate(cls, interface: "Arparma"):
3737
assert com1.parse("comp1 --foo 1 --baz 2").matched
3838
assert com1.parse("comp1 --foo 2 --baz 1").matched is False
3939

40+
com1.behaviors.clear()
41+
com1.behaviors.append(conflict("foo", "baz.qux", target_limiter=lambda x: x == 1))
42+
43+
assert com1.parse("comp1 --foo 1").matched
44+
assert com1.parse("comp1 --baz 2").matched
45+
assert com1.parse("comp1 --foo 1 --baz 2").matched
46+
assert com1.parse("comp1 --foo 1 --baz 1").matched is False
47+
4048
com1_1 = Alconna(
4149
"comp1_1",
4250
Option("-1", dest="one"),

0 commit comments

Comments
 (0)