Use ToggleLazy fixture from oslo.i18n
Use the ToggleLazy fixture from oslo.i18n instead of managing the internal flag ourselves. Change-Id: I5d4ec87e84c95050587e436a42727d428ab01408
This commit is contained in:
parent
fd2997e347
commit
bc6477ab79
@ -18,8 +18,8 @@ Unit tests for classes to invoke VMware VI SOAP calls.
|
||||
"""
|
||||
|
||||
import mock
|
||||
from oslo_i18n import fixture as i18n_fixture
|
||||
|
||||
from oslo import i18n
|
||||
from oslo.vmware._i18n import _
|
||||
from oslo.vmware import exceptions
|
||||
from oslo.vmware import vim
|
||||
@ -34,12 +34,7 @@ class VimTest(base.TestCase):
|
||||
patcher = mock.patch('suds.client.Client')
|
||||
self.addCleanup(patcher.stop)
|
||||
self.SudsClientMock = patcher.start()
|
||||
back_use_lazy = i18n._lazy.USE_LAZY
|
||||
i18n.enable_lazy()
|
||||
self.addCleanup(self._restore_use_lazy, back_use_lazy)
|
||||
|
||||
def _restore_use_lazy(self, back_use_lazy):
|
||||
i18n._lazy.USE_LAZY = back_use_lazy
|
||||
self.useFixture(i18n_fixture.ToggleLazy(True))
|
||||
|
||||
@mock.patch.object(vim.Vim, '__getattr__', autospec=True)
|
||||
def test_service_content(self, getattr_mock):
|
||||
|
Loading…
x
Reference in New Issue
Block a user