def test_check_routes(app, io_loop):
    proxy = app.proxy
    r = api_request(app, 'users/zoe', method='post')
    r.raise_for_status()
    r = api_request(app, 'users/zoe/server', method='post')
    r.raise_for_status()
    zoe = orm.User.find(app.db, 'zoe')
    assert zoe is not None
    zoe = app.users[zoe]
    before = sorted(io_loop.run_sync(app.proxy.get_routes))
    assert zoe.proxy_path in before
    io_loop.run_sync(lambda : app.proxy.check_routes(app.users))
    io_loop.run_sync(lambda : proxy.delete_user(zoe))
    during = sorted(io_loop.run_sync(app.proxy.get_routes))
    assert zoe.proxy_path not in during
    io_loop.run_sync(lambda : app.proxy.check_routes(app.users))
    after = sorted(io_loop.run_sync(app.proxy.get_routes))
    assert zoe.proxy_path in after
    assert before == after
dataset/ETHPy150Open jupyterhub/jupyterhub/jupyterhub/tests/test_proxy.py/test_check_routes/original