summaryrefslogtreecommitdiffstats
path: root/testsuite
diff options
context:
space:
mode:
authorSol Jerome <sol.jerome@gmail.com>2015-07-23 12:03:29 -0500
committerSol Jerome <sol.jerome@gmail.com>2015-07-23 12:03:29 -0500
commitc11fcd8110e537db70bf40b91ed14467184b0e1c (patch)
treee2a39e6d2d7b5841cf71c21b07cd0cffb1fe21da /testsuite
parent49ab865657f03795139e95490b1978fcceca2f41 (diff)
parent9d5524f345279a6fb6042ea5acd519549cabe5b7 (diff)
downloadbcfg2-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')
-rw-r--r--testsuite/Testsrc/Testlib/TestOptions/TestTypes.py20
-rw-r--r--testsuite/common.py1
2 files changed, 12 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):
diff --git a/testsuite/common.py b/testsuite/common.py
index 4c7337e0d..e53cfdddf 100644
--- a/testsuite/common.py
+++ b/testsuite/common.py
@@ -64,6 +64,7 @@ try:
set_setup_default("time_zone")
set_setup_default("web_debug", False)
set_setup_default("web_prefix")
+ set_setup_default("django_settings")
import Bcfg2.DBSettings
Bcfg2.DBSettings.finalize_django_config()