summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAlex Grönholm <alex.gronholm@nextday.fi>2021-08-15 23:58:47 +0300
committerAlex Grönholm <alex.gronholm@nextday.fi>2021-08-15 23:58:47 +0300
commit3f1a73a2b282ed55044541d3c28e0618d8b1de14 (patch)
tree560eb5afbb31178ca3fe058358ccd0376201f246 /tests
parentb8c4aa055cea0132776e7e53edce3538710d5b68 (diff)
downloadwheel-git-3f1a73a2b282ed55044541d3c28e0618d8b1de14.tar.gz
Fixed wheel pack duplicating WHEEL contents on build number change
Fixes #415.
Diffstat (limited to 'tests')
-rw-r--r--tests/cli/test_pack.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/tests/cli/test_pack.py b/tests/cli/test_pack.py
index ff36d6f..3f689a4 100644
--- a/tests/cli/test_pack.py
+++ b/tests/cli/test_pack.py
@@ -1,4 +1,5 @@
import os
+from textwrap import dedent
from zipfile import ZipFile
import pytest
@@ -47,7 +48,15 @@ def test_pack(tmpdir_factory, tmpdir, build_tag_arg, existing_build_tag, filenam
assert new_record_lines == old_record_lines
expected_build_num = build_tag_arg or existing_build_tag
+ expected_wheel_content = dedent("""\
+ Wheel-Version: 1.0
+ Generator: bdist_wheel (0.30.0)
+ Root-Is-Purelib: false
+ Tag: py2-none-any
+ Tag: py3-none-any
+ """.replace('\n', '\r\n'))
if expected_build_num:
- assert ('Build: %s\r\n' % expected_build_num).encode() in new_wheel_file_content
- else:
- assert b'Build: ' not in new_wheel_file_content
+ expected_wheel_content += 'Build: %s\r\n' % expected_build_num
+
+ expected_wheel_content = expected_wheel_content.encode('ascii')
+ assert new_wheel_file_content == expected_wheel_content