async def test_share_codes_api_server_required(app, user, method):
    """test methods defined on /share-codes/:user/:server not defined on /share-codes/:user"""
    r = await api_request(app, f"/share-codes/{user.name}", method=method)
    assert r.status_code == 405
test methods defined on /share-codes/:user/:server not defined on /share-codes/:user
jupyterhub/tests/test_shares.py