mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 17:09:03 +00:00
Remove an old unit test for set_locale
This commit is contained in:
parent
bdff4dc74c
commit
98c5ed8ef6
@ -290,28 +290,6 @@ class LocalemodTestCase(TestCase, LoaderModuleMockMixin):
|
||||
assert not localemod._localectl_set.called
|
||||
assert not localemod.__salt__['file.replace'].called
|
||||
|
||||
def _test_set_locale(self):
|
||||
def test_set_locale(self):
|
||||
'''
|
||||
Test for Sets the current system locale
|
||||
'''
|
||||
with patch.dict(localemod.__context__, {'salt.utils.systemd.booted': True}):
|
||||
with patch.dict(localemod.__grains__, {'os_family': ['Unknown']}):
|
||||
with patch.object(localemod, '_localectl_set', return_value=True):
|
||||
self.assertTrue(localemod.set_locale('l'))
|
||||
|
||||
with patch.dict(localemod.__context__, {'salt.utils.systemd.booted': False}):
|
||||
with patch.dict(localemod.__grains__, {'os_family': ['Gentoo']}):
|
||||
with patch.dict(localemod.__salt__, {'cmd.retcode': MagicMock(return_value='A')}):
|
||||
with patch.object(localemod,
|
||||
'_parse_localectl',
|
||||
return_value={'LANG': 'B'}):
|
||||
self.assertFalse(localemod.set_locale('l'))
|
||||
|
||||
with patch.dict(localemod.__grains__, {'os_family': ['A']}):
|
||||
with patch.dict(localemod.__salt__, {'cmd.retcode': MagicMock(return_value=0)}):
|
||||
with patch('salt.utils.systemd.booted', return_value=False):
|
||||
self.assertRaises(CommandExecutionError, localemod.set_locale, 'A')
|
||||
|
||||
def test_avail(self):
|
||||
'''
|
||||
|
Loading…
Reference in New Issue
Block a user