clear 'frozen: ...' comment if autoupdate unfreezes

This commit is contained in:
Anthony Sottile 2020-01-01 20:21:42 -08:00
parent cd57ba90f5
commit 35caf115f8
2 changed files with 9 additions and 2 deletions

View file

@ -312,9 +312,14 @@ def test_autoupdate_freeze(tagged, in_tmpdir, store):
assert autoupdate(C.CONFIG_FILE, store, freeze=True, tags_only=False) == 0
with open(C.CONFIG_FILE) as f:
expected = 'rev: {} # v1.2.3'.format(tagged.head_rev)
expected = 'rev: {} # frozen: v1.2.3'.format(tagged.head_rev)
assert expected in f.read()
# if we un-freeze it should remove the frozen comment
assert autoupdate(C.CONFIG_FILE, store, freeze=False, tags_only=False) == 0
with open(C.CONFIG_FILE) as f:
assert 'rev: v1.2.3\n' in f.read()
def test_autoupdate_tags_only(tagged, in_tmpdir, store):
# add some commits after the tag