diff options
author | Joshua Harlow <harlowja@yahoo-inc.com> | 2012-09-24 20:33:13 -0700 |
---|---|---|
committer | Joshua Harlow <harlowja@yahoo-inc.com> | 2012-09-24 20:33:13 -0700 |
commit | a2c6279d303a3b85625404653c7ab8081281ee18 (patch) | |
tree | 5093c33ffff091cc3e08d1b522d3de3a58cc6c60 /tests | |
parent | 90b6cfd005f5af90991fe93e5a08c8a8849e2a6d (diff) | |
download | vyos-cloud-init-a2c6279d303a3b85625404653c7ab8081281ee18.tar.gz vyos-cloud-init-a2c6279d303a3b85625404653c7ab8081281ee18.zip |
Handle the case where 'user' is defined but 'users' isn't.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unittests/test_distros/test_user_data_normalize.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/unittests/test_distros/test_user_data_normalize.py b/tests/unittests/test_distros/test_user_data_normalize.py index 4a4e1a29..890d8f05 100644 --- a/tests/unittests/test_distros/test_user_data_normalize.py +++ b/tests/unittests/test_distros/test_user_data_normalize.py @@ -174,6 +174,16 @@ class TestUGNormalize(MockerTestCase): self.assertIn('bob', users) self.assertIn('joe', users) self.assertIn('zetta', users) + ug_cfg = { + 'user': 'zetta', + } + (users, _groups) = self._norm(ug_cfg, distro) + self.assertIn('zetta', users) + ug_cfg = { + } + (users, groups) = self._norm(ug_cfg, distro) + self.assertEquals({}, users) + self.assertEquals({}, groups) def test_users_dict_default_additional(self): distro = self._make_distro('ubuntu', 'bob') |