mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-18 15:33:02 +00:00
update tests
This commit is contained in:
@@ -1694,20 +1694,8 @@ async def test_groups_list(app):
|
|||||||
r.raise_for_status()
|
r.raise_for_status()
|
||||||
reply = r.json()
|
reply = r.json()
|
||||||
assert reply == [
|
assert reply == [
|
||||||
{
|
{'kind': 'group', 'name': 'alphaflight', 'users': [], 'roles': [], 'properties':{}},
|
||||||
'kind': 'group',
|
{'kind': 'group', 'name': 'betaflight', 'users': [], 'roles': [], 'properties':{}},
|
||||||
'name': 'alphaflight',
|
|
||||||
'users': [],
|
|
||||||
'roles': [],
|
|
||||||
'properties': {},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'kind': 'group',
|
|
||||||
'name': 'betaflight',
|
|
||||||
'users': [],
|
|
||||||
'roles': [],
|
|
||||||
'properties': {},
|
|
||||||
},
|
|
||||||
]
|
]
|
||||||
|
|
||||||
# Test offset for pagination
|
# Test offset for pagination
|
||||||
@@ -1715,15 +1703,7 @@ async def test_groups_list(app):
|
|||||||
r.raise_for_status()
|
r.raise_for_status()
|
||||||
reply = r.json()
|
reply = r.json()
|
||||||
assert r.status_code == 200
|
assert r.status_code == 200
|
||||||
assert reply == [
|
assert reply == [{'kind': 'group', 'name': 'betaflight', 'users': [], 'roles': [],'properties':{}}]
|
||||||
{
|
|
||||||
'kind': 'group',
|
|
||||||
'name': 'betaflight',
|
|
||||||
'users': [],
|
|
||||||
'roles': [],
|
|
||||||
'properties': {},
|
|
||||||
}
|
|
||||||
]
|
|
||||||
|
|
||||||
r = await api_request(app, "groups?offset=10")
|
r = await api_request(app, "groups?offset=10")
|
||||||
r.raise_for_status()
|
r.raise_for_status()
|
||||||
@@ -1735,29 +1715,13 @@ async def test_groups_list(app):
|
|||||||
r.raise_for_status()
|
r.raise_for_status()
|
||||||
reply = r.json()
|
reply = r.json()
|
||||||
assert r.status_code == 200
|
assert r.status_code == 200
|
||||||
assert reply == [
|
assert reply == [{'kind': 'group', 'name': 'alphaflight', 'users': [], 'roles': [],'properties':{}}]
|
||||||
{
|
|
||||||
'kind': 'group',
|
|
||||||
'name': 'alphaflight',
|
|
||||||
'users': [],
|
|
||||||
'roles': [],
|
|
||||||
'properties': {},
|
|
||||||
}
|
|
||||||
]
|
|
||||||
|
|
||||||
# 0 is rounded up to 1
|
# 0 is rounded up to 1
|
||||||
r = await api_request(app, "groups?limit=0")
|
r = await api_request(app, "groups?limit=0")
|
||||||
r.raise_for_status()
|
r.raise_for_status()
|
||||||
reply = r.json()
|
reply = r.json()
|
||||||
assert reply == [
|
assert reply == [{'kind': 'group', 'name': 'alphaflight', 'users': [], 'roles': [],'properties':{}}]
|
||||||
{
|
|
||||||
'kind': 'group',
|
|
||||||
'name': 'alphaflight',
|
|
||||||
'users': [],
|
|
||||||
'roles': [],
|
|
||||||
'properties': {},
|
|
||||||
}
|
|
||||||
]
|
|
||||||
|
|
||||||
|
|
||||||
@mark.group
|
@mark.group
|
||||||
@@ -1800,7 +1764,7 @@ async def test_group_get(app):
|
|||||||
'name': 'alphaflight',
|
'name': 'alphaflight',
|
||||||
'users': ['sasquatch'],
|
'users': ['sasquatch'],
|
||||||
'roles': [],
|
'roles': [],
|
||||||
'properties': {},
|
'properties':{},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -568,9 +568,9 @@ async def test_load_roles_services(tmpdir, request, preserve_scopes):
|
|||||||
async def test_load_roles_groups(tmpdir, request):
|
async def test_load_roles_groups(tmpdir, request):
|
||||||
"""Test loading predefined roles for groups in app.py"""
|
"""Test loading predefined roles for groups in app.py"""
|
||||||
groups_to_load = {
|
groups_to_load = {
|
||||||
'group1': ['gandalf'],
|
'group1':{'users': ['gandalf'], 'properties': {}},
|
||||||
'group2': ['bilbo', 'gargamel'],
|
'group2':{'users':['bilbo', 'gargamel'], 'properties': {}},
|
||||||
'group3': ['cyclops'],
|
'group3':{'users': ['cyclops'], 'properties': {}},
|
||||||
}
|
}
|
||||||
roles_to_load = [
|
roles_to_load = [
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user