def METHOD_NAME():
    url = 'https://localhost/thing/api/v1/hello/world?foo=bar#test'
    assert rest.getApiUrl(url) == 'https://localhost/thing/api/v1'
    parts = rest.getUrlParts(url)
    assert parts.path == '/thing/api/v1/hello/world'
    assert rest.getApiUrl(parts.path) == '/thing/api/v1'
    assert parts.port is None
    assert parts.hostname == 'localhost'
    assert parts.query == 'foo=bar'
    assert parts.fragment == 'test'
    url = 'https://localhost/girder#users'
    with pytest.raises(GirderException, match='Could not determine API root in %s.$' % url):
        rest.getApiUrl(url)