Skip to content

Commit

Permalink
Fixed verbose output.
Browse files Browse the repository at this point in the history
  • Loading branch information
Knucklessg1 committed Nov 6, 2024
1 parent 39c38f0 commit f9118dd
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 56 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
requests>=2.8.1
urllib3>=2.2.2
pydantic[email]>=2.8.2
SQLAlchemy>=2.0.36
SQLAlchemy>=2.0.36
110 changes: 55 additions & 55 deletions test/test_gitlab_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,63 +24,63 @@
client = gitlab_api.Api(url=gitlab_url, token=token, verify=False)


# @pytest.mark.skipif(
# sys.platform in ["darwin"] or skip,
# reason=reason,
# )
# def test_get_nested_projects():
# # Get nested projects
# group_id = 2
# projects = client.get_nested_projects_by_group(group_id=group_id, per_page=3)
# assert len(projects.data) > 0
# assert isinstance(projects.data, list)
# group_id = 6
# projects = client.get_nested_projects_by_group(group_id=group_id, per_page=3)
# assert len(projects.data) > 0
# assert isinstance(projects.data, list)
#
#
# @pytest.mark.skipif(
# sys.platform in ["darwin"] or skip,
# reason=reason,
# )
# def test_create_branch():
# # Create branch
# project = 79
# response = client.create_branch(
# project_id=project, branch="test_branch", reference="main"
# )
# assert response.status_code == 201 or response.status_code == 400
#
#
# @pytest.mark.skipif(
# sys.platform in ["darwin"] or skip,
# reason=reason,
# )
# def test_create_project_rule():
# # Create branch
# project = 79
# response = client.create_project_level_rule(
# project_id=project, name="Test_Rule", approvals_required=9
# )
# assert response.status_code == 201
#
#
# @pytest.mark.skipif(
# sys.platform in ["darwin"] or skip,
# reason=reason,
# )
# def test_get_project_rules():
# # Create branch
# project = 79
# response = client.get_project_level_rules(project_id=project)
# assert response.status_code == 200
@pytest.mark.skipif(
sys.platform in ["darwin"] or skip,
reason=reason,
)
def test_get_nested_projects():
# Get nested projects
group_id = 2
projects = client.get_nested_projects_by_group(group_id=group_id, per_page=3)
assert len(projects.data) > 0
assert isinstance(projects.data, list)
group_id = 6
projects = client.get_nested_projects_by_group(group_id=group_id, per_page=3)
assert len(projects.data) > 0
assert isinstance(projects.data, list)


@pytest.mark.skipif(
sys.platform in ["darwin"] or skip,
reason=reason,
)
def test_create_branch():
# Create branch
project = 79
response = client.create_branch(
project_id=project, branch="test_branch", reference="main"
)
assert response.status_code == 201 or response.status_code == 400


@pytest.mark.skipif(
sys.platform in ["darwin"] or skip,
reason=reason,
)
def test_create_project_rule():
# Create branch
project = 79
response = client.create_project_level_rule(
project_id=project, name="Test_Rule", approvals_required=9
)
assert response.status_code == 201


@pytest.mark.skipif(
sys.platform in ["darwin"] or skip,
reason=reason,
)
def test_get_project_rules():
# Create branch
project = 79
response = client.get_project_level_rules(project_id=project)
assert response.status_code == 200


@pytest.mark.skipif(
sys.platform in ["darwin"] or skip,
reason=reason,
)
def test_edit_group():
# Get nested projects
group_id = 6
Expand All @@ -89,8 +89,8 @@ def test_edit_group():


if __name__ == "__main__":
# test_get_nested_projects()
# test_create_branch()
# test_create_project_rule()
# test_get_project_rules()
test_get_nested_projects()
test_create_branch()
test_create_project_rule()
test_get_project_rules()
test_edit_group()

0 comments on commit f9118dd

Please sign in to comment.