Method CONF.set_override 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 a type like StrOpt,
BoolOpt, etc. StrOpt with parameter choices only allows values in set
of choices. In short, each config option has limitation 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 and fixes violations.
Reviewed: https:/ /review. openstack. org/265737 /git.openstack. org/cgit/ openstack/ cloudkitty/ commit/ ?id=f9b52a93bb8 070ba93dd79ff2a a3e41a5057b710
Committed: https:/
Submitter: Jenkins
Branch: master
commit f9b52a93bb8070b a93dd79ff2aa3e4 1a5057b710
Author: Chaozhe.Chen <email address hidden>
Date: Mon Jan 11 17:48:39 2016 +0800
Test: make enforce_type=True in CONF.set_override
Method CONF.set_override to change config option's set_override without parameter enforce_type=True even we pass wrong
value with designated value in unit test, but never check if the
designated vaule is valid. Each config option has a type like StrOpt,
BoolOpt, etc. StrOpt with parameter choices only allows values in set
of choices. In short, each config option has limitation 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.
type or wrong value to config option. This commit makes sure calling
method CONF.set_override with enforce_type=True and fixes violations.
Change-Id: Ibf5570b74947b0 71b96aa7ca4a682 affb137d065
Related-Bug: #1517839