1
From bc6477ab79b8a7ffb9e46dfcf1df92c9c9aa9b2f Mon Sep 17 00:00:00 2001
2
From: Doug Hellmann <doug@doughellmann.com>
3
Date: Thu, 8 Jan 2015 14:39:40 -0500
4
Subject: [PATCH] Use ToggleLazy fixture from oslo.i18n
6
Use the ToggleLazy fixture from oslo.i18n instead of managing
7
the internal flag ourselves.
9
Change-Id: I5d4ec87e84c95050587e436a42727d428ab01408
11
tests/test_vim.py | 9 ++-------
12
1 file changed, 2 insertions(+), 7 deletions(-)
14
diff --git a/tests/test_vim.py b/tests/test_vim.py
15
index 4b832bd..0c8aa51 100644
16
--- a/tests/test_vim.py
17
+++ b/tests/test_vim.py
22
+from oslo_i18n import fixture as i18n_fixture
24
-from oslo import i18n
25
from oslo.vmware._i18n import _
26
from oslo.vmware import exceptions
27
from oslo.vmware import vim
28
@@ -34,12 +34,7 @@ def setUp(self):
29
patcher = mock.patch('suds.client.Client')
30
self.addCleanup(patcher.stop)
31
self.SudsClientMock = patcher.start()
32
- back_use_lazy = i18n._lazy.USE_LAZY
34
- self.addCleanup(self._restore_use_lazy, back_use_lazy)
36
- def _restore_use_lazy(self, back_use_lazy):
37
- i18n._lazy.USE_LAZY = back_use_lazy
38
+ self.useFixture(i18n_fixture.ToggleLazy(True))
40
@mock.patch.object(vim.Vim, '__getattr__', autospec=True)
41
def test_service_content(self, getattr_mock):