[ Web Proxy ]
URL:
Viewing: https://raw.githubusercontent.com/xuhdev/python-gitlab/docker/tests/functional/api/test_groups.py [Back]  [Original]

import pytest

import gitlab


def test_groups(gl):
    # TODO: This one still needs lots of work
    user = gl.users.create(
        {
            "email": "user@test.com",
            "username": "user",
            "name": "user",
            "password": "user_pass",
        }
    )
    user2 = gl.users.create(
        {
            "email": "user2@test.com",
            "username": "user2",
            "name": "user2",
            "password": "user2_pass",
        }
    )
    group1 = gl.groups.create(
        {"name": "gitlab-test-group1", "path": "gitlab-test-group1"}
    )
    group2 = gl.groups.create(
        {"name": "gitlab-test-group2", "path": "gitlab-test-group2"}
    )

    p_id = gl.groups.list(search="gitlab-test-group2")[0].id
    group3 = gl.groups.create(
        {"name": "gitlab-test-group3", "path": "gitlab-test-group3", "parent_id": p_id}
    )
    group4 = gl.groups.create(
        {"name": "gitlab-test-group4", "path": "gitlab-test-group4"}
    )

    assert {group1, group2, group3, group4} 

Web Proxy Viewer  |  New URL  |  Original Page