88 > API changes so I should better have real repositories to test.
99
1010"""
11+
1112import os
1213from unittest .mock import patch
1314
1415import pytest
1516
1617from autogit .actions ._4_clone_repositories import (
17- clone_repositories ,
18- clone_repository ,
1918 get_repo_access_url ,
20- print_cloned_repositories ,
2119)
2220
2321## Methods to test:
2725# def clone_repositories(repos: dict[str, RepoState], executor: ThrottledTasksExecutor) -> None:
2826
2927
30-
3128@pytest .mark .parametrize (
3229 ('repo_url' , 'expected_access_url' ),
3330 [
4037 'https://gitlab.com/mygroup/myuser/myreponame.git' ,
4138 'https://api:<GITLAB_ACCESS_TOKEN>@gitlab.com/mygroup/myuser/myreponame.git' ,
4239 ),
43- (
44- 'git@gitlab.com:niekas/jsonstate.git' ,
45- 'git@gitlab.com:niekas/jsonstate.git'
46- ),
47-
40+ ('git@gitlab.com:myusername/myreponame.git' , 'git@gitlab.com:myusername/myreponame.git' ),
4841 # Managed repos
4942 (
5043 'https://managedgit.com/myuser/myreponame' ,
6255 'https://managedgit.com/mygroup/mysubgroup/mynamespace/myreponame.git' ,
6356 'https://api:<GIT_TOKEN>@managedgit.com/mygroup/mysubgroup/mynamespace/myreponame.git' ,
6457 ),
65-
6658 # Github repos
6759 (
6860 'https://github.com/myuser/reponame.git' ,
@@ -81,11 +73,9 @@ def test_get_repo_access_url(repo_url, expected_access_url):
8173 'GITLAB_ACCESS_TOKEN' : '<GITLAB_ACCESS_TOKEN>' ,
8274 'GITLAB_OAUTH_TOKEN' : '<GITLAB_OAUTH_TOKEN>' ,
8375 'GITLAB_TOKEN' : '<GITLAB_TOKEN>' ,
84-
8576 'GITHUB_OAUTH_TOKEN' : '<GITHUB_OAUTH_TOKEN>' ,
8677 'GITHUB_ACCESS_TOKEN' : '<GITHUB_ACCESS_TOKEN>' ,
8778 'GITHUB_TOKEN' : '<GITHUB_TOKEN>' ,
88-
8979 'GIT_TOKEN' : '<GIT_TOKEN>' ,
9080 'GIT_ACCESS_TOKEN' : '<GIT_ACCESS_TOKEN>' ,
9181 'GIT_OAUTH_TOKEN' : '<GIT_OAUTH_TOKEN>' ,
@@ -95,7 +85,7 @@ def test_get_repo_access_url(repo_url, expected_access_url):
9585 assert access_url == expected_access_url
9686
9787
98- async def test_clone_repository ():
88+ async def test_clone_repository (args ):
9989 pass
10090
10191
0 commit comments