mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
fix failing unit test
Reload the locales module to discard the memoization of get_encodings()
This commit is contained in:
parent
24343645c3
commit
63531c2a3d
@ -11,12 +11,14 @@ from salttesting.mock import patch, NO_MOCK, NO_MOCK_REASON
|
||||
# salt libs
|
||||
ensure_in_syspath('../../')
|
||||
import salt.ext.six as six
|
||||
from salt.ext.six.moves import reload_module
|
||||
from salt.utils import locales
|
||||
|
||||
|
||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
||||
class TestLocales(TestCase):
|
||||
def test_get_encodings(self):
|
||||
reload_module(locales) # defeat memoization of get_encodings()
|
||||
with patch('sys.getdefaultencoding', return_value='xyzzy'):
|
||||
encodings = locales.get_encodings()
|
||||
for enc in (__salt_system_encoding__, 'xyzzy', 'utf-8', 'latin-1'):
|
||||
|
Loading…
Reference in New Issue
Block a user