Clear global cache in test_get_available_languages
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
This commit is contained in:
parent
e9340090fa
commit
d9b3ca60a7
|
@ -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')
|
||||
|
|
Loading…
Reference in New Issue