def test_get_encodings(self): # reload locales modules before and after to defeat memoization of # get_encodings() reload_module(locales) with patch('sys.getdefaultencoding', return_value='xyzzy'): encodings = locales.get_encodings() for enc in (__salt_system_encoding__, 'xyzzy', 'utf-8', 'latin-1'): self.assertIn(enc, encodings) reload_module(locales)
def test_get_encodings(self): # reload locales modules before and after to defeat memoization of # get_encodings() reload_module(locales) with patch("sys.getdefaultencoding", return_value="xyzzy"): encodings = locales.get_encodings() for enc in (__salt_system_encoding__, "xyzzy", "utf-8", "latin-1"): self.assertIn(enc, encodings) reload_module(locales)