Commit aeb740cd authored by Alain Takoudjou's avatar Alain Takoudjou

Allow newlines and other control characters in JSON parameter string

parent b53ba563
...@@ -35,7 +35,7 @@ import json ...@@ -35,7 +35,7 @@ import json
import sys import sys
sys.path[0:0] = %(path)s sys.path[0:0] = %(path)s
extra_config_dict = json.loads("""%(config)s""") extra_config_dict = json.loads("""%(config)s""", strict=False)
# We want to cleanup all imported modules from slapos namespace, because # We want to cleanup all imported modules from slapos namespace, because
# they will conflict with slapos.core. # they will conflict with slapos.core.
......
...@@ -44,7 +44,7 @@ in multi line ...@@ -44,7 +44,7 @@ in multi line
param3=self.options['config-param3'], param3=self.options['config-param3'],
param4=self.options['config-param4'], param4=self.options['config-param4'],
) )
self.assertIn('extra_config_dict = json.loads("""%s""")' % json.dumps(expected_dict, indent=2, sort_keys=True), content) self.assertIn('extra_config_dict = json.loads("""%s""", strict=False)' % json.dumps(expected_dict, indent=2, sort_keys=True), content)
def test_no_module_set(self): def test_no_module_set(self):
recipe = makeRecipe( recipe = makeRecipe(
...@@ -67,7 +67,7 @@ in multi line ...@@ -67,7 +67,7 @@ in multi line
with open(self.output) as f: with open(self.output) as f:
content = f.read() content = f.read()
self.assertIn("from slapos.promise.plugin.check_site_available import RunPromise", content) self.assertIn("from slapos.promise.plugin.check_site_available import RunPromise", content)
self.assertIn('extra_config_dict = json.loads("""{}""")', content) self.assertIn('extra_config_dict = json.loads("""{}""", strict=False)', content)
def test_bad_parameters(self): def test_bad_parameters(self):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment