1
0
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:
Tim Byrne
2020-10-17 17:40:43 -05:00
parent a66d3c148c
commit b19c78b8e2
5 changed files with 4 additions and 60 deletions

View File

@@ -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

View File

@@ -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'

View File

@@ -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':