예제 #1
0
 def deserialize(cls, serialized: Mapping[str,
                                          Any]) -> "SNMPPluginStoreItem":
     return cls(
         [BackendSNMPTree.from_json(tree) for tree in serialized["trees"]],
         SNMPDetectSpec.from_json(serialized["detect_spec"]),
         serialized["inventory"],
     )
예제 #2
0
파일: snmp.py 프로젝트: xorsiz0r/checkmk
 def deserialize(cls, serialized: Dict[str, Any]) -> "SNMPPluginStoreItem":
     try:
         return cls(
             [SNMPTree.from_json(tree) for tree in serialized["trees"]],
             SNMPDetectSpec.from_json(serialized["detect_spec"]),
         )
     except (LookupError, TypeError, ValueError) as exc:
         raise ValueError(serialized) from exc
예제 #3
0
 def test_serialization(self, specs):
     assert SNMPDetectSpec.from_json(specs.to_json()) == specs