This repository has been archived by the owner on Jan 20, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
82 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/usr/bin/env python | ||
# -*- coding:utf-8 -*- | ||
# @Author: Jialiang Shi | ||
import logging | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
def test_search_tasks(sonar_client): | ||
component = "shijl0925_python-gerrit-api" | ||
tasks = sonar_client.ce.search_tasks( | ||
component=component, status="IN_PROGRESS,SUCCESS,FAILED,CANCELED", p=1, ps=10 | ||
) | ||
|
||
assert len(tasks.get("tasks")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,4 +13,3 @@ def test_search_issues(sonar_client): | |
) | ||
|
||
assert len(res.get("issues")) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/usr/bin/env python | ||
# -*- coding:utf-8 -*- | ||
# @Author: Jialiang Shi | ||
import logging | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
def test_search_projects(sonar_client): | ||
organization = "williamsedmond90" | ||
resp = sonar_client.projects.search_projects(organization=organization) | ||
|
||
projects = [item["key"] for item in resp.get("components", [])] | ||
|
||
assert len(projects) >= 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/usr/bin/env python | ||
# -*- coding:utf-8 -*- | ||
# @Author: Jialiang Shi | ||
import logging | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
def test_search_project_tags(sonar_client): | ||
res = sonar_client.project_tags.search_project_tags() | ||
|
||
assert "tags" in res |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/usr/bin/env python | ||
# -*- coding:utf-8 -*- | ||
# @Author: Jialiang Shi | ||
import logging | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
def test_search_rules(sonar_client): | ||
res = sonar_client.rules.search_rules( | ||
organization="shijl0925", | ||
languages="py" | ||
) | ||
|
||
assert "rules" in res |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/usr/bin/env python | ||
# -*- coding:utf-8 -*- | ||
# @Author: Jialiang Shi | ||
import logging | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
def test_search_users(sonar_client): | ||
res = sonar_client.users.search_users() | ||
assert "users" in res |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/usr/bin/env python | ||
# -*- coding:utf-8 -*- | ||
# @Author: Jialiang Shi | ||
import logging | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
def test_search_user_groups(sonar_client): | ||
res = sonar_client.user_groups.search_user_groups( | ||
organization="shijl0925", | ||
) | ||
|
||
assert "groups" in res |