Merging upstream version 2.5.1.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
344ec6ad68
commit
46a56c0856
37 changed files with 457 additions and 213 deletions
|
@ -414,9 +414,9 @@ def test_autoupdate_local_hooks(in_git_dir, store):
|
|||
config = sample_local_config()
|
||||
add_config_to_repo('.', config)
|
||||
assert autoupdate(C.CONFIG_FILE, store, freeze=False, tags_only=False) == 0
|
||||
new_config_writen = read_config('.')
|
||||
assert len(new_config_writen['repos']) == 1
|
||||
assert new_config_writen['repos'][0] == config
|
||||
new_config_written = read_config('.')
|
||||
assert len(new_config_written['repos']) == 1
|
||||
assert new_config_written['repos'][0] == config
|
||||
|
||||
|
||||
def test_autoupdate_local_hooks_with_out_of_date_repo(
|
||||
|
@ -429,9 +429,9 @@ def test_autoupdate_local_hooks_with_out_of_date_repo(
|
|||
config = {'repos': [local_config, stale_config]}
|
||||
write_config('.', config)
|
||||
assert autoupdate(C.CONFIG_FILE, store, freeze=False, tags_only=False) == 0
|
||||
new_config_writen = read_config('.')
|
||||
assert len(new_config_writen['repos']) == 2
|
||||
assert new_config_writen['repos'][0] == local_config
|
||||
new_config_written = read_config('.')
|
||||
assert len(new_config_written['repos']) == 2
|
||||
assert new_config_written['repos'][0] == local_config
|
||||
|
||||
|
||||
def test_autoupdate_meta_hooks(tmpdir, store):
|
||||
|
@ -474,3 +474,23 @@ def test_updates_old_format_to_new_format(tmpdir, capsys, store):
|
|||
)
|
||||
out, _ = capsys.readouterr()
|
||||
assert out == 'Configuration has been migrated.\n'
|
||||
|
||||
|
||||
def test_maintains_rev_quoting_style(tmpdir, out_of_date, store):
|
||||
fmt = (
|
||||
'repos:\n'
|
||||
'- repo: {path}\n'
|
||||
' rev: "{rev}"\n'
|
||||
' hooks:\n'
|
||||
' - id: foo\n'
|
||||
'- repo: {path}\n'
|
||||
" rev: '{rev}'\n"
|
||||
' hooks:\n'
|
||||
' - id: foo\n'
|
||||
)
|
||||
cfg = tmpdir.join(C.CONFIG_FILE)
|
||||
cfg.write(fmt.format(path=out_of_date.path, rev=out_of_date.original_rev))
|
||||
|
||||
assert autoupdate(str(cfg), store, freeze=False, tags_only=False) == 0
|
||||
expected = fmt.format(path=out_of_date.path, rev=out_of_date.head_rev)
|
||||
assert cfg.read() == expected
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue