def test_get_expanded_scopes(db, scopes, expected_scopes):
    """Test role scopes expansion into their fully expanded scopes"""
    roles.create_role(db, {'name': 'testing_scopes', 'scopes': scopes})
    role = orm.Role.find(db, name='testing_scopes')
    expanded_scopes = roles.roles_to_expanded_scopes([role], owner=None)
    assert expanded_scopes == expected_scopes
    db.delete(role)
Test role scopes expansion into their fully expanded scopes
jupyterhub/tests/test_roles.py