@@ -61,33 +61,6 @@ def test_get_repo_name_from_url(
61
61
valid_git_urls : list [str ], invalid_git_urls : list [str ], repo_name : str , repo_full_name : str , repo_complete_name : str
62
62
) -> None :
63
63
"""Test the extract repo name, full name, and complete name from url method."""
64
- valid_git_urls = [
65
- f"[email protected] :owner/{ repo_name } .git" ,
66
- f"[email protected] :owner/{ repo_name } .git" ,
67
- f"https://gitlab.com/owner/{ repo_name } " ,
68
- f"https://github.com/owner/{ repo_name } .git" ,
69
- f"https://github.com/owner/{ repo_name } " ,
70
- f"git+https://github.com/owner/{ repo_name } " ,
71
- f"git+ssh://[email protected] /owner/{ repo_name } .git" ,
72
- f"git+ssh://[email protected] /owner/{ repo_name } " ,
73
- f"git+ssh://[email protected] :owner/{ repo_name } .git" ,
74
- f"git+ssh://[email protected] :8080/owner/{ repo_name } " ,
75
- f"ssh://[email protected] /owner/{ repo_name } .git" ,
76
- f"ssh://[email protected] /owner/{ repo_name } " ,
77
- f"ssh://[email protected] :owner/{ repo_name } .git" ,
78
- f"ssh://[email protected] :8080/owner/{ repo_name } " ,
79
- f"scm:ssh://[email protected] :8080/owner/{ repo_name } " ,
80
- ]
81
- invalid_git_urls = [
82
- "" ,
83
- f"{ repo_name } .git" ,
84
- f"{ repo_name } .git/" ,
85
- "ssh://[email protected] :8080/invalid/" ,
86
- "https://gitlab.com/invalid.git" ,
87
-
88
-
89
- ]
90
-
91
64
# Test get repo name.
92
65
assert all (git_url .get_repo_name_from_url (url ) == repo_name for url in valid_git_urls )
93
66
assert not any (git_url .get_repo_name_from_url (url ) for url in invalid_git_urls )
@@ -98,7 +71,7 @@ def test_get_repo_name_from_url(
98
71
99
72
# Test get repo complete name.
100
73
assert all (git_url .get_repo_complete_name_from_url (url ) == repo_complete_name for url in valid_git_urls )
101
- assert not all (git_url .get_repo_complete_name_from_url (url ) for url in invalid_git_urls )
74
+ assert not any (git_url .get_repo_complete_name_from_url (url ) for url in invalid_git_urls )
102
75
103
76
104
77
def test_clone_remote_repo () -> None :
0 commit comments