From 0128ae457b266179108f9a1ce003f57bd52a2ce0 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Wed, 22 Jan 2020 20:25:22 -0500 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=91=B9=20Feed=20the=20hobgoblins=20(d?= =?UTF-8?q?elint).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test_zipp.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/test_zipp.py b/test_zipp.py index e4c77a2..567bca0 100644 --- a/test_zipp.py +++ b/test_zipp.py @@ -4,7 +4,6 @@ import io import zipfile -import posixpath import contextlib import tempfile import shutil @@ -14,6 +13,8 @@ except ImportError: import pathlib2 as pathlib +import zipp + if not hasattr(contextlib, 'ExitStack'): import contextlib2 contextlib.ExitStack = contextlib2.ExitStack @@ -25,8 +26,6 @@ except AttributeError: import unittest2 as unittest -import zipp - __metaclass__ = type consume = tuple From 45db54bec6308d78c48f4f8cae1986abdaaffc06 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Wed, 22 Jan 2020 20:28:39 -0500 Subject: [PATCH 2/2] Add tests capturing expectation that a subdir with or without a trailing slash is a dir. --- test_zipp.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test_zipp.py b/test_zipp.py index 567bca0..78167ea 100644 --- a/test_zipp.py +++ b/test_zipp.py @@ -122,6 +122,14 @@ def test_iterdir_and_types(self): i, = h.iterdir() assert i.is_file() + def test_subdir_is_dir(self): + for alpharep in self.zipfile_alpharep(): + root = zipp.Path(alpharep) + assert (root / 'b').is_dir() + assert (root / 'b/').is_dir() + assert (root / 'g').is_dir() + assert (root / 'g/').is_dir() + def test_open(self): for alpharep in self.zipfile_alpharep(): root = zipp.Path(alpharep)