mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
Skip test if no charmaps are found
The "loacle -m" command might not return an error, but it might just be empty. Let's not fail on a test that we're already logging to the user.
This commit is contained in:
parent
7efebc9f78
commit
3dc93be6f6
@ -34,11 +34,15 @@ class LocaleModuleTest(ModuleCase):
|
||||
# call gen_locale. We log this error to the user in the function, but
|
||||
# we don't want to fail this test if this is missing on the test system.
|
||||
char_maps = self.run_function('cmd.run_all', ['locale -m'])
|
||||
if char_maps['stdout'] == '':
|
||||
self.skipTest('locale charmaps not available. Skipping test.')
|
||||
|
||||
err_msg = 'cannot read character map directory'
|
||||
if char_maps['retcode'] != 0 and err_msg in char_maps['stderr']:
|
||||
self.skipTest('{0}. Cannot generate locale. Skipping test.'.format(
|
||||
char_maps['stderr'])
|
||||
)
|
||||
|
||||
locale = self.run_function('locale.get_locale')
|
||||
new_locale = _find_new_locale(locale)
|
||||
ret = self.run_function('locale.gen_locale', [new_locale])
|
||||
|
Loading…
Reference in New Issue
Block a user