def test_discovered_host_labels_from_dict(): label_dict = { u"äbc": { "value": u"123", "plugin_name": "plugin_1", }, u"xyz": { "value": u"blä", "plugin_name": "plugin_2", }, } labels = DiscoveredHostLabels.from_dict(label_dict) assert labels.to_dict() == label_dict
# conditions defined in the file COPYING, which is part of this source code package. import pytest # type: ignore[import] from cmk.base.discovered_labels import DiscoveredHostLabels from cmk.base.plugins.agent_based.agent_based_api.v1 import HostLabel, type_defs from cmk.base.plugins.agent_based.utils import ps pytestmark = pytest.mark.checks TEST_LABELS = DiscoveredHostLabels.from_dict({ "marco": { "value": "polo", "plugin_name": None }, "peter": { "value": "pan", "plugin_name": None } }) def test_get_discovery_specs(): assert ps.get_discovery_specs([ { "default_params": { 'cpu_rescale_max': 'cpu_rescale_max_unspecified' }, "descr": "smss", "match": "~smss.exe" },