diff options
Diffstat (limited to 'tests/unittests/test_handler/test_handler_bootcmd.py')
-rw-r--r-- | tests/unittests/test_handler/test_handler_bootcmd.py | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/tests/unittests/test_handler/test_handler_bootcmd.py b/tests/unittests/test_handler/test_handler_bootcmd.py index 09d4c681..29fc25e4 100644 --- a/tests/unittests/test_handler/test_handler_bootcmd.py +++ b/tests/unittests/test_handler/test_handler_bootcmd.py @@ -3,17 +3,11 @@ from cloudinit.config import cc_bootcmd from cloudinit.sources import DataSourceNone from cloudinit import (distros, helpers, cloud, util) -from cloudinit.tests.helpers import CiTestCase, mock, skipIf +from cloudinit.tests.helpers import CiTestCase, mock, skipUnlessJsonSchema import logging import tempfile -try: - import jsonschema - assert jsonschema # avoid pyflakes error F401: import unused - _missing_jsonschema_dep = False -except ImportError: - _missing_jsonschema_dep = True LOG = logging.getLogger(__name__) @@ -72,7 +66,7 @@ class TestBootcmd(CiTestCase): "Input to shellify was type 'int'. Expected list or tuple.", str(context_manager.exception)) - @skipIf(_missing_jsonschema_dep, "No python-jsonschema dependency") + @skipUnlessJsonSchema() def test_handler_schema_validation_warns_non_array_type(self): """Schema validation warns of non-array type for bootcmd key. @@ -88,7 +82,7 @@ class TestBootcmd(CiTestCase): self.logs.getvalue()) self.assertIn('Failed to shellify', self.logs.getvalue()) - @skipIf(_missing_jsonschema_dep, 'No python-jsonschema dependency') + @skipUnlessJsonSchema() def test_handler_schema_validation_warns_non_array_item_type(self): """Schema validation warns of non-array or string bootcmd items. |