-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36 from RedHatProductSecurity/staging
Merge staging to main
- Loading branch information
Showing
11 changed files
with
517 additions
and
304 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
Large diffs are not rendered by default.
Oops, something went wrong.
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
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 |
---|---|---|
|
@@ -33,6 +33,7 @@ | |
[ | ||
"https://gitlab.com/owner/repo", | ||
"https://gitlab.com/owner/repo.git", | ||
"https://test:[email protected]/owner/repo.git", | ||
"gitlab.com/owner/repo.git", | ||
], | ||
) | ||
|
@@ -55,7 +56,7 @@ def test_parse_repository(repo_url: str) -> None: | |
], | ||
) | ||
def test_parse_repository_with_server_url(repo_url: str) -> None: | ||
"""Test an invalid url input""" | ||
"""Test with a custom server url""" | ||
gl = GitLab("fake", "https://mygitlab.com") | ||
|
||
owner, repo_name = gl.parse_repository(repo_url) | ||
|
@@ -64,6 +65,24 @@ def test_parse_repository_with_server_url(repo_url: str) -> None: | |
assert repo_name == "repo" | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"repo_url", | ||
[ | ||
"https://mygitlab.com/group/owner/repo", | ||
"https://mygitlab.com/group/owner/repo.git", | ||
"mygitlab.com/group/owner/repo.git", | ||
], | ||
) | ||
def test_parse_repository_with_group(repo_url: str) -> None: | ||
"""Test with nested namespaces""" | ||
gl = GitLab("fake", "https://mygitlab.com") | ||
|
||
owner, repo_name = gl.parse_repository(repo_url) | ||
|
||
assert owner == "group/owner" | ||
assert repo_name == "repo" | ||
|
||
|
||
def test_parse_repository_integration(tmp_repo: Tuple[str, Repo]) -> None: | ||
"""Tests integration with git remote get-url""" | ||
repo_path, repo = tmp_repo | ||
|
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
Oops, something went wrong.