summaryrefslogtreecommitdiff
path: root/oslo_middleware
diff options
context:
space:
mode:
authorDoug Hellmann <doug@doughellmann.com>2015-07-10 13:18:50 +0000
committerDoug Hellmann <doug@doughellmann.com>2015-07-12 19:07:02 +0000
commitbb6dec2466e8c03ae83fe57d81ffa4d15fa7d97a (patch)
treea5bbe247f76d639b1405fcd92ab103796db4d2f3 /oslo_middleware
parent85baf7d16fc9da47aba54f03a16d14071da4f9df (diff)
downloadoslo-middleware-bb6dec2466e8c03ae83fe57d81ffa4d15fa7d97a.tar.gz
Fix mocking for 1.1.0
Call the right assertion method on the mock in test_disablefile_unconfigured, and fix the way the mock is set up so it works. Combine this with the change to pin the version of mock used on python 2.6 and to raise the minimum version of mock used elsewhere. Change-Id: I1ac9f9796227a860df75d4c72464479dbe66258c
Diffstat (limited to 'oslo_middleware')
-rw-r--r--oslo_middleware/tests/test_healthcheck.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/oslo_middleware/tests/test_healthcheck.py b/oslo_middleware/tests/test_healthcheck.py
index a9fa2a9..13aa5fd 100644
--- a/oslo_middleware/tests/test_healthcheck.py
+++ b/oslo_middleware/tests/test_healthcheck.py
@@ -51,14 +51,17 @@ class HealthcheckTests(test_base.BaseTestCase):
conf = {'path': '/hidden_healthcheck'}
self._do_test(conf, path='/toto', expected_body=b'Hello, World!!!')
- @mock.patch('logging.warn')
- def test_disablefile_unconfigured(self, fake_warn):
+ @mock.patch('oslo_middleware.healthcheck.disable_by_file.LOG')
+ def test_disablefile_unconfigured(self, fake_log):
+ fake_warn = fake_log.warning
conf = {'backends': 'disable_by_file'}
self._do_test(conf, expected_body=b'OK')
self.assertIn('disable_by_file', self.app._backends.names())
- fake_warn.assert_called_once('DisableByFile healthcheck middleware '
- 'enabled without disable_by_file_path '
- 'set')
+ fake_warn.assert_called_once_with(
+ 'DisableByFile healthcheck middleware '
+ 'enabled without disable_by_file_path '
+ 'set'
+ )
def test_disablefile_enabled(self):
conf = {'backends': 'disable_by_file',