summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhihai Song <zhihai.song@easystack.cn>2016-01-07 15:27:33 +0800
committerZhihai Song <zhihai.song@easystack.cn>2016-01-07 15:27:33 +0800
commit1322601c883763eef0784919c6d6c9aaac19ab97 (patch)
tree40623c33c0cad1e4c5fbe39951d4111466490139
parentea2bd8c5964bd624d15fb2a3effc5746e60e9ac6 (diff)
downloadoslo-middleware-1322601c883763eef0784919c6d6c9aaac19ab97.tar.gz
test: pass enforce_type=True when using CONF.set_override
CONF.set_override is used to change config option's value with designated value in unit test, but never check if the designated vaule is valid. Each config option has specifications for type and value. In production code, oslo.conf can ensure user's input is valid, but in unit test, test methods can pass if we use method CONF.set_override without parameter enforce_type=True even we pass wrong type or wrong value to config option. This commit makes sure calling method CONF.set_override with enforce_type=True in the unit test. Note: We can't set enforce_type=True by default in oslo.config now, it may break all project's unit test. We can switch enforce_type=True by default when all project fix violations like this commit. Change-Id: Id7170d565a99c45247d09142672ca6b32edd4012
-rw-r--r--oslo_middleware/tests/test_ssl.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/oslo_middleware/tests/test_ssl.py b/oslo_middleware/tests/test_ssl.py
index 810503d..e493a3a 100644
--- a/oslo_middleware/tests/test_ssl.py
+++ b/oslo_middleware/tests/test_ssl.py
@@ -31,7 +31,7 @@ class SSLMiddlewareTest(base.BaseTestCase):
if secure_proxy_ssl_header:
middleware.oslo_conf.set_override(
'secure_proxy_ssl_header', secure_proxy_ssl_header,
- group='oslo_middleware')
+ group='oslo_middleware', enforce_type=True)
request = webob.Request.blank('http://example.com/', headers=headers)
# Ensure ssl middleware does not stop pipeline execution