Skip to content

Commit

Permalink
Fix two doctests
Browse files Browse the repository at this point in the history
  • Loading branch information
seisman committed Dec 1, 2024
1 parent c8d48db commit 845ef41
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions pygmt/helpers/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,10 +408,10 @@ def non_ascii_to_octal(argstr: str, encoding: Encoding = "ISOLatin1+") -> str:
'@%34%\\041@%%@%34%\\176@%%@%34%\\241@%%@%34%\\376@%%'
>>> non_ascii_to_octal("ABC ±120° DEF α ♥")
'ABC \\261120\\260 DEF @~\\141@~ @%34%\\252@%%'
>>> non_ascii_to_octal("'‘’\"“”")
'\\234\\140\\47\\042\\216\\217'
>>> non_ascii_to_octal("12ABāáâãäåβ①②", encoding="ISO-8859-4")
'12AB\\340\\341\\342\\343\\344\\345@~\\142@~@%34%\\254@%%@%34%\\255@%%'
>>> non_ascii_to_octal("'‘’\"“”")
'\\234\\140\\047"\\216\\217'
""" # noqa: RUF002
# Return the input string if it only contains ASCII characters.
# Apostrophe (') and backtick (`) are excluded.
Expand Down Expand Up @@ -481,16 +481,12 @@ def build_arg_list( # noqa: PLR0912
['-A', '-D0', '-E200', '-F', '-G1/2/3/4']
>>> build_arg_list(dict(A="1/2/3/4", B=["xaf", "yaf", "WSen"], C=("1p", "2p")))
['-A1/2/3/4', '-BWSen', '-Bxaf', '-Byaf', '-C1p', '-C2p']
>>> print(
... build_arg_list(
... dict(
... B=["af", "WSne+tBlank Space"],
... F='+t"Empty Spaces"',
... l="'Void Space'",
... )
... )
... )
['-BWSne+tBlank Space', '-Baf', '-F+t"Empty Spaces"', "-l'Void Space'"]
>>> build_arg_list(dict(B=["af", "WSne+tBlank Space"]))
['-BWSne+tBlank Space', '-Baf']
>>> build_arg_list(dict(F='+t"Empty Spaces"'))
['-F+t"Empty Spaces"']
>>> build_arg_list(dict(l="'Void Space'"))
['-l\\234Void Space\\234', '--PS_CHAR_ENCODING=ISOLatin1+']
>>> print(
... build_arg_list(
... dict(A="0", B=True, C="rainbow"),
Expand Down

0 comments on commit 845ef41

Please sign in to comment.