Check log output rather than emitting in tests

Test TestLoadAuthMethod.test_entrypoint_fails_import_works
was emitting a log message that was being shown in stdout.
Check the log output rather than showing it to the developer.

Change-Id: I4e6675630372992b983a8c06c80f6d46f4439288
This commit is contained in:
Samuel de Medeiros Queiroz 2017-06-19 13:47:05 -04:00
parent 45265c0ddf
commit 3f2a0409fc
1 changed files with 7 additions and 0 deletions

View File

@ -72,7 +72,14 @@ class TestLoadAuthMethod(unit.BaseTestCase):
self.useFixture(fixtures.MockPatchObject(
importutils, 'import_object', return_value=mock.sentinel.driver))
log_fixture = self.useFixture(fixtures.FakeLogger())
driver = core.load_auth_method(method)
# Loading entrypoint fails
self.assertIn('Direct import of auth plugin', log_fixture.output)
# Import works
self.assertIs(mock.sentinel.driver, driver)
def test_entrypoint_fails_import_fails(self):