summaryrefslogtreecommitdiff
path: root/tests/unittests/test_handler/test_handler_chef.py
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2015-02-10 20:32:32 +0000
committerScott Moser <smoser@ubuntu.com>2015-02-10 20:32:32 +0000
commita4a6702758cf60ecb8742d78e576733dbbdbb9a0 (patch)
treeb5f23eff4f9c7e87fe2b09cdbe1d1b38aa518929 /tests/unittests/test_handler/test_handler_chef.py
parent888db3e6bb9076973d2f6a73e0c4f691caa89603 (diff)
downloadvyos-cloud-init-a4a6702758cf60ecb8742d78e576733dbbdbb9a0.tar.gz
vyos-cloud-init-a4a6702758cf60ecb8742d78e576733dbbdbb9a0.zip
make bddeb work with python3 or python2
painful, and not perfect, but at this point the output builds on a vivid system python2 (bddeb --python2) or python3. * remove use of cheetah by bddeb in favor of builtin renderer * add '--python2' flag to bddeb and knowledge of python 2 and python3 package names. * read-dependencies can now read test-requirements also. * differenciate from build-requirements and runtime requirements.
Diffstat (limited to 'tests/unittests/test_handler/test_handler_chef.py')
-rw-r--r--tests/unittests/test_handler/test_handler_chef.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/unittests/test_handler/test_handler_chef.py b/tests/unittests/test_handler/test_handler_chef.py
index 8ab27911..edad88cb 100644
--- a/tests/unittests/test_handler/test_handler_chef.py
+++ b/tests/unittests/test_handler/test_handler_chef.py
@@ -18,6 +18,8 @@ import tempfile
LOG = logging.getLogger(__name__)
+CLIENT_TEMPL = os.path.sep.join(["templates", "chef_client.rb.tmpl"])
+
class TestChef(t_help.FilesystemMockingTestCase):
def setUp(self):
@@ -41,9 +43,13 @@ class TestChef(t_help.FilesystemMockingTestCase):
for d in cc_chef.CHEF_DIRS:
self.assertFalse(os.path.isdir(d))
+ @t_help.skipIf(not os.path.isfile(CLIENT_TEMPL),
+ CLIENT_TEMPL + " is not available")
def test_basic_config(self):
- # This should create a file of the format...
"""
+ test basic config looks sane
+
+ # This should create a file of the format...
# Created by cloud-init v. 0.7.6 on Sat, 11 Oct 2014 23:57:21 +0000
log_level :info
ssl_verify_mode :verify_none
@@ -105,6 +111,8 @@ class TestChef(t_help.FilesystemMockingTestCase):
'c': 'd',
}, json.loads(c))
+ @t_help.skipIf(not os.path.isfile(CLIENT_TEMPL),
+ CLIENT_TEMPL + " is not available")
def test_template_deletes(self):
tpl_file = util.load_file('templates/chef_client.rb.tmpl')
self.patchUtils(self.tmp)