Used by Variable/Connection.

https://github.com/apache/airflow/blob/894741e311ffd642e036b80d3b1b5d53c3747cad/airflow/secrets/metastore.py#L32

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_pydantic_serialized_object(self):
        ti = TaskInstance(task=EmptyOperator(task_id="task"), run_id="run_id", state=State.RUNNING)
        mock_test_method.return_value = ti
        response = self.client.post(
            "/internal_api/v1/rpcapi",
            headers={"Content-Type": "application/json"},
            data=json.dumps({"jsonrpc": "2.0", "method": TEST_METHOD_NAME, "params": ""}),
        )
        assert response.status_code == 200
        print(response.data)
        response_data = BaseSerialization.deserialize(json.loads(response.data), use_pydantic_models=True)
        expected_data = TaskInstancePydantic.from_orm(ti)
        assert response_data == expected_data
    def test_method_with_exception(self):