:param json_spec: A valid dict with ServiceSpec
"""
+ if not isinstance(json_spec, dict):
+ raise ServiceSpecValidationError(
+ f'Service Spec is not an (JSON or YAML) object. got "{str(json_spec)}"')
+
c = json_spec.copy()
# kludge to make `from_json` compatible to `Orchestrator.describe_service`
# flake8: noqa
+import re
+
import pytest
import yaml
@pytest.mark.parametrize("match,test_input",
[
+ (
+ re.escape('Service Spec is not an (JSON or YAML) object. got "None"'),
+ ''
+ ),
(
"Failed to validate Drive Group: OSD spec needs a `placement` key.",
'{}'