diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2019-07-07 21:37:50 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-07 21:37:50 (GMT) |
commit | 38f44b4a4adc37e8f5f8971917d8b3145f351a56 (patch) | |
tree | a37b1db09d407bbe909198f1df79429cc0cb1217 /Lib/test/test_zipfile.py | |
parent | f6cdd3ff687ebbf8209d793a18a042ea495c4aeb (diff) | |
download | cpython-38f44b4a4adc37e8f5f8971917d8b3145f351a56.zip cpython-38f44b4a4adc37e8f5f8971917d8b3145f351a56.tar.gz cpython-38f44b4a4adc37e8f5f8971917d8b3145f351a56.tar.bz2 |
bpo-37520: Correct behavior for zipfile.Path.parent (GH-14638)
* bpo-37520: Correct behavior for zipfile.Path.parent
* 📜🤖 Added by blurb_it.
Diffstat (limited to 'Lib/test/test_zipfile.py')
-rw-r--r-- | Lib/test/test_zipfile.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/test_zipfile.py b/Lib/test/test_zipfile.py index 19b550f..0c8ffcd 100644 --- a/Lib/test/test_zipfile.py +++ b/Lib/test/test_zipfile.py @@ -2514,5 +2514,16 @@ class TestPath(unittest.TestCase): assert (root / 'a').parent.at == '' assert (root / 'a' / 'b').parent.at == 'a/' + def test_dir_parent(self): + for zipfile_abcde in self.zipfile_abcde(): + root = zipfile.Path(zipfile_abcde) + assert (root / 'b').parent.at == '' + assert (root / 'b/').parent.at == '' + + def test_missing_dir_parent(self): + for zipfile_abcde in self.zipfile_abcde(): + root = zipfile.Path(zipfile_abcde) + assert (root / 'missing dir/').parent.at == '' + if __name__ == "__main__": unittest.main() |