Turn on logging for the request log test

The request logger will not log unless it is enabled via
adjusting the logger configuration. Under the nova tests
this configuration was there by default. The placement tests need
to set it explicitly.

Change-Id: I59b470b7bfe6741bd8d4ffe4cffbe2f28c847216
This commit is contained in:
Chris Dent 2018-09-03 14:42:30 +01:00 committed by Eric Fried
parent 126bc023ec
commit c4a83cdca3
1 changed files with 3 additions and 1 deletions

View File

@ -46,7 +46,9 @@ class TestRequestLog(testtools.TestCase):
self.assertEqual('/placement/resource_providers?name=myrp', req_uri)
@mock.patch("placement.requestlog.RequestLog.write_log")
def test_middleware_writes_logs(self, write_log):
@mock.patch("placement.requestlog.LOG")
def test_middleware_writes_logs(self, mocked_log, write_log):
mocked_log.isEnabledFor.return_value = True
start_response_mock = mock.MagicMock()
app = requestlog.RequestLog(self.application)
app(self.environ, start_response_mock)