]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
test/pybind/test_ceph_argparse: add a test where args contains comma 42065/head
authorKefu Chai <kchai@redhat.com>
Sun, 13 Jun 2021 11:56:26 +0000 (19:56 +0800)
committerPatrick Donnelly <pdonnell@redhat.com>
Wed, 30 Jun 2021 19:04:19 +0000 (12:04 -0700)
commit1f5111cbeab258ae112a5c71e93989a8414b9730
tree5aa79605978477740bf8298a9570dc4dc6b03003
parent7e253954615f155f42d166d3bd89482b728ae7f3
test/pybind/test_ceph_argparse: add a test where args contains comma

to ensure the support for the new syntax of "prefix --name bon,jour"
does not break existing behavior of "prefix hello cruel,world" where value2
contains reads "hello,world", and the parsed result should be

prefix="prefix"
value=["hello", "cruel,world"]

instead of something like

prefix="prefix"
value=["hello", "cruel", "world"]

or

prefix="prefix"
value=["cruel", "world"]

the above test only applies to the test where "value" is a CephString.
if "value" is a CephChoices, the parsed argument should be

prefix="prefix"
value=["hello", "cruel", "world"]

Signed-off-by: Kefu Chai <kchai@redhat.com>
(cherry picked from commit 9b6be59d6fa6ff7f6c5d773b6774728cf828b768)
src/test/pybind/test_ceph_argparse.py