summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Rivera <rivera@joel.mx>2016-03-10 00:35:56 -0600
committerJoel Rivera <rivera@joel.mx>2016-03-10 00:35:56 -0600
commit0c1df2847151c6e33b12c1e39dcfd0f85c258d64 (patch)
treeec7366eb309a128aa3019db7550e84fa9cf3d719
parentbe7807d9229edaedde0eae18707694dcecf9965b (diff)
downloadcherrypy-0c1df2847151c6e33b12c1e39dcfd0f85c258d64.tar.gz
Avoid the side effects of using `cherypy.config.environments` on `test_call_with_kwargs` test.
-rw-r--r--cherrypy/test/test_config.py16
1 files changed, 11 insertions, 5 deletions
diff --git a/cherrypy/test/test_config.py b/cherrypy/test/test_config.py
index 491321dd..0508f92c 100644
--- a/cherrypy/test/test_config.py
+++ b/cherrypy/test/test_config.py
@@ -289,11 +289,17 @@ class CallablesInConfigTest(unittest.TestCase):
from textwrap import dedent
conf = dedent("""
[my]
- value = dict(test_suite="OVERRIDE", **cherrypy.config.environments)
+ value = dict(foo="buzz", **cherrypy._test_dict)
""")
+ test_dict = {
+ "foo": "bar",
+ "bar": "foo",
+ "fizz": "buzz"
+ }
+ cherrypy._test_dict = test_dict
fp = compat.StringIO(conf)
cherrypy.config.update(fp)
- env = cherrypy.config.environments.copy()
- env['test_suite'] = 'OVERRIDE'
- self.assertEqual(cherrypy.config['my']['value']['test_suite'], 'OVERRIDE')
- self.assertEqual(cherrypy.config['my']['value'], env)
+ test_dict['foo'] = 'buzz'
+ self.assertEqual(cherrypy.config['my']['value']['foo'], 'buzz')
+ self.assertEqual(cherrypy.config['my']['value'], test_dict)
+ del cherrypy._test_dict