summaryrefslogtreecommitdiff
path: root/tests/test_cfg.py
diff options
context:
space:
mode:
authorDoug Hellmann <doug@doughellmann.com>2015-07-10 12:39:46 +0000
committerDoug Hellmann <doug@doughellmann.com>2015-07-12 19:03:45 +0000
commit061ab839969cd089dd3c70bd5e2cd4344dc11795 (patch)
tree9138aee6306dba43105da3e59e64f5eefd9f3752 /tests/test_cfg.py
parent781868f2dacc06814ccf5af755d8fee139479767 (diff)
downloadoslo-config-061ab839969cd089dd3c70bd5e2cd4344dc11795.tar.gz
Fix use of mock for 1.1.0
Correctly assert the number of calls to a mocked method. Combine this with the change to pin the version of mock used for python 2.6 and raise the minimum version of mock used elsewhere. Change-Id: I8cf1936f06f489561a59ec3cc75a1a8d6419a9ef
Diffstat (limited to 'tests/test_cfg.py')
-rw-r--r--tests/test_cfg.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/test_cfg.py b/tests/test_cfg.py
index 6b65788..6e72600 100644
--- a/tests/test_cfg.py
+++ b/tests/test_cfg.py
@@ -951,7 +951,7 @@ class ConfigFileOptsTestCase(BaseTestCase):
@mock.patch('oslo_config.cfg.LOG')
def test_conf_file_int_wrong_default(self, mock_log):
cfg.IntOpt('foo', default='666')
- mock_log.debug.assert_call_count(1)
+ self.assertEqual(1, mock_log.debug.call_count)
def test_conf_file_int_value(self):
self.conf.register_opt(cfg.IntOpt('foo'))
@@ -1027,10 +1027,10 @@ class ConfigFileOptsTestCase(BaseTestCase):
self.assertTrue(hasattr(self.conf, 'foo'))
self.assertEqual(self.conf.foo, 6.66)
- @mock.patch.object(cfg, 'LOG')
+ @mock.patch('oslo_config.cfg.LOG')
def test_conf_file_float_default_wrong_type(self, mock_log):
cfg.FloatOpt('foo', default='foobar6.66')
- mock_log.debug.assert_call_count(1)
+ self.assertEqual(1, mock_log.debug.call_count)
def test_conf_file_float_value(self):
self.conf.register_opt(cfg.FloatOpt('foo'))