From d75b19cd345defafb191290196ad92e8e91f0f78 Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Fri, 22 Aug 2025 22:28:21 +0800 Subject: [PATCH] Add a test for the common parameter 'panel' --- pygmt/tests/test_alias_system.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/pygmt/tests/test_alias_system.py b/pygmt/tests/test_alias_system.py index edb69ac9afd..6f5a1e599bb 100644 --- a/pygmt/tests/test_alias_system.py +++ b/pygmt/tests/test_alias_system.py @@ -15,6 +15,7 @@ def func( label=None, text=None, offset=None, + panel=False, **kwargs, ): """ @@ -29,7 +30,10 @@ def func( Alias(text, name="text", prefix="+t"), Alias(offset, name="offset", prefix="+o", sep="/"), ], - ).merge(kwargs) + ).add_common( + c=panel, + ) + aliasdict.merge(kwargs) return build_arg_list(aliasdict) @@ -95,3 +99,14 @@ def test_alias_system_multiple_aliases_short_form(): with pytest.raises(GMTInvalidInput, match=msg): func(text="efg", U="efg") + + +def test_alias_system_common_parameter_panel(): + """ + Test that the alias system works with the panel parameter. + """ + assert func(panel=True) == ["-c"] + assert func(panel=False) == [] + assert func(panel=(1, 2)) == ["-c1,2"] + assert func(panel=1) == ["-c1"] + assert func(panel="1,2") == ["-c1,2"]