@@ -114,6 +114,26 @@ def test_autoupdate_out_of_date_repo(
114114 )
115115 write_config ('.' , config )
116116
117+ runner = Runner ('.' , C .CONFIG_FILE )
118+ before = open (C .CONFIG_FILE ).read ()
119+ # It will update the repo, because the name matches
120+ ret = autoupdate (runner , tags_only = False )
121+ after = open (C .CONFIG_FILE ).read ()
122+ assert ret == 0
123+ assert before != after
124+ # Make sure we don't add defaults
125+ assert 'exclude' not in after
126+ assert out_of_date_repo .head_sha in after
127+
128+ def test_autoupdate_out_of_date_repo_with_correct_repo_name (
129+ out_of_date_repo , in_tmpdir , mock_out_store_directory ,
130+ ):
131+ # Write out the config
132+ config = make_config_from_repo (
133+ out_of_date_repo .path , sha = out_of_date_repo .original_sha , check = False ,
134+ )
135+ write_config ('.' , config )
136+
117137 runner = Runner ('.' , C .CONFIG_FILE )
118138 before = open (C .CONFIG_FILE ).read ()
119139 repo_name = 'file://{}' .format (out_of_date_repo .path )
@@ -126,8 +146,7 @@ def test_autoupdate_out_of_date_repo(
126146 assert 'exclude' not in after
127147 assert out_of_date_repo .head_sha in after
128148
129-
130- def test_autoupdate_out_of_date_repo_wrong_repo_name (
149+ def test_autoupdate_out_of_date_repo_with_wrong_repo_name (
131150 out_of_date_repo , in_tmpdir , mock_out_store_directory ,
132151):
133152 # Write out the config
@@ -144,7 +163,6 @@ def test_autoupdate_out_of_date_repo_wrong_repo_name(
144163 assert ret == 0
145164 assert before == after
146165
147-
148166def test_does_not_reformat (
149167 out_of_date_repo , mock_out_store_directory , in_tmpdir ,
150168):
0 commit comments