summaryrefslogtreecommitdiff
path: root/passlib/tests/backports.py
Commit message (Collapse)AuthorAgeFilesLines
* cleanup old python compat -- removed PY26 conditional, and unittest2 imports.Eli Collins2020-10-061-66/+0
| | | | removing unittest2 also allowed removing "passlib.tests.backports"
* cleanup old python compat -- removed all "from __future__" importsEli Collins2020-10-061-1/+0
|
* passlib.apache: adjust default context to use "2y" bcrypt hashes instead of "2b"Eli Collins2019-11-111-1/+3
| | | | | | | (fixes issue 95). also added UT which checks behavior against locally-installed 'htpasswd' tool (if available).
* passlib.tests -- clean ups of os_crypt & general backend handlingEli Collins2015-07-231-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * moved utils.patchAttr() function to TestCase.patchAttr(), redid a bunch of manual monkeypatches to use .patchAttr() method. * temporary_backend() hack replaced by subcls.using(), so temporary backend use will be threadsafe (needed for concurrent tests). * HandlerCase.create_backend_cases() replaced with HandlerCase.create_backend_case(), all calls split out to make individual calls for each backend. Easier to read in diffs going forward when backends added/removed. * moved os_crypt specific code w/in create_backend_case() to OsCryptMixin, which just subclasses the method it needs to modify. allowed removing find_crypt_replacement() method entirely; decision to skip backend now directly uses OsCryptMixin's own logic. * fuzz_verifier_crypt() cleanups - moved to OsCryptMixin; removing .using_patched_crypt ref from HandlerCase - has_crypt_support() helper rolled into method, was only caller. - os_supports_ident() refactored into crypt_supports_variant(). fuzz_verified_crypt() is (now) the only caller. * bcrypt's crypt_supports_variant() now uses actual test of crypt() rather than hardcoded list of supported values. * fuzz verifier now handlers hashes throwing SkipTest. * utils.has_crypt_support() rolled into
* renamed compat helper 'base_string_types' -> 'unicode_or_bytes_types' for ↵Eli Collins2015-01-231-1/+1
| | | | clarity.
* more post-py25/31 cleanupsEli Collins2015-01-231-2/+2
| | | | | | | | * removed exc_err() compat helper, can now use "Exception as err" * next_method_attr replaced by nextgetter(), which seems a little cleaner * removed py30/31 alias for SafeConfigParser * put some PY26 features behind PY26 compat flag * removed PY25 from setup classifiers
* removed a LOT of compatibility shims -- dropped python 2.5, 3.0, and 3.1 ↵Eli Collins2015-01-101-280/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | support; as well as PyPy 1.x and Jython 2.5. shims removed ------------- * b() shim replaced with b'' (py25) * 'bytes' alias no longer needed (py25) * callable() shim no longer needed (py30,31) * PY_MIN_32 flag replaced with PY3 flag (py30,31) * removed 'abc' module stub used by passlib.ifc (py25) * removed chain_from_iterable() backport (py25) * tests: removed catch_warnings() backport, replaced refs with real warnings.catch_warnings() (py25) * tests: removed unittest2 backports (py25, py30, py31) -- now throw hard error if unittest2 not present under py26 (the only release remaining which lacks the unittest2 features) * removed SUPPORTS_DIR_METHOD conditional (py25, pypy 1.x) * some other minor workarounds other ----- * added check in passlib.compat which now throws error telling user version isn't supported (to prevent spurious errors later)
* fix two minor bugs in unittests (closes issue 46)Eli Collins2013-04-061-1/+1
|
* project-wide whitespace & comment cleanup (it's been a couple of years)Eli Collins2012-08-011-20/+20
|
* unittest cleanups, better coverage, etcEli Collins2012-04-301-0/+329
* split ut2 backports into separate module to keep them distinct from customizations * added backport of skip() / skipIf(), simplified a bunch of code * "PASSLIB_TESTS" env var renamed to "PASSLIB_TEST_MODE", has one of three values (quick,default,full) * assertWarningList() can now be used as context manager * added TestCase.mktemp(), and some capability tests via TestCase.require_xxx() * HandlerCase - subclasses can now modify do_xxx() settings and context using unified interface. - defaults to lower number of rounds for all hashes, to speed up UTs - create_backend_case() is now classmethod that yields multiple backends - added test to ensure os_crypt hashes forbid NULL chars - EncodingHandlerMixin for common tests of 'encoding' keyword