def request_url_from_request_mock(reqmock):
    """Given responses.RequestsMock, get URL of first recorded request

    Utility method for asserting that the correct URL was generated. Fails
    if more than one request was made against the RequestMock.
    """
    assert len(reqmock.calls) == 1
    request, _ = reqmock.calls[0]
    return request.url