@@ -30,17 +30,19 @@ def run_dvc(*argv):
3030
3131
3232@pytest .mark .parametrize ("remote_url" , remote_params , indirect = True )
33- def test_get_url (remote_url , tmp_dir , dvc , repo_template ):
33+ def test_get_url (tmp_dir , dvc , remote_url ):
3434 run_dvc ("remote" , "add" , "-d" , "upstream" , remote_url )
35- dvc . add ( "foo" )
35+ tmp_dir . dvc_gen ( "foo" , "foo" )
3636
3737 expected_url = URLInfo (remote_url ) / "ac/bd18db4cc2f85cedef654fccc4a4d8"
3838 assert api .get_url ("foo" ) == expected_url
3939
4040
4141@pytest .mark .parametrize ("remote_url" , remote_params , indirect = True )
42- def test_get_url_external (remote_url , erepo_dir ):
42+ def test_get_url_external (erepo_dir , remote_url ):
4343 _set_remote_url_and_commit (erepo_dir .dvc , remote_url )
44+ with erepo_dir .chdir ():
45+ erepo_dir .dvc_gen ("foo" , "foo" , commit = "add foo" )
4446
4547 # Using file url to force clone to tmp repo
4648 repo_url = "file://{}" .format (erepo_dir )
@@ -63,11 +65,15 @@ def test_open(remote_url, tmp_dir, dvc):
6365
6466@pytest .mark .parametrize ("remote_url" , all_remote_params , indirect = True )
6567def test_open_external (remote_url , erepo_dir ):
66- erepo_dir .scm .checkout ("branch" )
67- _set_remote_url_and_commit (erepo_dir .dvc , remote_url )
68- erepo_dir .scm .checkout ("master" )
6968 _set_remote_url_and_commit (erepo_dir .dvc , remote_url )
7069
70+ with erepo_dir .chdir ():
71+ erepo_dir .dvc_gen ("version" , "master" , commit = "add version" )
72+
73+ with erepo_dir .branch ("branch" , new = "True" ):
74+ # NOTE: need file to be other size for Mac
75+ erepo_dir .dvc_gen ("version" , "branchver" , commit = "add version" )
76+
7177 erepo_dir .dvc .push (all_branches = True )
7278
7379 # Remove cache to force download
@@ -78,7 +84,7 @@ def test_open_external(remote_url, erepo_dir):
7884 with api .open ("version" , repo = repo_url ) as fd :
7985 assert fd .read () == "master"
8086
81- assert api .read ("version" , repo = repo_url , rev = "branch" ) == "branch "
87+ assert api .read ("version" , repo = repo_url , rev = "branch" ) == "branchver "
8288
8389
8490@pytest .mark .parametrize ("remote_url" , all_remote_params , indirect = True )
0 commit comments