Skip to content

Commit f8bf595

Browse files
authored
Add a test for the common parameter 'panel' (#4064)
1 parent c5753c9 commit f8bf595

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

pygmt/tests/test_alias_system.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ def func(
1515
label=None,
1616
text=None,
1717
offset=None,
18+
panel=False,
1819
**kwargs,
1920
):
2021
"""
@@ -29,7 +30,10 @@ def func(
2930
Alias(text, name="text", prefix="+t"),
3031
Alias(offset, name="offset", prefix="+o", sep="/"),
3132
],
32-
).merge(kwargs)
33+
).add_common(
34+
c=panel,
35+
)
36+
aliasdict.merge(kwargs)
3337
return build_arg_list(aliasdict)
3438

3539

@@ -95,3 +99,14 @@ def test_alias_system_multiple_aliases_short_form():
9599

96100
with pytest.raises(GMTInvalidInput, match=msg):
97101
func(text="efg", U="efg")
102+
103+
104+
def test_alias_system_common_parameter_panel():
105+
"""
106+
Test that the alias system works with the panel parameter.
107+
"""
108+
assert func(panel=True) == ["-c"]
109+
assert func(panel=False) == []
110+
assert func(panel=(1, 2)) == ["-c1,2"]
111+
assert func(panel=1) == ["-c1"]
112+
assert func(panel="1,2") == ["-c1,2"]

0 commit comments

Comments
 (0)