def custom_hook(dct): if 'key' in dct: return HTTPSModel.from_dict(dct) elif 'error' in dct: return WazuhResult.decode_json({'result': dct, 'str_priority': 'v2'}) else: return dct
def test_results_WazuhResult_decode_json(get_wazuh_result): """Test class method `decode_json` from `WazuhResult`.""" wazuh_result = get_wazuh_result decoded_result = WazuhResult.decode_json(wazuh_result.to_dict()) assert decoded_result == wazuh_result