summaryrefslogtreecommitdiff
path: root/oslo_i18n
diff options
context:
space:
mode:
authorJames Carey <jecarey@us.ibm.com>2015-01-19 20:17:06 +0000
committerJames Carey <jecarey@us.ibm.com>2015-01-19 20:28:44 +0000
commitd9b3ca60a7fc3a61c27d0acc54b8222c7bddf9f5 (patch)
tree9331736bba3bceb56ab6664d29025679bdf51c90 /oslo_i18n
parente9340090fa106447a41fbf382e641276a7c3883c (diff)
downloadoslo-i18n-d9b3ca60a7fc3a61c27d0acc54b8222c7bddf9f5.tar.gz
Clear global cache in test_get_available_languages1.3.1
The test_get_available_languages test assumes that get_available_languages() has not been called prior to the test. That is, it assumes that the global variable _gettextutils._AVAILABLE_LANGUAGES does not already have a domain's languages cached in it. This causes problems if another test case uses get_available_languages(). In order to properly isolate this test case, it is updated to clear the cache prior to testing. Change-Id: Ie04d7d98b51f4cc3cc9f0eda69425349e0801d6f
Diffstat (limited to 'oslo_i18n')
-rw-r--r--oslo_i18n/tests/test_gettextutils.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/oslo_i18n/tests/test_gettextutils.py b/oslo_i18n/tests/test_gettextutils.py
index f433700..6f0d5c5 100644
--- a/oslo_i18n/tests/test_gettextutils.py
+++ b/oslo_i18n/tests/test_gettextutils.py
@@ -103,6 +103,9 @@ class GettextTest(test_base.BaseTestCase):
return None
self.stubs.Set(gettext, 'find', _mock_gettext_find)
+ # Ensure that no domains are cached
+ _gettextutils._AVAILABLE_LANGUAGES = {}
+
# en_US should always be available no matter the domain
# and it should also always be the first element since order matters
domain_1_languages = _gettextutils.get_available_languages('domain_1')