示例#1
0
def get_group_info(groupname):
    """
    Retrieve the information regarding the
    buckets created within a project.
    Returns a json object.
    """
    return jsonify(admin.get_group_info(current_session, groupname))
示例#2
0
def test_get_group(db_session, awg_users):
    info = adm.get_group_info(db_session, "test_group_2")
    assert info["name"] == "test_group_2"
    assert info["description"] == "the second test group"
    expected_projects = ["test_project_1", "test_project_2"]
    expected_projects.sort()
    info["projects"].sort()
    assert info["projects"] == expected_projects
示例#3
0
def create_group():
    """
    Retrieve the information regarding the
    buckets created within a project.
    Returns a json object.
    """
    groupname = request.get_json().get("name")
    description = request.get_json().get("description")
    grp = admin.create_group(current_session, groupname, description)
    if grp:
        response = admin.get_group_info(current_session, groupname)
    else:
        response = {"result": "group creation failed"}
    response = jsonify(response)
    return response
示例#4
0
def test_get_inexistent_group(db_session, awg_users):
    with pytest.raises(UserError):
        info = adm.get_group_info(db_session, "test_group_XXX")