1010
1111from taskgraph .util .vcs import HgRepository , Repository , get_repository
1212
13- from .fixtures .vcs import create_remote_repo
14-
1513
1614def test_get_repository (repo ):
1715 r = get_repository (repo .path )
@@ -159,14 +157,14 @@ def test_remote_name(repo_with_remote):
159157 assert repo .remote_name == remote_name
160158
161159
162- def test_all_remote_names (tmpdir , repo_with_remote ):
160+ def test_all_remote_names (tmpdir , create_remote_repo , repo_with_remote ):
163161 repo , remote_name = repo_with_remote
164162 assert repo .all_remote_names == [remote_name ]
165163 create_remote_repo (tmpdir , repo , "upstream2" , "remote_path2" )
166164 assert repo .all_remote_names == [remote_name , "upstream2" ]
167165
168166
169- def test_remote_name_many_remotes (tmpdir , repo_with_remote ):
167+ def test_remote_name_many_remotes (tmpdir , create_remote_repo , repo_with_remote ):
170168 repo , _ = repo_with_remote
171169 create_remote_repo (tmpdir , repo , "upstream2" , "remote_path2" )
172170
@@ -177,7 +175,7 @@ def test_remote_name_many_remotes(tmpdir, repo_with_remote):
177175 assert repo .remote_name == "upstream"
178176
179177
180- def test_remote_name_default_and_origin (tmpdir , repo_with_remote ):
178+ def test_remote_name_default_and_origin (tmpdir , create_remote_repo , repo_with_remote ):
181179 repo , _ = repo_with_remote
182180 remote_name = "origin" if repo .tool == "git" else "default"
183181 create_remote_repo (tmpdir , repo , remote_name , "remote_path2" )
@@ -188,28 +186,28 @@ def test_remote_name_default_and_origin(tmpdir, repo_with_remote):
188186 assert repo .remote_name == remote_name
189187
190188
191- def test_default_branch_guess (repo ):
189+ def test_default_branch_guess (default_git_branch , repo ):
192190 if repo .tool == "git" :
193- assert repo .default_branch == "refs/heads/master "
191+ assert repo .default_branch == f "refs/heads/{ default_git_branch } "
194192 else :
195193 assert repo .default_branch == "default"
196194
197195
198- def test_default_branch_remote_query (repo_with_remote ):
196+ def test_default_branch_remote_query (default_git_branch , repo_with_remote ):
199197 repo , _ = repo_with_remote
200198 if repo .tool == "git" :
201- assert repo .default_branch == "upstream/master "
199+ assert repo .default_branch == f "upstream/{ default_git_branch } "
202200 else :
203201 assert repo .default_branch == "default"
204202
205203
206- def test_default_branch_cloned_metadata (tmpdir , repo ):
204+ def test_default_branch_cloned_metadata (tmpdir , default_git_branch , repo ):
207205 if repo .tool == "git" :
208206 clone_repo_path = tmpdir / "cloned_repo"
209207 command = ("git" , "clone" , repo .path , clone_repo_path )
210208 subprocess .check_output (command , cwd = tmpdir )
211209 cloned_repo = get_repository (clone_repo_path )
212- assert cloned_repo .default_branch == "origin/master "
210+ assert cloned_repo .default_branch == f "origin/{ default_git_branch } "
213211
214212
215213def assert_files (actual , expected ):
0 commit comments