def test_validate_result_not(): v = Validation(SCHEMA_DIR) method = "hello" result = 123 with pytest.raises(InvalidResultServerError) as irse: v.validate_result(method, result) error_json = irse.value.to_json() assert error_json['name'] == 'JSONRPCError' assert error_json['code'] == -32002 assert error_json['message'] == 'Invalid result' assert error_json['error']['message'] == "123 is not of type 'string'" assert error_json['error']['path'] == 'type' assert error_json['error']['value'] == 'string'
def test_validate_result(): v = Validation(SCHEMA_DIR) method = "hello" result = "hello" v.validate_result(method, result) assert True is True