summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAlex Grönholm <alex.gronholm@nextday.fi>2020-01-26 23:10:20 +0200
committerGitHub <noreply@github.com>2020-01-26 23:10:20 +0200
commitb2bee507b8aa0695644be9037064855502cea296 (patch)
treead5f7352aec55041f1c31efcb80c670334dcaad3 /tests
parent8e6a74b8169ba7ecf3947fdc6fb8b3dd6e97776e (diff)
downloadwheel-git-b2bee507b8aa0695644be9037064855502cea296.tar.gz
Added the --compression option to bdist_wheel (#316)
Fixes #313.
Diffstat (limited to 'tests')
-rw-r--r--tests/test_bdist_wheel.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/test_bdist_wheel.py b/tests/test_bdist_wheel.py
index de8d46f..67df435 100644
--- a/tests/test_bdist_wheel.py
+++ b/tests/test_bdist_wheel.py
@@ -8,6 +8,7 @@ from zipfile import ZipFile
import pytest
+from wheel.bdist_wheel import bdist_wheel
from wheel.wheelfile import WheelFile
DEFAULT_FILES = {
@@ -128,3 +129,17 @@ def test_build_from_readonly_tree(dummy_dist, monkeypatch, tmpdir):
os.chmod(os.path.join(root, fname), stat.S_IREAD)
subprocess.check_call([sys.executable, 'setup.py', 'bdist_wheel'])
+
+
+@pytest.mark.parametrize('option, compress_type', list(bdist_wheel.supported_compressions.items()),
+ ids=list(bdist_wheel.supported_compressions))
+def test_compression(dummy_dist, monkeypatch, tmpdir, option, compress_type):
+ monkeypatch.chdir(dummy_dist)
+ subprocess.check_call([sys.executable, 'setup.py', 'bdist_wheel', '-b', str(tmpdir),
+ '--universal', '--compression={}'.format(option)])
+ with WheelFile('dist/dummy_dist-1.0-py2.py3-none-any.whl') as wf:
+ filenames = set(wf.namelist())
+ assert 'dummy_dist-1.0.dist-info/RECORD' in filenames
+ assert 'dummy_dist-1.0.dist-info/METADATA' in filenames
+ for zinfo in wf.filelist:
+ assert zinfo.compress_type == compress_type