Skip to content

Commit

Permalink
Fix various test bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
MrMino committed Nov 1, 2024
1 parent b1fed8a commit 3494b29
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
1 change: 1 addition & 0 deletions tests/test_metas.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,7 @@ def test_adding_same_files_to_two_records_make_them_equal(self):
a.update("file", buf)
buf.seek(0)
b.update("file", buf)
assert a == b

def test_from_empty_str_produces_empty_record(self):
assert str(WheelRecord.from_str("")) == ""
Expand Down
4 changes: 2 additions & 2 deletions tests/test_wheelfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def test_target_can_be_binary_wb_file_obj(self, real_path):

def test_on_bufs_x_mode_behaves_same_as_w(self):
f1, f2 = BytesIO(), BytesIO()
wf1 = WheelFile(f1, "w", distname="_", version="0")
wf1 = WheelFile(f1, "x", distname="_", version="0")
wf1.close()
wf2 = WheelFile(f2, "w", distname="_", version="0")
wf2.close()
Expand Down Expand Up @@ -334,7 +334,7 @@ def test_writes_preserve_mtime(self, wf, tmp_file):
os.utime(tmp_file, (1600000000, 1600000000))

wf.write(tmp_file, arcname="file")
wf.zipfile.getinfo("file")
assert wf.zipfile.getinfo("file").date_time == (2020, 9, 13, 14, 26, 40)

def test_write_has_resolve_arg(self, wf, tmp_file):
wf.write(tmp_file, resolve=True)
Expand Down
14 changes: 7 additions & 7 deletions tests/test_wheelfile_cloning.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,27 +54,27 @@ class TestUnspecifiedArgs:

def test_copies_distname(self, wf, buf):
cwf = WheelFile.from_wheelfile(wf, buf)
cwf.distname == wf.distname
assert cwf.distname == wf.distname

def test_copies_version(self, wf, buf):
cwf = WheelFile.from_wheelfile(wf, buf)
cwf.version == wf.version
assert cwf.version == wf.version

def test_copies_build_tag(self, wf, buf):
cwf = WheelFile.from_wheelfile(wf, buf)
cwf.version == wf.version
assert cwf.version == wf.version

def test_copies_language(self, wf, buf):
cwf = WheelFile.from_wheelfile(wf, buf)
cwf.language_tag == wf.language_tag
assert cwf.language_tag == wf.language_tag

def test_copies_abi(self, wf, buf):
cwf = WheelFile.from_wheelfile(wf, buf)
cwf.abi_tag == wf.abi_tag
assert cwf.abi_tag == wf.abi_tag

def test_copies_platform(self, wf, buf):
cwf = WheelFile.from_wheelfile(wf, buf)
cwf.platform_tag == wf.platform_tag
assert cwf.platform_tag == wf.platform_tag

def test_none_build_tag_sets_default(self, wf, buf):
cwf = WheelFile.from_wheelfile(
Expand Down Expand Up @@ -120,7 +120,7 @@ def test_passes_allowzip64_arg_to_zipfile(self, wf, buf, tmp_file):
# "force_zip64 is True, but allowZip64 was False when opening the ZIP
# file."
with pytest.raises(ValueError, match="allowZip64 was False"):
assert cwf.zipfile.open("file", mode="w", force_zip64=True)
cwf.zipfile.open("file", mode="w", force_zip64=True)

def test_passes_compresslevel_arg_to_init(self, wf, buf):
cwf = WheelFile.from_wheelfile(
Expand Down

0 comments on commit 3494b29

Please sign in to comment.