Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e5b8cb0

Browse files
committed
Keep original test as is
1 parent 4d0c400 commit e5b8cb0

1 file changed

Lines changed: 21 additions & 3 deletions

File tree

tests/commands/autoupdate_test.py

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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-
148166
def test_does_not_reformat(
149167
out_of_date_repo, mock_out_store_directory, in_tmpdir,
150168
):

0 commit comments

Comments
 (0)