summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorScott Moser <smoser@brickies.net>2017-07-26 09:08:14 -0400
committerScott Moser <smoser@brickies.net>2017-07-26 11:53:16 -0400
commit80bf98b9c7d5197592c8b3e4edb6b958f8b31453 (patch)
tree13cd86f755dd7aec12c2f8ffb5e347aa035ecddb /tests
parenta31eaa3c2bffddbe97fd2d3139e9dce4de8f38b6 (diff)
downloadvyos-cloud-init-80bf98b9c7d5197592c8b3e4edb6b958f8b31453.tar.gz
vyos-cloud-init-80bf98b9c7d5197592c8b3e4edb6b958f8b31453.zip
tests: adjust locale integration test to parse default locale.
The locale integration test started failing with commit 0ef61b28. This was just because the test's expectations on the content/formatting of /etc/default/locale were too strict. The change here is to read the file as a set of shell variables and assert that the values are set correctly.
Diffstat (limited to 'tests')
-rw-r--r--tests/cloud_tests/testcases/modules/locale.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/cloud_tests/testcases/modules/locale.py b/tests/cloud_tests/testcases/modules/locale.py
index 63e53ff3..cb9e1dce 100644
--- a/tests/cloud_tests/testcases/modules/locale.py
+++ b/tests/cloud_tests/testcases/modules/locale.py
@@ -3,14 +3,17 @@
"""cloud-init Integration Test Verify Script."""
from tests.cloud_tests.testcases import base
+from cloudinit import util
+
class TestLocale(base.CloudTestCase):
"""Test locale is set properly."""
def test_locale(self):
"""Test locale is set properly."""
- out = self.get_data_file('locale_default')
- self.assertIn('LANG="en_GB.UTF-8"', out)
+ data = util.load_shell_content(self.get_data_file('locale_default'))
+ self.assertIn("LANG", data)
+ self.assertEqual('en_GB.UTF-8', data['LANG'])
def test_locale_a(self):
"""Test locale -a has both options."""