update tests

This commit is contained in:
vpopescu
2022-08-04 16:16:39 +02:00
2 changed files with 9 additions and 45 deletions

View File

@@ -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
@@ -1800,7 +1764,7 @@ async def test_group_get(app):
'name': 'alphaflight',
'users': ['sasquatch'],
'roles': [],
'properties': {},
'properties':{},
}

View File

@@ -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 = [
{