Skip to content

Commit

Permalink
use os-specific path-separators
Browse files Browse the repository at this point in the history
This commit fixes a bug in the tests
where Unix path-separators were always
used to identify directory entries in
a zip-archive. That is wrong on
Windows, where Windows-path separators
have to be used.
  • Loading branch information
christian-monch committed Jun 7, 2023
1 parent f4f38ee commit 177fccb
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import zipfile
from dataclasses import dataclass
from os import pathsep
from pathlib import Path
from typing import Generator

Expand Down Expand Up @@ -77,7 +78,7 @@ def test_iterator(sample_zip: TestArchive):
for item in items:
item_name = (
str(item.name) +
'/' if item.type == FileSystemItemType.directory
pathsep if item.type == FileSystemItemType.directory
else str(item.name)
)
assert item_name in archive_ops
Expand Down

0 comments on commit 177fccb

Please sign in to comment.