summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2018-06-08 23:43:43 +0000
committerGerrit Code Review <review@openstack.org>2018-06-08 23:43:43 +0000
commit133edc9a585600ada699463c0b6a56ef23720fe5 (patch)
tree6a03e1ee081827626c46ea3fe1a54e4022afb9c4
parentd9ae7b51509e163409c3af49179a34c4456c9e34 (diff)
parentfe3e09af2accaf6924fc42b9df6ae5c99a005056 (diff)
downloadoslo-i18n-133edc9a585600ada699463c0b6a56ef23720fe5.tar.gz
Merge "Remove moxstubout usage"
-rw-r--r--oslo_i18n/tests/test_gettextutils.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/oslo_i18n/tests/test_gettextutils.py b/oslo_i18n/tests/test_gettextutils.py
index a2531b0..b38d0f1 100644
--- a/oslo_i18n/tests/test_gettextutils.py
+++ b/oslo_i18n/tests/test_gettextutils.py
@@ -86,10 +86,12 @@ class GettextTest(test_base.BaseTestCase):
# test that here too
return ['zh', 'es', 'nl', 'fr', 'zh_Hant', 'zh_Hant_HK', 'fil']
- self.stubs.Set(localedata,
- 'list' if hasattr(localedata, 'list')
- else 'locale_identifiers',
- _mock_locale_identifiers)
+ mock_patcher = mock.patch.object(localedata,
+ 'list' if hasattr(localedata, 'list')
+ else 'locale_identifiers',
+ _mock_locale_identifiers)
+ mock_patcher.start()
+ self.addCleanup(mock_patcher.stop)
# Only the languages available for a specific translation domain
def _mock_gettext_find(domain, localedir=None, languages=None, all=0):
@@ -101,7 +103,9 @@ class GettextTest(test_base.BaseTestCase):
return 'translation-file' if any(x in ['fr', 'zh_Hant']
for x in languages) else None
return None
- self.stubs.Set(gettext, 'find', _mock_gettext_find)
+ mock_patcher = mock.patch.object(gettext, 'find', _mock_gettext_find)
+ mock_patcher.start()
+ self.addCleanup(mock_patcher.stop)
# Ensure that no domains are cached
_gettextutils._AVAILABLE_LANGUAGES = {}