mock_test_method,
                200,
            ),
            (
                {
                    "jsonrpc": "2.0",
                    "method": TEST_METHOD_NAME,
                    "params": json.dumps(BaseSerialization.serialize({"dag_id": 15, "task_id": "fake-task"})),
                },
                ("dag_id_15", "fake-task", 1),
                {"dag_id": 15, "task_id": "fake-task"},
                mock_test_method,
                200,
            ),
        ],
    )
    def test_method(self, input_data, method_result, method_params, expected_mock, expected_code):
        if method_result:
            expected_mock.return_value = method_result
        response = self.client.post(
            "/internal_api/v1/rpcapi",
            headers={"Content-Type": "application/json"},
            data=json.dumps(input_data),
        )
        assert response.status_code == expected_code
        if method_result:
            response_data = BaseSerialization.deserialize(json.loads(response.data))
            assert response_data == method_result
        expected_mock.assert_called_once_with(**method_params)
    def test_method_with_exception(self):