~ubuntu-branches/ubuntu/wily/python-oslo.vmware/wily-proposed

« back to all changes in this revision

Viewing changes to debian/patches/use-toggle-lazyfixture.patch

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2015-02-09 11:35:16 UTC
  • mfrom: (1.1.7)
  • Revision ID: package-import@ubuntu.com-20150209113516-ybu8v73zi8amrx4b
Tags: 0.9.0-0ubuntu1
* New upstream release.
* Transition new namespace.
* debian/patches/use-toggle-lazyfixture.patch: Dropped
* debian/control: Add python-oslo.concurrency.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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
5
 
 
6
 
Use the ToggleLazy fixture from oslo.i18n instead of managing
7
 
the internal flag ourselves.
8
 
 
9
 
Change-Id: I5d4ec87e84c95050587e436a42727d428ab01408
10
 
---
11
 
 tests/test_vim.py | 9 ++-------
12
 
 1 file changed, 2 insertions(+), 7 deletions(-)
13
 
 
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
18
 
@@ -18,8 +18,8 @@
19
 
 """
20
 
 
21
 
 import mock
22
 
+from oslo_i18n import fixture as i18n_fixture
23
 
 
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
33
 
-        i18n.enable_lazy()
34
 
-        self.addCleanup(self._restore_use_lazy, back_use_lazy)
35
 
-
36
 
-    def _restore_use_lazy(self, back_use_lazy):
37
 
-        i18n._lazy.USE_LAZY = back_use_lazy
38
 
+        self.useFixture(i18n_fixture.ToggleLazy(True))
39
 
 
40
 
     @mock.patch.object(vim.Vim, '__getattr__', autospec=True)
41
 
     def test_service_content(self, getattr_mock):