mirror of
https://github.com/TheLocehiliosan/yadm
synced 2026-03-02 03:49:29 +00:00
Split out processing of alt (past/future)
This commit is contained in:
@@ -87,7 +87,9 @@ def test_alt(runner, yadm_y, paths,
|
||||
encrypt=encrypt, exclude=exclude)
|
||||
|
||||
# run alt to trigger linking
|
||||
run = runner(yadm_y('alt'))
|
||||
env = os.environ.copy()
|
||||
env['YADM_COMPATIBILITY'] = '1'
|
||||
run = runner(yadm_y('alt'), env=env)
|
||||
assert run.success
|
||||
assert run.err == ''
|
||||
linked = linked_list(run.out)
|
||||
@@ -188,7 +190,9 @@ def test_wild(request, runner, yadm_y, paths,
|
||||
encrypt=encrypt, exclude=False)
|
||||
|
||||
# run alt to trigger linking
|
||||
run = runner(yadm_y('alt'))
|
||||
env = os.environ.copy()
|
||||
env['YADM_COMPATIBILITY'] = '1'
|
||||
run = runner(yadm_y('alt'), env=env)
|
||||
assert run.success
|
||||
assert run.err == ''
|
||||
linked = linked_list(run.out)
|
||||
@@ -211,7 +215,9 @@ def test_wild(request, runner, yadm_y, paths,
|
||||
encrypt=encrypt, exclude=False)
|
||||
|
||||
# run alt to trigger linking
|
||||
run = runner(yadm_y('alt'))
|
||||
env = os.environ.copy()
|
||||
env['YADM_COMPATIBILITY'] = '1'
|
||||
run = runner(yadm_y('alt'), env=env)
|
||||
assert run.success
|
||||
assert run.err == ''
|
||||
linked = linked_list(run.out)
|
||||
@@ -249,7 +255,9 @@ def test_local_override(runner, yadm_y, paths,
|
||||
paths, '##or-class.or-os.or-hostname.or-user')
|
||||
|
||||
# run alt to trigger linking
|
||||
run = runner(yadm_y('alt'))
|
||||
env = os.environ.copy()
|
||||
env['YADM_COMPATIBILITY'] = '1'
|
||||
run = runner(yadm_y('alt'), env=env)
|
||||
assert run.success
|
||||
assert run.err == ''
|
||||
linked = linked_list(run.out)
|
||||
@@ -287,7 +295,9 @@ def test_class_case(runner, yadm_y, paths, tst_sys, suffix):
|
||||
utils.create_alt_files(paths, f'##{ending}')
|
||||
|
||||
# run alt to trigger linking
|
||||
run = runner(yadm_y('alt'))
|
||||
env = os.environ.copy()
|
||||
env['YADM_COMPATIBILITY'] = '1'
|
||||
run = runner(yadm_y('alt'), env=env)
|
||||
assert run.success
|
||||
assert run.err == ''
|
||||
linked = linked_list(run.out)
|
||||
@@ -320,7 +330,9 @@ def test_auto_alt(runner, yadm_y, paths, autoalt):
|
||||
utils.create_alt_files(paths, suffix)
|
||||
|
||||
# run status to possibly trigger linking
|
||||
run = runner(yadm_y('status'))
|
||||
env = os.environ.copy()
|
||||
env['YADM_COMPATIBILITY'] = '1'
|
||||
run = runner(yadm_y('status'), env=env)
|
||||
assert run.success
|
||||
assert run.err == ''
|
||||
linked = linked_list(run.out)
|
||||
@@ -356,7 +368,9 @@ def test_delimiter(runner, yadm_y, paths,
|
||||
utils.create_alt_files(paths, suffix)
|
||||
|
||||
# run alt to trigger linking
|
||||
run = runner(yadm_y('alt'))
|
||||
env = os.environ.copy()
|
||||
env['YADM_COMPATIBILITY'] = '1'
|
||||
run = runner(yadm_y('alt'), env=env)
|
||||
assert run.success
|
||||
assert run.err == ''
|
||||
linked = linked_list(run.out)
|
||||
@@ -396,7 +410,9 @@ def test_invalid_links_removed(runner, yadm_y, paths):
|
||||
utils.create_alt_files(paths, f'##{tst_class}')
|
||||
|
||||
# run alt to trigger linking
|
||||
run = runner(yadm_y('alt'))
|
||||
env = os.environ.copy()
|
||||
env['YADM_COMPATIBILITY'] = '1'
|
||||
run = runner(yadm_y('alt'), env=env)
|
||||
assert run.success
|
||||
assert run.err == ''
|
||||
linked = linked_list(run.out)
|
||||
@@ -418,7 +434,9 @@ def test_invalid_links_removed(runner, yadm_y, paths):
|
||||
utils.set_local(paths, 'class', 'changedclass')
|
||||
|
||||
# run alt to trigger linking
|
||||
run = runner(yadm_y('alt'))
|
||||
env = os.environ.copy()
|
||||
env['YADM_COMPATIBILITY'] = '1'
|
||||
run = runner(yadm_y('alt'), env=env)
|
||||
assert run.success
|
||||
assert run.err == ''
|
||||
linked = linked_list(run.out)
|
||||
@@ -50,7 +50,9 @@ def test_local_override(runner, yadm_y, paths,
|
||||
# os.system(f'find {paths.work}' + ' -name *j2 -ls -exec cat \'{}\' ";"')
|
||||
# os.system(f'find {paths.work}')
|
||||
# run alt to trigger linking
|
||||
run = runner(yadm_y('alt'))
|
||||
env = os.environ.copy()
|
||||
env['YADM_COMPATIBILITY'] = '1'
|
||||
run = runner(yadm_y('alt'), env=env)
|
||||
assert run.success
|
||||
assert run.err == ''
|
||||
created = created_list(run.out)
|
||||
@@ -83,7 +85,9 @@ def test_auto_alt(runner, yadm_y, paths, autoalt, tst_sys,
|
||||
utils.create_alt_files(paths, jinja_suffix, content='{{ YADM_OS }}')
|
||||
|
||||
# run status to possibly trigger linking
|
||||
run = runner(yadm_y('status'))
|
||||
env = os.environ.copy()
|
||||
env['YADM_COMPATIBILITY'] = '1'
|
||||
run = runner(yadm_y('status'), env=env)
|
||||
assert run.success
|
||||
assert run.err == ''
|
||||
created = created_list(run.out)
|
||||
@@ -111,6 +115,7 @@ def test_jinja_envtpl_missing(runner, paths):
|
||||
process_global_args -Y "{paths.yadm}"
|
||||
set_operating_system
|
||||
configure_paths
|
||||
YADM_COMPATIBILITY=1
|
||||
ENVTPL_PROGRAM='envtpl_missing' main alt
|
||||
"""
|
||||
|
||||
@@ -170,7 +175,9 @@ def test_jinja(runner, yadm_y, paths,
|
||||
includefile=True)
|
||||
|
||||
# run alt to trigger linking
|
||||
run = runner(yadm_y('alt'))
|
||||
env = os.environ.copy()
|
||||
env['YADM_COMPATIBILITY'] = '1'
|
||||
run = runner(yadm_y('alt'), env=env)
|
||||
assert run.success
|
||||
assert run.err == ''
|
||||
created = created_list(run.out)
|
||||
@@ -4,6 +4,8 @@ import os
|
||||
import pytest
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
'compatibility', [True, False], ids=['compat', 'no-compat'])
|
||||
@pytest.mark.parametrize(
|
||||
'setting, is_cygwin, expect_link, pre_existing', [
|
||||
(None, False, True, None),
|
||||
@@ -28,7 +30,8 @@ import pytest
|
||||
@pytest.mark.usefixtures('ds1_copy')
|
||||
def test_cygwin_copy(
|
||||
runner, yadm_y, paths, cygwin_sys, tst_sys,
|
||||
setting, is_cygwin, expect_link, pre_existing):
|
||||
setting, is_cygwin, expect_link, pre_existing,
|
||||
compatibility):
|
||||
"""Test yadm.cygwin_copy"""
|
||||
|
||||
if setting is not None:
|
||||
@@ -49,6 +52,10 @@ def test_cygwin_copy(
|
||||
expected_content = f'test_cygwin_copy##{cygwin_sys}'
|
||||
env = os.environ.copy()
|
||||
env['PATH'] = ':'.join([str(uname_path), env['PATH']])
|
||||
if compatibility:
|
||||
env['YADM_COMPATIBILITY'] = '1'
|
||||
else:
|
||||
pytest.xfail('Alternates 2.0.0 has not been implemented.')
|
||||
|
||||
run = runner(yadm_y('alt'), env=env)
|
||||
assert run.success
|
||||
|
||||
Reference in New Issue
Block a user