async def METHOD_NAME():
    class StubResponse:
        real_url = "https://some.url"
        status = http.HTTPStatus.BAD_REQUEST
        headers = {}
        json = mock.AsyncMock(side_effect=aiohttp.ContentTypeError(None, None))
        async def read(self):
            return "some raw body"
    with mock.patch.object(errors, "BadRequestError", errors=None) as error:
        returned = await net.generate_error_response(StubResponse())
    error.assert_called_once_with("https://some.url", {}, "some raw body", errors=None)
    assert returned is error()