]>
git.proxmox.com Git - ceph.git/blob - ceph/src/python-common/ceph/tests/test_inventory.py
69c1c306cf8015a6ad595a35a9495ae27d814aef
5 from ceph
.deployment
.inventory
import Devices
8 @pytest.mark
.parametrize("filename",
10 os
.path
.dirname(__file__
) + '/c-v-inventory.json',
11 os
.path
.dirname(__file__
) + '/../../../pybind/mgr/test_orchestrator/du'
14 def test_from_json(filename
):
15 with
open(filename
) as f
:
17 if 'inventory' in data
:
18 data
= data
['inventory']
19 ds
= Devices
.from_json(data
)
20 assert len(ds
.devices
) == len(data
)
21 assert Devices
.from_json(ds
.to_json()) == ds