# flake8: noqa
import pytest
+import yaml
from ceph.deployment import drive_selection, translate
from ceph.deployment.inventory import Device
assert all([isinstance(x, Device) for x in dg.data_devices.paths])
assert dg.data_devices.paths[0].path == '/dev/sda'
-
-def test_DriveGroup_fail():
+@pytest.mark.parametrize("test_input",
+[
+ (
+ {}
+ ),
+ (
+ yaml.safe_load("""
+service_type: osd
+service_id: mydg
+placement:
+ host_pattern: '*'
+data_devices:
+ limit: 1
+""")
+ )
+])
+def test_DriveGroup_fail(test_input):
with pytest.raises(ServiceSpecValidationError):
- DriveGroupSpec.from_json({})
+ DriveGroupSpec.from_json(test_input)
+
def test_drivegroup_pattern():
mypy==0.770; python_version >= '3'
pytest-mypy; python_version >= '3'
pytest >= 2.1.3; python_version >= '3'
+pyyaml
\ No newline at end of file