-
-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
87 additions
and
50 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import importlib | ||
import unittest | ||
|
||
|
||
def import_or_skip(name): | ||
try: | ||
return importlib.import_module(name) | ||
except ImportError: # pragma: no cover | ||
raise unittest.SkipTest(f'Unable to import {name}') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters