mirror of
https://github.com/TheLocehiliosan/yadm
synced 2026-03-02 03:49:29 +00:00
Remove support for YADM_COMPATIBILITY=1 (#242)
This commit is contained in:
@@ -4,7 +4,6 @@ import pytest
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
'condition', [
|
||||
'compat',
|
||||
'previous-message',
|
||||
'invalid-alts',
|
||||
'no-invalid-alts',
|
||||
@@ -12,11 +11,8 @@ import pytest
|
||||
def test_report_invalid_alts(runner, yadm, condition):
|
||||
"""Use report_invalid_alts"""
|
||||
|
||||
compat = ''
|
||||
previous = ''
|
||||
alts = 'INVALID_ALT=()'
|
||||
if condition == 'compat':
|
||||
compat = 'YADM_COMPATIBILITY=1'
|
||||
if condition == 'previous-message':
|
||||
previous = 'LEGACY_WARNING_ISSUED=1'
|
||||
if condition == 'invalid-alts':
|
||||
@@ -24,7 +20,6 @@ def test_report_invalid_alts(runner, yadm, condition):
|
||||
|
||||
script = f"""
|
||||
YADM_TEST=1 source {yadm}
|
||||
{compat}
|
||||
{previous}
|
||||
{alts}
|
||||
report_invalid_alts
|
||||
|
||||
@@ -4,7 +4,7 @@ import pytest
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
'condition',
|
||||
['basic', 'override', 'xdg_config_home', 'legacy'],
|
||||
['basic', 'override', 'xdg_config_home'],
|
||||
)
|
||||
def test_set_yadm_dir(runner, yadm, condition):
|
||||
"""Test set_yadm_dir"""
|
||||
@@ -13,8 +13,6 @@ def test_set_yadm_dir(runner, yadm, condition):
|
||||
setup = 'YADM_DIR=/override'
|
||||
elif condition == 'xdg_config_home':
|
||||
setup = 'XDG_CONFIG_HOME=/xdg'
|
||||
elif condition == 'legacy':
|
||||
setup = 'YADM_COMPATIBILITY=1'
|
||||
script = f"""
|
||||
HOME=/testhome
|
||||
YADM_TEST=1 source {yadm}
|
||||
@@ -31,5 +29,3 @@ def test_set_yadm_dir(runner, yadm, condition):
|
||||
assert run.out.rstrip() == '/override'
|
||||
elif condition == 'xdg_config_home':
|
||||
assert run.out.rstrip() == '/xdg/yadm'
|
||||
elif condition == 'legacy':
|
||||
assert run.out.rstrip() == '/testhome/.yadm'
|
||||
|
||||
@@ -11,16 +11,13 @@ LEGACY_PATHS = [
|
||||
]
|
||||
|
||||
# used:
|
||||
# YADM_COMPATIBILITY
|
||||
# YADM_DIR
|
||||
# YADM_LEGACY_DIR
|
||||
# GIT_PROGRAM
|
||||
@pytest.mark.parametrize('condition', ['compat', 'equal', 'existing_repo'])
|
||||
@pytest.mark.parametrize('condition', ['equal', 'existing_repo'])
|
||||
def test_upgrade_errors(tmpdir, runner, yadm, condition):
|
||||
"""Test upgrade() error conditions"""
|
||||
|
||||
compatibility = 'YADM_COMPATIBILITY=1' if condition == 'compat' else ''
|
||||
|
||||
home = tmpdir.mkdir('home')
|
||||
yadm_dir = home.join('.config/yadm')
|
||||
legacy_dir = home.join('.yadm')
|
||||
@@ -32,7 +29,6 @@ def test_upgrade_errors(tmpdir, runner, yadm, condition):
|
||||
|
||||
script = f"""
|
||||
YADM_TEST=1 source {yadm}
|
||||
{compatibility}
|
||||
YADM_DIR="{yadm_dir}"
|
||||
YADM_REPO="{yadm_dir}/repo.git"
|
||||
YADM_LEGACY_DIR="{legacy_dir}"
|
||||
@@ -42,8 +38,6 @@ def test_upgrade_errors(tmpdir, runner, yadm, condition):
|
||||
assert run.failure
|
||||
assert run.err == ''
|
||||
assert 'Unable to upgrade' in run.out
|
||||
if condition == 'compat':
|
||||
assert 'YADM_COMPATIBILITY' in run.out
|
||||
if condition == 'equal':
|
||||
assert 'has been resolved as' in run.out
|
||||
if condition == 'existing_repo':
|
||||
|
||||
Reference in New Issue
Block a user