Skip to content
Snippets Groups Projects
Commit 614c1b2c authored by Sergei Trofimovich's avatar Sergei Trofimovich
Browse files

tests/comparators/test_sevenz.py: amend 7zip version test for older 7z

Without the change `7z` test fails with assertion errors:

    FAILED tests/comparators/test_sevenz.py::test_metadata_diff - AssertionError

This happens because version guard did not work for my ancient `7z`:

    $ 7z | head -n2

    7-Zip [64] 17.05 : Copyright (c) 1999-2021 Igor Pavlov : 2017-08-28

THe change attempts to skip `[64]` identifier. Tested on 7z 17.05 only.
parent c1c34c1d
No related branches found
No related tags found
1 merge request!142tests/comparators/test_sevenz.py: amend 7zip version test for older 7z
......@@ -38,7 +38,12 @@ def sevenz_version():
out = subprocess.check_output(["7z"])
except subprocess.CalledProcessError as e:
out = e.output
return out.decode("UTF-8").split()[1].strip()
words = out.decode("UTF-8").split()
# 7zip 17.04 returns version after "[64]" identifier:
# "7-Zip [64] 17.05 : Copyright (c) 1999-2021 Igor Pavlov : 2017-08-28"
if words[1].startswith("["):
return words[2].strip()
return words[1].strip()
def test_identification(sevenza):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment