summaryrefslogtreecommitdiff
path: root/tests/unittests/test_handler
diff options
context:
space:
mode:
authorJoshua Harlow <harlowja@yahoo-inc.com>2014-10-10 17:44:57 -0700
committerJoshua Harlow <harlowja@yahoo-inc.com>2014-10-10 17:44:57 -0700
commit28d09d73651772ed6c95e67f24e0a04488e79bd5 (patch)
tree22fae11fc38d1fbb64018f933aaf9dbef7cae44b /tests/unittests/test_handler
parentb8417c1af4a147240ec5919c2378fcc3e97078f7 (diff)
downloadvyos-cloud-init-28d09d73651772ed6c95e67f24e0a04488e79bd5.tar.gz
vyos-cloud-init-28d09d73651772ed6c95e67f24e0a04488e79bd5.zip
Add a few template delete tests
Diffstat (limited to 'tests/unittests/test_handler')
-rw-r--r--tests/unittests/test_handler/test_handler_chef.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/unittests/test_handler/test_handler_chef.py b/tests/unittests/test_handler/test_handler_chef.py
index 5562d18a..de7ff2da 100644
--- a/tests/unittests/test_handler/test_handler_chef.py
+++ b/tests/unittests/test_handler/test_handler_chef.py
@@ -82,3 +82,22 @@ class TestChef(t_help.FilesystemMockingTestCase):
'run_list': ['a', 'b', 'c'],
'c': 'd',
}, json.loads(c))
+
+ def test_template_deletes(self):
+ tpl_file = util.load_file('templates/chef_client.rb.tmpl')
+ self.patchUtils(self.tmp)
+ self.patchOS(self.tmp)
+
+ util.write_file('/etc/cloud/templates/chef_client.rb.tmpl', tpl_file)
+ cfg = {
+ 'chef': {
+ 'server_url': 'localhost',
+ 'validation_name': 'bob',
+ 'json_attribs': None,
+ 'show_time': None,
+ },
+ }
+ cc_chef.handle('chef', cfg, self.fetch_cloud('ubuntu'), LOG, [])
+ c = util.load_file(cc_chef.CHEF_RB_PATH)
+ self.assertNotIn('json_attribs', c)
+ self.assertNotIn('Formatter.show_time', c)