Server IP : 85.214.239.14 / Your IP : 3.21.244.34 Web Server : Apache/2.4.62 (Debian) System : Linux h2886529.stratoserver.net 4.9.0 #1 SMP Tue Jan 9 19:45:01 MSK 2024 x86_64 User : www-data ( 33) PHP Version : 7.4.18 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : OFF | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /lib/python3/dist-packages/passlib/tests/ |
Upload File : |
"""passlib.tests.tox_support - helper script for tox tests""" #============================================================================= # init script env #============================================================================= import os, sys root_dir = os.path.join(os.path.dirname(__file__), os.pardir, os.pardir) sys.path.insert(0, root_dir) #============================================================================= # imports #============================================================================= # core import re import logging; log = logging.getLogger(__name__) # site # pkg from passlib.utils.compat import print_ # local __all__ = [ ] #============================================================================= # main #============================================================================= TH_PATH = "passlib.tests.test_handlers" def do_hash_tests(*args): """return list of hash algorithm tests that match regexes""" if not args: print(TH_PATH) return suffix = '' args = list(args) while True: if args[0] == "--method": suffix = '.' + args[1] del args[:2] else: break from passlib.tests import test_handlers names = [TH_PATH + ":" + name + suffix for name in dir(test_handlers) if not name.startswith("_") and any(re.match(arg,name) for arg in args)] print_("\n".join(names)) return not names def do_preset_tests(name): """return list of preset test names""" if name == "django" or name == "django-hashes": do_hash_tests("django_.*_test", "hex_md5_test") if name == "django": print_("passlib.tests.test_ext_django") else: raise ValueError("unknown name: %r" % name) def do_setup_gae(path, runtime): """write fake GAE ``app.yaml`` to current directory so nosegae will work""" from passlib.tests.utils import set_file set_file(os.path.join(path, "app.yaml"), """\ application: fake-app version: 2 runtime: %s api_version: 1 threadsafe: no handlers: - url: /.* script: dummy.py libraries: - name: django version: "latest" """ % runtime) def main(cmd, *args): return globals()["do_" + cmd](*args) if __name__ == "__main__": import sys sys.exit(main(*sys.argv[1:]) or 0) #============================================================================= # eof #=============================================================================