summaryrefslogtreecommitdiff
path: root/tests/unittests/test_handler/test_handler_locale.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unittests/test_handler/test_handler_locale.py')
-rw-r--r--tests/unittests/test_handler/test_handler_locale.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/tests/unittests/test_handler/test_handler_locale.py b/tests/unittests/test_handler/test_handler_locale.py
index e9a810c5..aaf6c762 100644
--- a/tests/unittests/test_handler/test_handler_locale.py
+++ b/tests/unittests/test_handler/test_handler_locale.py
@@ -49,9 +49,15 @@ class TestLocale(t_help.FilesystemMockingTestCase):
}
cc = self._get_cloud('sles')
cc_locale.handle('cc_locale', cfg, cc, LOG, [])
-
- contents = util.load_file('/etc/sysconfig/language', decode=False)
+ if cc.distro.uses_systemd:
+ locale_conf = cc.distro.systemd_locale_conf_fn
+ else:
+ locale_conf = cc.distro.locale_conf_fn
+ contents = util.load_file(locale_conf, decode=False)
n_cfg = ConfigObj(BytesIO(contents))
- self.assertEqual({'RC_LANG': cfg['locale']}, dict(n_cfg))
+ if cc.distro.uses_systemd():
+ self.assertEqual({'LANG': cfg['locale']}, dict(n_cfg))
+ else:
+ self.assertEqual({'RC_LANG': cfg['locale']}, dict(n_cfg))
# vi: ts=4 expandtab