diff --git a/test/test_unit_report_invalid_alts.py b/test/test_unit_report_invalid_alts.py deleted file mode 100644 index 040b11a..0000000 --- a/test/test_unit_report_invalid_alts.py +++ /dev/null @@ -1,34 +0,0 @@ -"""Unit tests: report_invalid_alts""" -import pytest - - -@pytest.mark.parametrize( - 'condition', [ - 'previous-message', - 'invalid-alts', - 'no-invalid-alts', - ]) -def test_report_invalid_alts(runner, yadm, condition): - """Use report_invalid_alts""" - - previous = '' - alts = 'INVALID_ALT=()' - if condition == 'previous-message': - previous = 'LEGACY_WARNING_ISSUED=1' - if condition == 'invalid-alts': - alts = 'INVALID_ALT=("file##invalid")' - - script = f""" - YADM_TEST=1 source {yadm} - {previous} - {alts} - report_invalid_alts - """ - run = runner(command=['bash'], inp=script) - assert run.success - assert run.err == '' - if condition == 'invalid-alts': - assert 'WARNING' in run.out - assert 'file##invalid' in run.out - else: - assert run.out == '' diff --git a/test/test_unit_score_file.py b/test/test_unit_score_file.py index 679229f..5719fe4 100644 --- a/test/test_unit_score_file.py +++ b/test/test_unit_score_file.py @@ -260,19 +260,3 @@ def test_template_recording(runner, yadm, cmd_generated): assert run.success assert run.err == '' assert run.out.rstrip() == expected - - -def test_invalid(runner, yadm): - """Verify invalid alternates are noted in INVALID_ALT""" - - invalid_file = "file##invalid" - - script = f""" - YADM_TEST=1 source {yadm} - score_file "{invalid_file}" - echo "INVALID:${{INVALID_ALT[@]}}" - """ - run = runner(command=['bash'], inp=script) - assert run.success - assert run.err == '' - assert run.out.rstrip() == f'INVALID:{invalid_file}' diff --git a/yadm b/yadm index 62b17ec..04ba034 100755 --- a/yadm +++ b/yadm @@ -62,7 +62,6 @@ GPG_OPTS=() OPENSSL_OPTS=() LEGACY_WARNING_ISSUED=0 -INVALID_ALT=() # flag causing path translations with cygpath USE_CYGPATH=0 @@ -232,7 +231,6 @@ function score_file() { return 0 # unsupported values else - INVALID_ALT+=("$src") score=0 return fi @@ -545,41 +543,9 @@ function alt() { alt_linking remove_stale_links - report_invalid_alts } -function report_invalid_alts() { - [ "$LEGACY_WARNING_ISSUED" = "1" ] && return - [ "${#INVALID_ALT[@]}" = "0" ] && return - local path_list - for invalid in "${INVALID_ALT[@]}"; do - path_list="$path_list * $invalid"$'\n' - done - cat < - - Invalid alternates detected: -${path_list} -*********** -EOF -} - function remove_stale_links() { # review alternate candidates for stale links # if a possible alt IS linked, but it's source is not part of alt_linked,