fix unit tests

This commit is contained in:
Michael Calmer 2017-05-19 13:28:52 +02:00
parent 428baa9bce
commit f30f5c8a25

View File

@ -44,6 +44,7 @@ class LocalemodTestCase(TestCase):
Test for Get the current system locale
'''
with patch.dict(localemod.__context__, {'salt.utils.systemd.booted': True}):
with patch.dict(localemod.__grains__, {'os_family': ['Unknown']}):
localemod.HAS_DBUS = True
with patch.object(localemod,
'_parse_dbus_locale',
@ -82,6 +83,7 @@ class LocalemodTestCase(TestCase):
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'))