summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDoug Hellmann <doug@doughellmann.com>2015-01-08 14:39:40 -0500
committerDoug Hellmann <doug@doughellmann.com>2015-01-08 14:39:40 -0500
commitbc6477ab79b8a7ffb9e46dfcf1df92c9c9aa9b2f (patch)
tree10af8fd857466cbfa89ae14baa321ebb2dab63d6
parentfd2997e347f117a40319798ad1f9343f0035d15f (diff)
downloadoslo-vmware-bc6477ab79b8a7ffb9e46dfcf1df92c9c9aa9b2f.tar.gz
Use ToggleLazy fixture from oslo.i18n
Use the ToggleLazy fixture from oslo.i18n instead of managing the internal flag ourselves. Change-Id: I5d4ec87e84c95050587e436a42727d428ab01408
-rw-r--r--tests/test_vim.py9
1 files changed, 2 insertions, 7 deletions
diff --git a/tests/test_vim.py b/tests/test_vim.py
index 4b832bd..0c8aa51 100644
--- a/tests/test_vim.py
+++ b/tests/test_vim.py
@@ -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):