Skip to content

Commit

Permalink
Tests: add test coverage for pymovements.utils._decompress (#241)
Browse files Browse the repository at this point in the history
the testcase is unreachable when extract_archive only is used
this coverage enables us to cover the case if _decompress is used
we advise that this method is not used as a standalone
  • Loading branch information
SiQube authored Mar 3, 2023
1 parent 4df8910 commit 0d3d2a4
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/utils/test_archives.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

import pytest

from pymovements.utils.archives import _decompress
from pymovements.utils.archives import _ZIP_COMPRESSION_MAP
from pymovements.utils.archives import extract_archive

Expand Down Expand Up @@ -281,3 +282,10 @@ def test_extract_unnsupported_archive_destination_path_not_None(
msg, = excinfo.value.args
assert msg == """Unsupported archive type: '.jpg'.
Supported suffixes are: '['.tar', '.zip']'."""


def test_decompress_unknown_compression_suffix():
with pytest.raises(RuntimeError) as excinfo:
_decompress(pathlib.Path('test.zip.zip'))
msg, = excinfo.value.args
assert msg == "Couldn't detect a compression from suffix .zip."

0 comments on commit 0d3d2a4

Please sign in to comment.