diff options
author | Sol Jerome <sol.jerome@gmail.com> | 2015-07-23 12:03:29 -0500 |
---|---|---|
committer | Sol Jerome <sol.jerome@gmail.com> | 2015-07-23 12:03:29 -0500 |
commit | c11fcd8110e537db70bf40b91ed14467184b0e1c (patch) | |
tree | e2a39e6d2d7b5841cf71c21b07cd0cffb1fe21da /testsuite/Testsrc | |
parent | 49ab865657f03795139e95490b1978fcceca2f41 (diff) | |
parent | 9d5524f345279a6fb6042ea5acd519549cabe5b7 (diff) | |
download | bcfg2-c11fcd8110e537db70bf40b91ed14467184b0e1c.tar.gz bcfg2-c11fcd8110e537db70bf40b91ed14467184b0e1c.tar.bz2 bcfg2-c11fcd8110e537db70bf40b91ed14467184b0e1c.zip |
Merge branch 'fix-date-format' of https://github.com/AlexanderS/bcfg2
Diffstat (limited to 'testsuite/Testsrc')
-rw-r--r-- | testsuite/Testsrc/Testlib/TestOptions/TestTypes.py | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/testsuite/Testsrc/Testlib/TestOptions/TestTypes.py b/testsuite/Testsrc/Testlib/TestOptions/TestTypes.py index 404d67fdc..0b67db38a 100644 --- a/testsuite/Testsrc/Testlib/TestOptions/TestTypes.py +++ b/testsuite/Testsrc/Testlib/TestOptions/TestTypes.py @@ -46,21 +46,23 @@ class TestOptionTypes(Bcfg2TestCase): self.assertItemsEqual(self._test_options(["--test", "one:two three"]), ["one", "two three"]) - def test_comma_dict(self): - """parse comma-dict values.""" - self.options = [Option("--test", type=Types.comma_dict)] + def test_literal_dict(self): + """parse literal-dict values.""" + self.options = [Option("--test", type=Types.literal_dict)] expected = { "one": True, "two": 2, "three": "three", - "four": False} + "four": False, + "five": { + "a": 1, + "b": 2 + }} self.assertDictEqual( self._test_options(["--test", - "one=yes, two=2 , three=three,four=no"]), - expected) - - self.assertDictEqual( - self._test_options(["--test", "one,two=2,three=three,four=off"]), + '''{ "one": True, "two": 2, + "three": "three", "four": False, + "five": { "a": 1, "b": 2 }}''']), expected) def test_anchored_regex_list(self): |