Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions pygmt/params/position.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,18 @@ def _validate(self):
description="reference point",
reason="Expect a valid 2-character justification code.",
)
case _:
raise GMTValueError(
self.cstype,
description="cstype",
choices=[
"mapcoords",
"plotcoords",
"boxcoords",
"inside",
"outside",
],
)
# Validate the anchor if specified.
if self.anchor is not None and self.anchor not in _valid_anchors:
raise GMTValueError(
Expand Down
2 changes: 2 additions & 0 deletions pygmt/tests/test_params_position.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ def test_params_position_invalid_location():
"""
Test that invalid location inputs raise GMTValueError.
"""
with pytest.raises(GMTValueError):
Position((1, 2), cstype="invalid")
with pytest.raises(GMTValueError):
Position("invalid", cstype="mapcoords")
with pytest.raises(GMTValueError):
Expand Down
Loading