From bf85e75d87d758dab3f33f146818e6399a851982 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 24 Feb 2023 05:12:50 -0500 Subject: [PATCH] Add doctests for _implied_dirs illustrating the behavior. --- zipp/__init__.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/zipp/__init__.py b/zipp/__init__.py index 5f4a699..f06e9fc 100644 --- a/zipp/__init__.py +++ b/zipp/__init__.py @@ -88,6 +88,11 @@ class CompleteDirs(InitializedState, zipfile.ZipFile): """ A ZipFile subclass that ensures that implied directories are always included in the namelist. + + >>> list(CompleteDirs._implied_dirs(['foo/bar.txt', 'foo/bar/baz.txt'])) + ['foo/', 'foo/bar/'] + >>> list(CompleteDirs._implied_dirs(['foo/bar.txt', 'foo/bar/baz.txt', 'foo/bar/'])) + ['foo/'] """ @staticmethod