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()
|
||||
reply = r.json()
|
||||
assert reply == [
|
||||
{
|
||||
'kind': 'group',
|
||||
'name': 'alphaflight',
|
||||
'users': [],
|
||||
'roles': [],
|
||||
'properties': {},
|
||||
},
|
||||
{
|
||||
'kind': 'group',
|
||||
'name': 'betaflight',
|
||||
'users': [],
|
||||
'roles': [],
|
||||
'properties': {},
|
||||
},
|
||||
{'kind': 'group', 'name': 'alphaflight', 'users': [], 'roles': [], 'properties':{}},
|
||||
{'kind': 'group', 'name': 'betaflight', 'users': [], 'roles': [], 'properties':{}},
|
||||
]
|
||||
|
||||
# Test offset for pagination
|
||||
@@ -1715,15 +1703,7 @@ async def test_groups_list(app):
|
||||
r.raise_for_status()
|
||||
reply = r.json()
|
||||
assert r.status_code == 200
|
||||
assert reply == [
|
||||
{
|
||||
'kind': 'group',
|
||||
'name': 'betaflight',
|
||||
'users': [],
|
||||
'roles': [],
|
||||
'properties': {},
|
||||
}
|
||||
]
|
||||
assert reply == [{'kind': 'group', 'name': 'betaflight', 'users': [], 'roles': [],'properties':{}}]
|
||||
|
||||
r = await api_request(app, "groups?offset=10")
|
||||
r.raise_for_status()
|
||||
@@ -1735,29 +1715,13 @@ async def test_groups_list(app):
|
||||
r.raise_for_status()
|
||||
reply = r.json()
|
||||
assert r.status_code == 200
|
||||
assert reply == [
|
||||
{
|
||||
'kind': 'group',
|
||||
'name': 'alphaflight',
|
||||
'users': [],
|
||||
'roles': [],
|
||||
'properties': {},
|
||||
}
|
||||
]
|
||||
assert reply == [{'kind': 'group', 'name': 'alphaflight', 'users': [], 'roles': [],'properties':{}}]
|
||||
|
||||
# 0 is rounded up to 1
|
||||
r = await api_request(app, "groups?limit=0")
|
||||
r.raise_for_status()
|
||||
reply = r.json()
|
||||
assert reply == [
|
||||
{
|
||||
'kind': 'group',
|
||||
'name': 'alphaflight',
|
||||
'users': [],
|
||||
'roles': [],
|
||||
'properties': {},
|
||||
}
|
||||
]
|
||||
assert reply == [{'kind': 'group', 'name': 'alphaflight', 'users': [], 'roles': [],'properties':{}}]
|
||||
|
||||
|
||||
@mark.group
|
||||
|
@@ -568,9 +568,9 @@ async def test_load_roles_services(tmpdir, request, preserve_scopes):
|
||||
async def test_load_roles_groups(tmpdir, request):
|
||||
"""Test loading predefined roles for groups in app.py"""
|
||||
groups_to_load = {
|
||||
'group1': ['gandalf'],
|
||||
'group2': ['bilbo', 'gargamel'],
|
||||
'group3': ['cyclops'],
|
||||
'group1':{'users': ['gandalf'], 'properties': {}},
|
||||
'group2':{'users':['bilbo', 'gargamel'], 'properties': {}},
|
||||
'group3':{'users': ['cyclops'], 'properties': {}},
|
||||
}
|
||||
roles_to_load = [
|
||||
{
|
||||
|
Reference in New Issue
Block a user