mirror of
https://github.com/python/cpython.git
synced 2025-08-18 07:41:05 +00:00
[3.12] gh-106752: Move zipfile._path into its own package (GH-106753) (#106755)
* gh-106752: Move zipfile._path into its own package so it may have supplementary behavior.
* Add blurb.
(cherry picked from commit 03185f0c15
)
This commit is contained in:
parent
dfdded6beb
commit
30f62748e9
11 changed files with 5 additions and 2 deletions
24
Lib/test/test_zipfile/_path/test_complexity.py
Normal file
24
Lib/test/test_zipfile/_path/test_complexity.py
Normal file
|
@ -0,0 +1,24 @@
|
|||
import unittest
|
||||
import string
|
||||
import zipfile
|
||||
|
||||
from ._functools import compose
|
||||
from ._itertools import consume
|
||||
|
||||
from ._support import import_or_skip
|
||||
|
||||
|
||||
big_o = import_or_skip('big_o')
|
||||
|
||||
|
||||
class TestComplexity(unittest.TestCase):
|
||||
def test_implied_dirs_performance(self):
|
||||
best, others = big_o.big_o(
|
||||
compose(consume, zipfile.CompleteDirs._implied_dirs),
|
||||
lambda size: [
|
||||
'/'.join(string.ascii_lowercase + str(n)) for n in range(size)
|
||||
],
|
||||
max_n=1000,
|
||||
min_n=1,
|
||||
)
|
||||
assert best <= big_o.complexities.Linear
|
Loading…
Add table
Add a link
Reference in a new issue