]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
test/pybind/test_ceph_argparse: add a test where args contains comma 41773/head
authorKefu Chai <kchai@redhat.com>
Sun, 13 Jun 2021 11:56:26 +0000 (19:56 +0800)
committerKefu Chai <kchai@redhat.com>
Mon, 14 Jun 2021 01:50:47 +0000 (09:50 +0800)
commit9b6be59d6fa6ff7f6c5d773b6774728cf828b768
treee781e1c0605aba80655e5c28b82f8e1718dfe1bd
parent49be76ce11085bd333b5b8b281d8676c5ed450c2
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>
src/test/pybind/test_ceph_argparse.py