com.googler.python 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +7 -0
- package/python3 +6 -0
- package/python3.4.2/bin/2to3 +5 -0
- package/python3.4.2/bin/2to3-3.4 +5 -0
- package/python3.4.2/bin/android-debian-builder +10 -0
- package/python3.4.2/bin/easy_install-3.4 +11 -0
- package/python3.4.2/bin/idle3 +5 -0
- package/python3.4.2/bin/idle3.4 +5 -0
- package/python3.4.2/bin/pip3 +11 -0
- package/python3.4.2/bin/pip3.4 +11 -0
- package/python3.4.2/bin/pydoc3 +5 -0
- package/python3.4.2/bin/pydoc3.4 +5 -0
- package/python3.4.2/bin/python3-config +111 -0
- package/python3.4.2/bin/python3.4 +0 -0
- package/python3.4.2/bin/python3.4-config +111 -0
- package/python3.4.2/bin/python3.4m-config +111 -0
- package/python3.4.2/bin/pyvenv +11 -0
- package/python3.4.2/bin/pyvenv-3.4 +11 -0
- package/python3.4.2/include/python3.4m/Python-ast.h +569 -0
- package/python3.4.2/include/python3.4m/Python.h +133 -0
- package/python3.4.2/include/python3.4m/abstract.h +1267 -0
- package/python3.4.2/include/python3.4m/accu.h +37 -0
- package/python3.4.2/include/python3.4m/asdl.h +45 -0
- package/python3.4.2/include/python3.4m/ast.h +22 -0
- package/python3.4.2/include/python3.4m/bitset.h +32 -0
- package/python3.4.2/include/python3.4m/bltinmodule.h +14 -0
- package/python3.4.2/include/python3.4m/boolobject.h +34 -0
- package/python3.4.2/include/python3.4m/bytearrayobject.h +62 -0
- package/python3.4.2/include/python3.4m/bytes_methods.h +46 -0
- package/python3.4.2/include/python3.4m/bytesobject.h +128 -0
- package/python3.4.2/include/python3.4m/cellobject.h +29 -0
- package/python3.4.2/include/python3.4m/ceval.h +205 -0
- package/python3.4.2/include/python3.4m/classobject.h +58 -0
- package/python3.4.2/include/python3.4m/code.h +115 -0
- package/python3.4.2/include/python3.4m/codecs.h +233 -0
- package/python3.4.2/include/python3.4m/compile.h +72 -0
- package/python3.4.2/include/python3.4m/complexobject.h +77 -0
- package/python3.4.2/include/python3.4m/datetime.h +243 -0
- package/python3.4.2/include/python3.4m/descrobject.h +105 -0
- package/python3.4.2/include/python3.4m/dictobject.h +126 -0
- package/python3.4.2/include/python3.4m/dtoa.h +19 -0
- package/python3.4.2/include/python3.4m/dynamic_annotations.h +499 -0
- package/python3.4.2/include/python3.4m/enumobject.h +17 -0
- package/python3.4.2/include/python3.4m/errcode.h +38 -0
- package/python3.4.2/include/python3.4m/eval.h +27 -0
- package/python3.4.2/include/python3.4m/fileobject.h +58 -0
- package/python3.4.2/include/python3.4m/fileutils.h +79 -0
- package/python3.4.2/include/python3.4m/floatobject.h +128 -0
- package/python3.4.2/include/python3.4m/frameobject.h +95 -0
- package/python3.4.2/include/python3.4m/funcobject.h +89 -0
- package/python3.4.2/include/python3.4m/genobject.h +46 -0
- package/python3.4.2/include/python3.4m/graminit.h +84 -0
- package/python3.4.2/include/python3.4m/grammar.h +93 -0
- package/python3.4.2/include/python3.4m/import.h +130 -0
- package/python3.4.2/include/python3.4m/intrcheck.h +21 -0
- package/python3.4.2/include/python3.4m/iterobject.h +25 -0
- package/python3.4.2/include/python3.4m/listobject.h +80 -0
- package/python3.4.2/include/python3.4m/longintrepr.h +103 -0
- package/python3.4.2/include/python3.4m/longobject.h +204 -0
- package/python3.4.2/include/python3.4m/marshal.h +28 -0
- package/python3.4.2/include/python3.4m/memoryobject.h +74 -0
- package/python3.4.2/include/python3.4m/metagrammar.h +18 -0
- package/python3.4.2/include/python3.4m/methodobject.h +93 -0
- package/python3.4.2/include/python3.4m/modsupport.h +132 -0
- package/python3.4.2/include/python3.4m/moduleobject.h +63 -0
- package/python3.4.2/include/python3.4m/namespaceobject.h +17 -0
- package/python3.4.2/include/python3.4m/node.h +44 -0
- package/python3.4.2/include/python3.4m/object.h +1015 -0
- package/python3.4.2/include/python3.4m/objimpl.h +361 -0
- package/python3.4.2/include/python3.4m/opcode.h +159 -0
- package/python3.4.2/include/python3.4m/osdefs.h +50 -0
- package/python3.4.2/include/python3.4m/parsetok.h +108 -0
- package/python3.4.2/include/python3.4m/patchlevel.h +35 -0
- package/python3.4.2/include/python3.4m/pgen.h +18 -0
- package/python3.4.2/include/python3.4m/pgenheaders.h +42 -0
- package/python3.4.2/include/python3.4m/py_curses.h +177 -0
- package/python3.4.2/include/python3.4m/pyarena.h +64 -0
- package/python3.4.2/include/python3.4m/pyatomic.h +184 -0
- package/python3.4.2/include/python3.4m/pycapsule.h +59 -0
- package/python3.4.2/include/python3.4m/pyconfig.h +1503 -0
- package/python3.4.2/include/python3.4m/pyctype.h +33 -0
- package/python3.4.2/include/python3.4m/pydebug.h +34 -0
- package/python3.4.2/include/python3.4m/pyerrors.h +464 -0
- package/python3.4.2/include/python3.4m/pyexpat.h +53 -0
- package/python3.4.2/include/python3.4m/pyfpe.h +176 -0
- package/python3.4.2/include/python3.4m/pygetopt.h +21 -0
- package/python3.4.2/include/python3.4m/pyhash.h +149 -0
- package/python3.4.2/include/python3.4m/pymacconfig.h +102 -0
- package/python3.4.2/include/python3.4m/pymacro.h +78 -0
- package/python3.4.2/include/python3.4m/pymath.h +190 -0
- package/python3.4.2/include/python3.4m/pymem.h +183 -0
- package/python3.4.2/include/python3.4m/pyport.h +883 -0
- package/python3.4.2/include/python3.4m/pystate.h +271 -0
- package/python3.4.2/include/python3.4m/pystrcmp.h +23 -0
- package/python3.4.2/include/python3.4m/pystrtod.h +41 -0
- package/python3.4.2/include/python3.4m/pythonrun.h +304 -0
- package/python3.4.2/include/python3.4m/pythread.h +93 -0
- package/python3.4.2/include/python3.4m/pytime.h +105 -0
- package/python3.4.2/include/python3.4m/rangeobject.h +27 -0
- package/python3.4.2/include/python3.4m/setobject.h +113 -0
- package/python3.4.2/include/python3.4m/sliceobject.h +50 -0
- package/python3.4.2/include/python3.4m/structmember.h +76 -0
- package/python3.4.2/include/python3.4m/structseq.h +49 -0
- package/python3.4.2/include/python3.4m/symtable.h +122 -0
- package/python3.4.2/include/python3.4m/sysmodule.h +43 -0
- package/python3.4.2/include/python3.4m/token.h +87 -0
- package/python3.4.2/include/python3.4m/traceback.h +72 -0
- package/python3.4.2/include/python3.4m/tupleobject.h +73 -0
- package/python3.4.2/include/python3.4m/typeslots.h +76 -0
- package/python3.4.2/include/python3.4m/ucnhash.h +36 -0
- package/python3.4.2/include/python3.4m/unicodeobject.h +2271 -0
- package/python3.4.2/include/python3.4m/warnings.h +54 -0
- package/python3.4.2/include/python3.4m/weakrefobject.h +86 -0
- package/python3.4.2/lib/pkgconfig/python-3.4.pc +13 -0
- package/python3.4.2/lib/pkgconfig/python-3.4m.pc +13 -0
- package/python3.4.2/lib/pkgconfig/python3.pc +13 -0
- package/python3.4.2/lib/python3.4/LICENSE.txt +254 -0
- package/python3.4.2/lib/python3.4/__future__.py +134 -0
- package/python3.4.2/lib/python3.4/__phello__.foo.py +1 -0
- package/python3.4.2/lib/python3.4/__pycache__/_bootlocale.cpython-34.pyc +0 -0
- package/python3.4.2/lib/python3.4/__pycache__/_collections_abc.cpython-34.pyc +0 -0
- package/python3.4.2/lib/python3.4/__pycache__/_sitebuiltins.cpython-34.pyc +0 -0
- package/python3.4.2/lib/python3.4/__pycache__/_sysconfigdata.cpython-34.pyc +0 -0
- package/python3.4.2/lib/python3.4/__pycache__/_weakrefset.cpython-34.pyc +0 -0
- package/python3.4.2/lib/python3.4/__pycache__/abc.cpython-34.pyc +0 -0
- package/python3.4.2/lib/python3.4/__pycache__/codecs.cpython-34.pyc +0 -0
- package/python3.4.2/lib/python3.4/__pycache__/genericpath.cpython-34.pyc +0 -0
- package/python3.4.2/lib/python3.4/__pycache__/io.cpython-34.pyc +0 -0
- package/python3.4.2/lib/python3.4/__pycache__/os.cpython-34.pyc +0 -0
- package/python3.4.2/lib/python3.4/__pycache__/posixpath.cpython-34.pyc +0 -0
- package/python3.4.2/lib/python3.4/__pycache__/rlcompleter.cpython-34.pyc +0 -0
- package/python3.4.2/lib/python3.4/__pycache__/site.cpython-34.pyc +0 -0
- package/python3.4.2/lib/python3.4/__pycache__/stat.cpython-34.pyc +0 -0
- package/python3.4.2/lib/python3.4/__pycache__/sysconfig.cpython-34.pyc +0 -0
- package/python3.4.2/lib/python3.4/_bootlocale.py +34 -0
- package/python3.4.2/lib/python3.4/_collections_abc.py +753 -0
- package/python3.4.2/lib/python3.4/_compat_pickle.py +137 -0
- package/python3.4.2/lib/python3.4/_dummy_thread.py +155 -0
- package/python3.4.2/lib/python3.4/_markupbase.py +395 -0
- package/python3.4.2/lib/python3.4/_osx_support.py +502 -0
- package/python3.4.2/lib/python3.4/_pyio.py +2105 -0
- package/python3.4.2/lib/python3.4/_sitebuiltins.py +103 -0
- package/python3.4.2/lib/python3.4/_strptime.py +511 -0
- package/python3.4.2/lib/python3.4/_sysconfigdata.py +710 -0
- package/python3.4.2/lib/python3.4/_threading_local.py +246 -0
- package/python3.4.2/lib/python3.4/_weakrefset.py +196 -0
- package/python3.4.2/lib/python3.4/abc.py +248 -0
- package/python3.4.2/lib/python3.4/aifc.py +918 -0
- package/python3.4.2/lib/python3.4/antigravity.py +17 -0
- package/python3.4.2/lib/python3.4/argparse.py +2379 -0
- package/python3.4.2/lib/python3.4/ast.py +315 -0
- package/python3.4.2/lib/python3.4/asynchat.py +333 -0
- package/python3.4.2/lib/python3.4/asyncio/__init__.py +48 -0
- package/python3.4.2/lib/python3.4/asyncio/base_events.py +1055 -0
- package/python3.4.2/lib/python3.4/asyncio/base_subprocess.py +197 -0
- package/python3.4.2/lib/python3.4/asyncio/constants.py +7 -0
- package/python3.4.2/lib/python3.4/asyncio/coroutines.py +195 -0
- package/python3.4.2/lib/python3.4/asyncio/events.py +586 -0
- package/python3.4.2/lib/python3.4/asyncio/futures.py +411 -0
- package/python3.4.2/lib/python3.4/asyncio/locks.py +469 -0
- package/python3.4.2/lib/python3.4/asyncio/log.py +7 -0
- package/python3.4.2/lib/python3.4/asyncio/proactor_events.py +499 -0
- package/python3.4.2/lib/python3.4/asyncio/protocols.py +129 -0
- package/python3.4.2/lib/python3.4/asyncio/queues.py +288 -0
- package/python3.4.2/lib/python3.4/asyncio/selector_events.py +996 -0
- package/python3.4.2/lib/python3.4/asyncio/streams.py +485 -0
- package/python3.4.2/lib/python3.4/asyncio/subprocess.py +228 -0
- package/python3.4.2/lib/python3.4/asyncio/tasks.py +658 -0
- package/python3.4.2/lib/python3.4/asyncio/test_utils.py +425 -0
- package/python3.4.2/lib/python3.4/asyncio/transports.py +298 -0
- package/python3.4.2/lib/python3.4/asyncio/unix_events.py +922 -0
- package/python3.4.2/lib/python3.4/asyncio/windows_events.py +634 -0
- package/python3.4.2/lib/python3.4/asyncio/windows_utils.py +207 -0
- package/python3.4.2/lib/python3.4/asyncore.py +666 -0
- package/python3.4.2/lib/python3.4/base64.py +602 -0
- package/python3.4.2/lib/python3.4/bdb.py +673 -0
- package/python3.4.2/lib/python3.4/binhex.py +471 -0
- package/python3.4.2/lib/python3.4/bisect.py +92 -0
- package/python3.4.2/lib/python3.4/bz2.py +521 -0
- package/python3.4.2/lib/python3.4/cProfile.py +160 -0
- package/python3.4.2/lib/python3.4/calendar.py +703 -0
- package/python3.4.2/lib/python3.4/cgi.py +1061 -0
- package/python3.4.2/lib/python3.4/cgitb.py +320 -0
- package/python3.4.2/lib/python3.4/chunk.py +167 -0
- package/python3.4.2/lib/python3.4/cmd.py +401 -0
- package/python3.4.2/lib/python3.4/code.py +302 -0
- package/python3.4.2/lib/python3.4/codecs.py +1110 -0
- package/python3.4.2/lib/python3.4/codeop.py +168 -0
- package/python3.4.2/lib/python3.4/collections/__init__.py +1132 -0
- package/python3.4.2/lib/python3.4/collections/__main__.py +38 -0
- package/python3.4.2/lib/python3.4/collections/abc.py +2 -0
- package/python3.4.2/lib/python3.4/colorsys.py +164 -0
- package/python3.4.2/lib/python3.4/compileall.py +241 -0
- package/python3.4.2/lib/python3.4/concurrent/__init__.py +1 -0
- package/python3.4.2/lib/python3.4/concurrent/futures/__init__.py +18 -0
- package/python3.4.2/lib/python3.4/concurrent/futures/_base.py +575 -0
- package/python3.4.2/lib/python3.4/concurrent/futures/process.py +427 -0
- package/python3.4.2/lib/python3.4/concurrent/futures/thread.py +132 -0
- package/python3.4.2/lib/python3.4/config-3.4m/Makefile +1835 -0
- package/python3.4.2/lib/python3.4/config-3.4m/Setup +466 -0
- package/python3.4.2/lib/python3.4/config-3.4m/Setup.config +13 -0
- package/python3.4.2/lib/python3.4/config-3.4m/Setup.local +1 -0
- package/python3.4.2/lib/python3.4/config-3.4m/config.c +234 -0
- package/python3.4.2/lib/python3.4/config-3.4m/config.c.in +67 -0
- package/python3.4.2/lib/python3.4/config-3.4m/install-sh +294 -0
- package/python3.4.2/lib/python3.4/config-3.4m/makesetup +293 -0
- package/python3.4.2/lib/python3.4/config-3.4m/python-config.py +68 -0
- package/python3.4.2/lib/python3.4/configparser.py +1254 -0
- package/python3.4.2/lib/python3.4/contextlib.py +340 -0
- package/python3.4.2/lib/python3.4/copy.py +333 -0
- package/python3.4.2/lib/python3.4/copyreg.py +202 -0
- package/python3.4.2/lib/python3.4/crypt.py +62 -0
- package/python3.4.2/lib/python3.4/csv.py +449 -0
- package/python3.4.2/lib/python3.4/ctypes/__init__.py +541 -0
- package/python3.4.2/lib/python3.4/ctypes/_endian.py +59 -0
- package/python3.4.2/lib/python3.4/ctypes/macholib/README.ctypes +7 -0
- package/python3.4.2/lib/python3.4/ctypes/macholib/__init__.py +9 -0
- package/python3.4.2/lib/python3.4/ctypes/macholib/dyld.py +158 -0
- package/python3.4.2/lib/python3.4/ctypes/macholib/dylib.py +63 -0
- package/python3.4.2/lib/python3.4/ctypes/macholib/fetch_macholib +2 -0
- package/python3.4.2/lib/python3.4/ctypes/macholib/fetch_macholib.bat +1 -0
- package/python3.4.2/lib/python3.4/ctypes/macholib/framework.py +65 -0
- package/python3.4.2/lib/python3.4/ctypes/test/__init__.py +14 -0
- package/python3.4.2/lib/python3.4/ctypes/test/__main__.py +4 -0
- package/python3.4.2/lib/python3.4/ctypes/test/test_anon.py +60 -0
- package/python3.4.2/lib/python3.4/ctypes/test/test_array_in_pointer.py +64 -0
- package/python3.4.2/lib/python3.4/ctypes/test/test_arrays.py +181 -0
- package/python3.4.2/lib/python3.4/ctypes/test/test_as_parameter.py +226 -0
- package/python3.4.2/lib/python3.4/ctypes/test/test_bitfields.py +263 -0
- package/python3.4.2/lib/python3.4/ctypes/test/test_buffers.py +64 -0
- package/python3.4.2/lib/python3.4/ctypes/test/test_bytes.py +65 -0
- package/python3.4.2/lib/python3.4/ctypes/test/test_byteswap.py +295 -0
- package/python3.4.2/lib/python3.4/ctypes/test/test_callbacks.py +247 -0
- package/python3.4.2/lib/python3.4/ctypes/test/test_cast.py +86 -0
- package/python3.4.2/lib/python3.4/ctypes/test/test_cfuncs.py +212 -0
- package/python3.4.2/lib/python3.4/ctypes/test/test_checkretval.py +36 -0
- package/python3.4.2/lib/python3.4/ctypes/test/test_delattr.py +21 -0
- package/python3.4.2/lib/python3.4/ctypes/test/test_errno.py +79 -0
- package/python3.4.2/lib/python3.4/ctypes/test/test_find.py +81 -0
- package/python3.4.2/lib/python3.4/ctypes/test/test_frombuffer.py +81 -0
- package/python3.4.2/lib/python3.4/ctypes/test/test_funcptr.py +127 -0
- package/python3.4.2/lib/python3.4/ctypes/test/test_functions.py +402 -0
- package/python3.4.2/lib/python3.4/ctypes/test/test_incomplete.py +42 -0
- package/python3.4.2/lib/python3.4/ctypes/test/test_init.py +40 -0
- package/python3.4.2/lib/python3.4/ctypes/test/test_internals.py +100 -0
- package/python3.4.2/lib/python3.4/ctypes/test/test_keeprefs.py +153 -0
- package/python3.4.2/lib/python3.4/ctypes/test/test_libc.py +33 -0
- package/python3.4.2/lib/python3.4/ctypes/test/test_loading.py +119 -0
- package/python3.4.2/lib/python3.4/ctypes/test/test_macholib.py +63 -0
- package/python3.4.2/lib/python3.4/ctypes/test/test_memfunctions.py +79 -0
- package/python3.4.2/lib/python3.4/ctypes/test/test_numbers.py +290 -0
- package/python3.4.2/lib/python3.4/ctypes/test/test_objects.py +67 -0
- package/python3.4.2/lib/python3.4/ctypes/test/test_parameters.py +176 -0
- package/python3.4.2/lib/python3.4/ctypes/test/test_pep3118.py +206 -0
- package/python3.4.2/lib/python3.4/ctypes/test/test_pickling.py +83 -0
- package/python3.4.2/lib/python3.4/ctypes/test/test_pointers.py +192 -0
- package/python3.4.2/lib/python3.4/ctypes/test/test_prototypes.py +219 -0
- package/python3.4.2/lib/python3.4/ctypes/test/test_python_api.py +89 -0
- package/python3.4.2/lib/python3.4/ctypes/test/test_random_things.py +74 -0
- package/python3.4.2/lib/python3.4/ctypes/test/test_refcounts.py +101 -0
- package/python3.4.2/lib/python3.4/ctypes/test/test_repr.py +29 -0
- package/python3.4.2/lib/python3.4/ctypes/test/test_returnfuncptrs.py +67 -0
- package/python3.4.2/lib/python3.4/ctypes/test/test_simplesubclasses.py +55 -0
- package/python3.4.2/lib/python3.4/ctypes/test/test_sizes.py +34 -0
- package/python3.4.2/lib/python3.4/ctypes/test/test_slicing.py +167 -0
- package/python3.4.2/lib/python3.4/ctypes/test/test_stringptr.py +77 -0
- package/python3.4.2/lib/python3.4/ctypes/test/test_strings.py +225 -0
- package/python3.4.2/lib/python3.4/ctypes/test/test_struct_fields.py +50 -0
- package/python3.4.2/lib/python3.4/ctypes/test/test_structures.py +468 -0
- package/python3.4.2/lib/python3.4/ctypes/test/test_unaligned_structures.py +45 -0
- package/python3.4.2/lib/python3.4/ctypes/test/test_unicode.py +56 -0
- package/python3.4.2/lib/python3.4/ctypes/test/test_values.py +95 -0
- package/python3.4.2/lib/python3.4/ctypes/test/test_varsize_struct.py +50 -0
- package/python3.4.2/lib/python3.4/ctypes/test/test_win32.py +119 -0
- package/python3.4.2/lib/python3.4/ctypes/test/test_wintypes.py +41 -0
- package/python3.4.2/lib/python3.4/ctypes/util.py +267 -0
- package/python3.4.2/lib/python3.4/ctypes/wintypes.py +202 -0
- package/python3.4.2/lib/python3.4/curses/__init__.py +101 -0
- package/python3.4.2/lib/python3.4/curses/ascii.py +99 -0
- package/python3.4.2/lib/python3.4/curses/has_key.py +192 -0
- package/python3.4.2/lib/python3.4/curses/panel.py +6 -0
- package/python3.4.2/lib/python3.4/curses/textpad.py +188 -0
- package/python3.4.2/lib/python3.4/datetime.py +2136 -0
- package/python3.4.2/lib/python3.4/dbm/__init__.py +188 -0
- package/python3.4.2/lib/python3.4/dbm/dumb.py +291 -0
- package/python3.4.2/lib/python3.4/dbm/gnu.py +3 -0
- package/python3.4.2/lib/python3.4/dbm/ndbm.py +3 -0
- package/python3.4.2/lib/python3.4/decimal.py +6414 -0
- package/python3.4.2/lib/python3.4/difflib.py +2039 -0
- package/python3.4.2/lib/python3.4/dis.py +475 -0
- package/python3.4.2/lib/python3.4/distutils/README +13 -0
- package/python3.4.2/lib/python3.4/distutils/__init__.py +17 -0
- package/python3.4.2/lib/python3.4/distutils/archive_util.py +245 -0
- package/python3.4.2/lib/python3.4/distutils/bcppcompiler.py +393 -0
- package/python3.4.2/lib/python3.4/distutils/ccompiler.py +1115 -0
- package/python3.4.2/lib/python3.4/distutils/cmd.py +435 -0
- package/python3.4.2/lib/python3.4/distutils/command/__init__.py +31 -0
- package/python3.4.2/lib/python3.4/distutils/command/bdist.py +142 -0
- package/python3.4.2/lib/python3.4/distutils/command/bdist_dumb.py +122 -0
- package/python3.4.2/lib/python3.4/distutils/command/bdist_msi.py +741 -0
- package/python3.4.2/lib/python3.4/distutils/command/bdist_rpm.py +582 -0
- package/python3.4.2/lib/python3.4/distutils/command/bdist_wininst.py +349 -0
- package/python3.4.2/lib/python3.4/distutils/command/build.py +148 -0
- package/python3.4.2/lib/python3.4/distutils/command/build_clib.py +209 -0
- package/python3.4.2/lib/python3.4/distutils/command/build_ext.py +735 -0
- package/python3.4.2/lib/python3.4/distutils/command/build_py.py +416 -0
- package/python3.4.2/lib/python3.4/distutils/command/build_scripts.py +160 -0
- package/python3.4.2/lib/python3.4/distutils/command/check.py +145 -0
- package/python3.4.2/lib/python3.4/distutils/command/clean.py +76 -0
- package/python3.4.2/lib/python3.4/distutils/command/command_template +33 -0
- package/python3.4.2/lib/python3.4/distutils/command/config.py +347 -0
- package/python3.4.2/lib/python3.4/distutils/command/install.py +650 -0
- package/python3.4.2/lib/python3.4/distutils/command/install_data.py +79 -0
- package/python3.4.2/lib/python3.4/distutils/command/install_egg_info.py +77 -0
- package/python3.4.2/lib/python3.4/distutils/command/install_headers.py +47 -0
- package/python3.4.2/lib/python3.4/distutils/command/install_lib.py +217 -0
- package/python3.4.2/lib/python3.4/distutils/command/install_scripts.py +60 -0
- package/python3.4.2/lib/python3.4/distutils/command/register.py +304 -0
- package/python3.4.2/lib/python3.4/distutils/command/sdist.py +467 -0
- package/python3.4.2/lib/python3.4/distutils/command/upload.py +202 -0
- package/python3.4.2/lib/python3.4/distutils/command/wininst-10.0-amd64.exe +0 -0
- package/python3.4.2/lib/python3.4/distutils/command/wininst-10.0.exe +0 -0
- package/python3.4.2/lib/python3.4/distutils/command/wininst-6.0.exe +0 -0
- package/python3.4.2/lib/python3.4/distutils/command/wininst-7.1.exe +0 -0
- package/python3.4.2/lib/python3.4/distutils/command/wininst-8.0.exe +0 -0
- package/python3.4.2/lib/python3.4/distutils/command/wininst-9.0-amd64.exe +0 -0
- package/python3.4.2/lib/python3.4/distutils/command/wininst-9.0.exe +0 -0
- package/python3.4.2/lib/python3.4/distutils/config.py +131 -0
- package/python3.4.2/lib/python3.4/distutils/core.py +237 -0
- package/python3.4.2/lib/python3.4/distutils/cygwinccompiler.py +405 -0
- package/python3.4.2/lib/python3.4/distutils/debug.py +5 -0
- package/python3.4.2/lib/python3.4/distutils/dep_util.py +92 -0
- package/python3.4.2/lib/python3.4/distutils/dir_util.py +210 -0
- package/python3.4.2/lib/python3.4/distutils/dist.py +1238 -0
- package/python3.4.2/lib/python3.4/distutils/errors.py +97 -0
- package/python3.4.2/lib/python3.4/distutils/extension.py +233 -0
- package/python3.4.2/lib/python3.4/distutils/fancy_getopt.py +457 -0
- package/python3.4.2/lib/python3.4/distutils/file_util.py +230 -0
- package/python3.4.2/lib/python3.4/distutils/filelist.py +328 -0
- package/python3.4.2/lib/python3.4/distutils/log.py +75 -0
- package/python3.4.2/lib/python3.4/distutils/msvc9compiler.py +788 -0
- package/python3.4.2/lib/python3.4/distutils/msvccompiler.py +640 -0
- package/python3.4.2/lib/python3.4/distutils/spawn.py +195 -0
- package/python3.4.2/lib/python3.4/distutils/sysconfig.py +562 -0
- package/python3.4.2/lib/python3.4/distutils/tests/Setup.sample +67 -0
- package/python3.4.2/lib/python3.4/distutils/tests/__init__.py +36 -0
- package/python3.4.2/lib/python3.4/distutils/tests/support.py +210 -0
- package/python3.4.2/lib/python3.4/distutils/tests/test_archive_util.py +341 -0
- package/python3.4.2/lib/python3.4/distutils/tests/test_bdist.py +50 -0
- package/python3.4.2/lib/python3.4/distutils/tests/test_bdist_dumb.py +97 -0
- package/python3.4.2/lib/python3.4/distutils/tests/test_bdist_msi.py +25 -0
- package/python3.4.2/lib/python3.4/distutils/tests/test_bdist_rpm.py +134 -0
- package/python3.4.2/lib/python3.4/distutils/tests/test_bdist_wininst.py +31 -0
- package/python3.4.2/lib/python3.4/distutils/tests/test_build.py +55 -0
- package/python3.4.2/lib/python3.4/distutils/tests/test_build_clib.py +143 -0
- package/python3.4.2/lib/python3.4/distutils/tests/test_build_ext.py +488 -0
- package/python3.4.2/lib/python3.4/distutils/tests/test_build_py.py +178 -0
- package/python3.4.2/lib/python3.4/distutils/tests/test_build_scripts.py +112 -0
- package/python3.4.2/lib/python3.4/distutils/tests/test_check.py +106 -0
- package/python3.4.2/lib/python3.4/distutils/tests/test_clean.py +51 -0
- package/python3.4.2/lib/python3.4/distutils/tests/test_cmd.py +126 -0
- package/python3.4.2/lib/python3.4/distutils/tests/test_config.py +120 -0
- package/python3.4.2/lib/python3.4/distutils/tests/test_config_cmd.py +89 -0
- package/python3.4.2/lib/python3.4/distutils/tests/test_core.py +108 -0
- package/python3.4.2/lib/python3.4/distutils/tests/test_cygwinccompiler.py +155 -0
- package/python3.4.2/lib/python3.4/distutils/tests/test_dep_util.py +81 -0
- package/python3.4.2/lib/python3.4/distutils/tests/test_dir_util.py +139 -0
- package/python3.4.2/lib/python3.4/distutils/tests/test_dist.py +454 -0
- package/python3.4.2/lib/python3.4/distutils/tests/test_extension.py +69 -0
- package/python3.4.2/lib/python3.4/distutils/tests/test_file_util.py +85 -0
- package/python3.4.2/lib/python3.4/distutils/tests/test_filelist.py +299 -0
- package/python3.4.2/lib/python3.4/distutils/tests/test_install.py +246 -0
- package/python3.4.2/lib/python3.4/distutils/tests/test_install_data.py +77 -0
- package/python3.4.2/lib/python3.4/distutils/tests/test_install_headers.py +41 -0
- package/python3.4.2/lib/python3.4/distutils/tests/test_install_lib.py +115 -0
- package/python3.4.2/lib/python3.4/distutils/tests/test_install_scripts.py +82 -0
- package/python3.4.2/lib/python3.4/distutils/tests/test_log.py +37 -0
- package/python3.4.2/lib/python3.4/distutils/tests/test_msvc9compiler.py +184 -0
- package/python3.4.2/lib/python3.4/distutils/tests/test_register.py +309 -0
- package/python3.4.2/lib/python3.4/distutils/tests/test_sdist.py +484 -0
- package/python3.4.2/lib/python3.4/distutils/tests/test_spawn.py +58 -0
- package/python3.4.2/lib/python3.4/distutils/tests/test_sysconfig.py +207 -0
- package/python3.4.2/lib/python3.4/distutils/tests/test_text_file.py +107 -0
- package/python3.4.2/lib/python3.4/distutils/tests/test_unixccompiler.py +150 -0
- package/python3.4.2/lib/python3.4/distutils/tests/test_upload.py +151 -0
- package/python3.4.2/lib/python3.4/distutils/tests/test_util.py +300 -0
- package/python3.4.2/lib/python3.4/distutils/tests/test_version.py +71 -0
- package/python3.4.2/lib/python3.4/distutils/tests/test_versionpredicate.py +13 -0
- package/python3.4.2/lib/python3.4/distutils/tests/xxmodule.c +396 -0
- package/python3.4.2/lib/python3.4/distutils/text_file.py +285 -0
- package/python3.4.2/lib/python3.4/distutils/unixccompiler.py +298 -0
- package/python3.4.2/lib/python3.4/distutils/util.py +553 -0
- package/python3.4.2/lib/python3.4/distutils/version.py +349 -0
- package/python3.4.2/lib/python3.4/distutils/versionpredicate.py +166 -0
- package/python3.4.2/lib/python3.4/doctest.py +2793 -0
- package/python3.4.2/lib/python3.4/dummy_threading.py +78 -0
- package/python3.4.2/lib/python3.4/email/__init__.py +64 -0
- package/python3.4.2/lib/python3.4/email/_encoded_words.py +221 -0
- package/python3.4.2/lib/python3.4/email/_header_value_parser.py +2947 -0
- package/python3.4.2/lib/python3.4/email/_parseaddr.py +540 -0
- package/python3.4.2/lib/python3.4/email/_policybase.py +358 -0
- package/python3.4.2/lib/python3.4/email/architecture.rst +216 -0
- package/python3.4.2/lib/python3.4/email/base64mime.py +119 -0
- package/python3.4.2/lib/python3.4/email/charset.py +409 -0
- package/python3.4.2/lib/python3.4/email/contentmanager.py +249 -0
- package/python3.4.2/lib/python3.4/email/encoders.py +69 -0
- package/python3.4.2/lib/python3.4/email/errors.py +107 -0
- package/python3.4.2/lib/python3.4/email/feedparser.py +526 -0
- package/python3.4.2/lib/python3.4/email/generator.py +507 -0
- package/python3.4.2/lib/python3.4/email/header.py +581 -0
- package/python3.4.2/lib/python3.4/email/headerregistry.py +583 -0
- package/python3.4.2/lib/python3.4/email/iterators.py +71 -0
- package/python3.4.2/lib/python3.4/email/message.py +1147 -0
- package/python3.4.2/lib/python3.4/email/mime/__init__.py +0 -0
- package/python3.4.2/lib/python3.4/email/mime/application.py +36 -0
- package/python3.4.2/lib/python3.4/email/mime/audio.py +73 -0
- package/python3.4.2/lib/python3.4/email/mime/base.py +26 -0
- package/python3.4.2/lib/python3.4/email/mime/image.py +46 -0
- package/python3.4.2/lib/python3.4/email/mime/message.py +34 -0
- package/python3.4.2/lib/python3.4/email/mime/multipart.py +47 -0
- package/python3.4.2/lib/python3.4/email/mime/nonmultipart.py +22 -0
- package/python3.4.2/lib/python3.4/email/mime/text.py +41 -0
- package/python3.4.2/lib/python3.4/email/parser.py +132 -0
- package/python3.4.2/lib/python3.4/email/policy.py +201 -0
- package/python3.4.2/lib/python3.4/email/quoprimime.py +299 -0
- package/python3.4.2/lib/python3.4/email/utils.py +399 -0
- package/python3.4.2/lib/python3.4/encodings/__init__.py +152 -0
- package/python3.4.2/lib/python3.4/encodings/__pycache__/__init__.cpython-34.pyc +0 -0
- package/python3.4.2/lib/python3.4/encodings/__pycache__/aliases.cpython-34.pyc +0 -0
- package/python3.4.2/lib/python3.4/encodings/__pycache__/ascii.cpython-34.pyc +0 -0
- package/python3.4.2/lib/python3.4/encodings/__pycache__/latin_1.cpython-34.pyc +0 -0
- package/python3.4.2/lib/python3.4/encodings/__pycache__/utf_8.cpython-34.pyc +0 -0
- package/python3.4.2/lib/python3.4/encodings/aliases.py +544 -0
- package/python3.4.2/lib/python3.4/encodings/ascii.py +50 -0
- package/python3.4.2/lib/python3.4/encodings/base64_codec.py +55 -0
- package/python3.4.2/lib/python3.4/encodings/big5.py +39 -0
- package/python3.4.2/lib/python3.4/encodings/big5hkscs.py +39 -0
- package/python3.4.2/lib/python3.4/encodings/bz2_codec.py +78 -0
- package/python3.4.2/lib/python3.4/encodings/charmap.py +69 -0
- package/python3.4.2/lib/python3.4/encodings/cp037.py +307 -0
- package/python3.4.2/lib/python3.4/encodings/cp1006.py +307 -0
- package/python3.4.2/lib/python3.4/encodings/cp1026.py +307 -0
- package/python3.4.2/lib/python3.4/encodings/cp1125.py +698 -0
- package/python3.4.2/lib/python3.4/encodings/cp1140.py +307 -0
- package/python3.4.2/lib/python3.4/encodings/cp1250.py +307 -0
- package/python3.4.2/lib/python3.4/encodings/cp1251.py +307 -0
- package/python3.4.2/lib/python3.4/encodings/cp1252.py +307 -0
- package/python3.4.2/lib/python3.4/encodings/cp1253.py +307 -0
- package/python3.4.2/lib/python3.4/encodings/cp1254.py +307 -0
- package/python3.4.2/lib/python3.4/encodings/cp1255.py +307 -0
- package/python3.4.2/lib/python3.4/encodings/cp1256.py +307 -0
- package/python3.4.2/lib/python3.4/encodings/cp1257.py +307 -0
- package/python3.4.2/lib/python3.4/encodings/cp1258.py +307 -0
- package/python3.4.2/lib/python3.4/encodings/cp273.py +307 -0
- package/python3.4.2/lib/python3.4/encodings/cp424.py +307 -0
- package/python3.4.2/lib/python3.4/encodings/cp437.py +698 -0
- package/python3.4.2/lib/python3.4/encodings/cp500.py +307 -0
- package/python3.4.2/lib/python3.4/encodings/cp65001.py +40 -0
- package/python3.4.2/lib/python3.4/encodings/cp720.py +309 -0
- package/python3.4.2/lib/python3.4/encodings/cp737.py +698 -0
- package/python3.4.2/lib/python3.4/encodings/cp775.py +697 -0
- package/python3.4.2/lib/python3.4/encodings/cp850.py +698 -0
- package/python3.4.2/lib/python3.4/encodings/cp852.py +698 -0
- package/python3.4.2/lib/python3.4/encodings/cp855.py +698 -0
- package/python3.4.2/lib/python3.4/encodings/cp856.py +307 -0
- package/python3.4.2/lib/python3.4/encodings/cp857.py +694 -0
- package/python3.4.2/lib/python3.4/encodings/cp858.py +698 -0
- package/python3.4.2/lib/python3.4/encodings/cp860.py +698 -0
- package/python3.4.2/lib/python3.4/encodings/cp861.py +698 -0
- package/python3.4.2/lib/python3.4/encodings/cp862.py +698 -0
- package/python3.4.2/lib/python3.4/encodings/cp863.py +698 -0
- package/python3.4.2/lib/python3.4/encodings/cp864.py +690 -0
- package/python3.4.2/lib/python3.4/encodings/cp865.py +698 -0
- package/python3.4.2/lib/python3.4/encodings/cp866.py +698 -0
- package/python3.4.2/lib/python3.4/encodings/cp869.py +689 -0
- package/python3.4.2/lib/python3.4/encodings/cp874.py +307 -0
- package/python3.4.2/lib/python3.4/encodings/cp875.py +307 -0
- package/python3.4.2/lib/python3.4/encodings/cp932.py +39 -0
- package/python3.4.2/lib/python3.4/encodings/cp949.py +39 -0
- package/python3.4.2/lib/python3.4/encodings/cp950.py +39 -0
- package/python3.4.2/lib/python3.4/encodings/euc_jis_2004.py +39 -0
- package/python3.4.2/lib/python3.4/encodings/euc_jisx0213.py +39 -0
- package/python3.4.2/lib/python3.4/encodings/euc_jp.py +39 -0
- package/python3.4.2/lib/python3.4/encodings/euc_kr.py +39 -0
- package/python3.4.2/lib/python3.4/encodings/gb18030.py +39 -0
- package/python3.4.2/lib/python3.4/encodings/gb2312.py +39 -0
- package/python3.4.2/lib/python3.4/encodings/gbk.py +39 -0
- package/python3.4.2/lib/python3.4/encodings/hex_codec.py +55 -0
- package/python3.4.2/lib/python3.4/encodings/hp_roman8.py +312 -0
- package/python3.4.2/lib/python3.4/encodings/hz.py +39 -0
- package/python3.4.2/lib/python3.4/encodings/idna.py +309 -0
- package/python3.4.2/lib/python3.4/encodings/iso2022_jp.py +39 -0
- package/python3.4.2/lib/python3.4/encodings/iso2022_jp_1.py +39 -0
- package/python3.4.2/lib/python3.4/encodings/iso2022_jp_2.py +39 -0
- package/python3.4.2/lib/python3.4/encodings/iso2022_jp_2004.py +39 -0
- package/python3.4.2/lib/python3.4/encodings/iso2022_jp_3.py +39 -0
- package/python3.4.2/lib/python3.4/encodings/iso2022_jp_ext.py +39 -0
- package/python3.4.2/lib/python3.4/encodings/iso2022_kr.py +39 -0
- package/python3.4.2/lib/python3.4/encodings/iso8859_1.py +307 -0
- package/python3.4.2/lib/python3.4/encodings/iso8859_10.py +307 -0
- package/python3.4.2/lib/python3.4/encodings/iso8859_11.py +307 -0
- package/python3.4.2/lib/python3.4/encodings/iso8859_13.py +307 -0
- package/python3.4.2/lib/python3.4/encodings/iso8859_14.py +307 -0
- package/python3.4.2/lib/python3.4/encodings/iso8859_15.py +307 -0
- package/python3.4.2/lib/python3.4/encodings/iso8859_16.py +307 -0
- package/python3.4.2/lib/python3.4/encodings/iso8859_2.py +307 -0
- package/python3.4.2/lib/python3.4/encodings/iso8859_3.py +307 -0
- package/python3.4.2/lib/python3.4/encodings/iso8859_4.py +307 -0
- package/python3.4.2/lib/python3.4/encodings/iso8859_5.py +307 -0
- package/python3.4.2/lib/python3.4/encodings/iso8859_6.py +307 -0
- package/python3.4.2/lib/python3.4/encodings/iso8859_7.py +307 -0
- package/python3.4.2/lib/python3.4/encodings/iso8859_8.py +307 -0
- package/python3.4.2/lib/python3.4/encodings/iso8859_9.py +307 -0
- package/python3.4.2/lib/python3.4/encodings/johab.py +39 -0
- package/python3.4.2/lib/python3.4/encodings/koi8_r.py +307 -0
- package/python3.4.2/lib/python3.4/encodings/koi8_u.py +307 -0
- package/python3.4.2/lib/python3.4/encodings/latin_1.py +50 -0
- package/python3.4.2/lib/python3.4/encodings/mac_arabic.py +698 -0
- package/python3.4.2/lib/python3.4/encodings/mac_centeuro.py +307 -0
- package/python3.4.2/lib/python3.4/encodings/mac_croatian.py +307 -0
- package/python3.4.2/lib/python3.4/encodings/mac_cyrillic.py +307 -0
- package/python3.4.2/lib/python3.4/encodings/mac_farsi.py +307 -0
- package/python3.4.2/lib/python3.4/encodings/mac_greek.py +307 -0
- package/python3.4.2/lib/python3.4/encodings/mac_iceland.py +307 -0
- package/python3.4.2/lib/python3.4/encodings/mac_latin2.py +312 -0
- package/python3.4.2/lib/python3.4/encodings/mac_roman.py +307 -0
- package/python3.4.2/lib/python3.4/encodings/mac_romanian.py +307 -0
- package/python3.4.2/lib/python3.4/encodings/mac_turkish.py +307 -0
- package/python3.4.2/lib/python3.4/encodings/mbcs.py +47 -0
- package/python3.4.2/lib/python3.4/encodings/palmos.py +308 -0
- package/python3.4.2/lib/python3.4/encodings/ptcp154.py +312 -0
- package/python3.4.2/lib/python3.4/encodings/punycode.py +237 -0
- package/python3.4.2/lib/python3.4/encodings/quopri_codec.py +56 -0
- package/python3.4.2/lib/python3.4/encodings/raw_unicode_escape.py +45 -0
- package/python3.4.2/lib/python3.4/encodings/rot_13.py +113 -0
- package/python3.4.2/lib/python3.4/encodings/shift_jis.py +39 -0
- package/python3.4.2/lib/python3.4/encodings/shift_jis_2004.py +39 -0
- package/python3.4.2/lib/python3.4/encodings/shift_jisx0213.py +39 -0
- package/python3.4.2/lib/python3.4/encodings/tis_620.py +307 -0
- package/python3.4.2/lib/python3.4/encodings/undefined.py +49 -0
- package/python3.4.2/lib/python3.4/encodings/unicode_escape.py +45 -0
- package/python3.4.2/lib/python3.4/encodings/unicode_internal.py +45 -0
- package/python3.4.2/lib/python3.4/encodings/utf_16.py +155 -0
- package/python3.4.2/lib/python3.4/encodings/utf_16_be.py +42 -0
- package/python3.4.2/lib/python3.4/encodings/utf_16_le.py +42 -0
- package/python3.4.2/lib/python3.4/encodings/utf_32.py +150 -0
- package/python3.4.2/lib/python3.4/encodings/utf_32_be.py +37 -0
- package/python3.4.2/lib/python3.4/encodings/utf_32_le.py +37 -0
- package/python3.4.2/lib/python3.4/encodings/utf_7.py +38 -0
- package/python3.4.2/lib/python3.4/encodings/utf_8.py +42 -0
- package/python3.4.2/lib/python3.4/encodings/utf_8_sig.py +130 -0
- package/python3.4.2/lib/python3.4/encodings/uu_codec.py +99 -0
- package/python3.4.2/lib/python3.4/encodings/zlib_codec.py +77 -0
- package/python3.4.2/lib/python3.4/ensurepip/__init__.py +210 -0
- package/python3.4.2/lib/python3.4/ensurepip/__main__.py +4 -0
- package/python3.4.2/lib/python3.4/ensurepip/_bundled/pip-1.5.6-py2.py3-none-any.whl +0 -0
- package/python3.4.2/lib/python3.4/ensurepip/_bundled/setuptools-2.1-py2.py3-none-any.whl +0 -0
- package/python3.4.2/lib/python3.4/ensurepip/_uninstall.py +30 -0
- package/python3.4.2/lib/python3.4/enum.py +525 -0
- package/python3.4.2/lib/python3.4/filecmp.py +305 -0
- package/python3.4.2/lib/python3.4/fileinput.py +429 -0
- package/python3.4.2/lib/python3.4/fnmatch.py +109 -0
- package/python3.4.2/lib/python3.4/formatter.py +448 -0
- package/python3.4.2/lib/python3.4/fractions.py +630 -0
- package/python3.4.2/lib/python3.4/ftplib.py +1088 -0
- package/python3.4.2/lib/python3.4/functools.py +721 -0
- package/python3.4.2/lib/python3.4/genericpath.py +132 -0
- package/python3.4.2/lib/python3.4/getopt.py +215 -0
- package/python3.4.2/lib/python3.4/getpass.py +186 -0
- package/python3.4.2/lib/python3.4/gettext.py +523 -0
- package/python3.4.2/lib/python3.4/glob.py +110 -0
- package/python3.4.2/lib/python3.4/gzip.py +674 -0
- package/python3.4.2/lib/python3.4/hashlib.py +217 -0
- package/python3.4.2/lib/python3.4/heapq.py +476 -0
- package/python3.4.2/lib/python3.4/hmac.py +144 -0
- package/python3.4.2/lib/python3.4/html/__init__.py +132 -0
- package/python3.4.2/lib/python3.4/html/entities.py +2506 -0
- package/python3.4.2/lib/python3.4/html/parser.py +550 -0
- package/python3.4.2/lib/python3.4/http/__init__.py +1 -0
- package/python3.4.2/lib/python3.4/http/client.py +1302 -0
- package/python3.4.2/lib/python3.4/http/cookiejar.py +2080 -0
- package/python3.4.2/lib/python3.4/http/cookies.py +578 -0
- package/python3.4.2/lib/python3.4/http/server.py +1241 -0
- package/python3.4.2/lib/python3.4/idlelib/AutoComplete.py +233 -0
- package/python3.4.2/lib/python3.4/idlelib/AutoCompleteWindow.py +415 -0
- package/python3.4.2/lib/python3.4/idlelib/AutoExpand.py +104 -0
- package/python3.4.2/lib/python3.4/idlelib/Bindings.py +94 -0
- package/python3.4.2/lib/python3.4/idlelib/CREDITS.txt +37 -0
- package/python3.4.2/lib/python3.4/idlelib/CallTipWindow.py +170 -0
- package/python3.4.2/lib/python3.4/idlelib/CallTips.py +175 -0
- package/python3.4.2/lib/python3.4/idlelib/ChangeLog +1591 -0
- package/python3.4.2/lib/python3.4/idlelib/ClassBrowser.py +229 -0
- package/python3.4.2/lib/python3.4/idlelib/CodeContext.py +176 -0
- package/python3.4.2/lib/python3.4/idlelib/ColorDelegator.py +254 -0
- package/python3.4.2/lib/python3.4/idlelib/Debugger.py +490 -0
- package/python3.4.2/lib/python3.4/idlelib/Delegator.py +25 -0
- package/python3.4.2/lib/python3.4/idlelib/EditorWindow.py +1729 -0
- package/python3.4.2/lib/python3.4/idlelib/FileList.py +129 -0
- package/python3.4.2/lib/python3.4/idlelib/FormatParagraph.py +193 -0
- package/python3.4.2/lib/python3.4/idlelib/GrepDialog.py +159 -0
- package/python3.4.2/lib/python3.4/idlelib/HISTORY.txt +296 -0
- package/python3.4.2/lib/python3.4/idlelib/HyperParser.py +313 -0
- package/python3.4.2/lib/python3.4/idlelib/IOBinding.py +555 -0
- package/python3.4.2/lib/python3.4/idlelib/Icons/folder.gif +0 -0
- package/python3.4.2/lib/python3.4/idlelib/Icons/idle.icns +0 -0
- package/python3.4.2/lib/python3.4/idlelib/Icons/idle.ico +0 -0
- package/python3.4.2/lib/python3.4/idlelib/Icons/idle_16.gif +0 -0
- package/python3.4.2/lib/python3.4/idlelib/Icons/idle_16.png +0 -0
- package/python3.4.2/lib/python3.4/idlelib/Icons/idle_32.gif +0 -0
- package/python3.4.2/lib/python3.4/idlelib/Icons/idle_32.png +0 -0
- package/python3.4.2/lib/python3.4/idlelib/Icons/idle_48.gif +0 -0
- package/python3.4.2/lib/python3.4/idlelib/Icons/idle_48.png +0 -0
- package/python3.4.2/lib/python3.4/idlelib/Icons/minusnode.gif +0 -0
- package/python3.4.2/lib/python3.4/idlelib/Icons/openfolder.gif +0 -0
- package/python3.4.2/lib/python3.4/idlelib/Icons/plusnode.gif +0 -0
- package/python3.4.2/lib/python3.4/idlelib/Icons/python.gif +0 -0
- package/python3.4.2/lib/python3.4/idlelib/Icons/tk.gif +0 -0
- package/python3.4.2/lib/python3.4/idlelib/IdleHistory.py +104 -0
- package/python3.4.2/lib/python3.4/idlelib/MultiCall.py +453 -0
- package/python3.4.2/lib/python3.4/idlelib/MultiStatusBar.py +45 -0
- package/python3.4.2/lib/python3.4/idlelib/NEWS.txt +877 -0
- package/python3.4.2/lib/python3.4/idlelib/ObjectBrowser.py +143 -0
- package/python3.4.2/lib/python3.4/idlelib/OutputWindow.py +144 -0
- package/python3.4.2/lib/python3.4/idlelib/ParenMatch.py +178 -0
- package/python3.4.2/lib/python3.4/idlelib/PathBrowser.py +106 -0
- package/python3.4.2/lib/python3.4/idlelib/Percolator.py +104 -0
- package/python3.4.2/lib/python3.4/idlelib/PyParse.py +618 -0
- package/python3.4.2/lib/python3.4/idlelib/PyShell.py +1619 -0
- package/python3.4.2/lib/python3.4/idlelib/README.txt +60 -0
- package/python3.4.2/lib/python3.4/idlelib/RemoteDebugger.py +389 -0
- package/python3.4.2/lib/python3.4/idlelib/RemoteObjectBrowser.py +36 -0
- package/python3.4.2/lib/python3.4/idlelib/ReplaceDialog.py +221 -0
- package/python3.4.2/lib/python3.4/idlelib/RstripExtension.py +33 -0
- package/python3.4.2/lib/python3.4/idlelib/ScriptBinding.py +207 -0
- package/python3.4.2/lib/python3.4/idlelib/ScrolledList.py +140 -0
- package/python3.4.2/lib/python3.4/idlelib/SearchDialog.py +89 -0
- package/python3.4.2/lib/python3.4/idlelib/SearchDialogBase.py +184 -0
- package/python3.4.2/lib/python3.4/idlelib/SearchEngine.py +233 -0
- package/python3.4.2/lib/python3.4/idlelib/StackViewer.py +152 -0
- package/python3.4.2/lib/python3.4/idlelib/TODO.txt +210 -0
- package/python3.4.2/lib/python3.4/idlelib/ToolTip.py +97 -0
- package/python3.4.2/lib/python3.4/idlelib/TreeWidget.py +465 -0
- package/python3.4.2/lib/python3.4/idlelib/UndoDelegator.py +365 -0
- package/python3.4.2/lib/python3.4/idlelib/WidgetRedirector.py +174 -0
- package/python3.4.2/lib/python3.4/idlelib/WindowList.py +90 -0
- package/python3.4.2/lib/python3.4/idlelib/ZoomHeight.py +51 -0
- package/python3.4.2/lib/python3.4/idlelib/__init__.py +1 -0
- package/python3.4.2/lib/python3.4/idlelib/__main__.py +9 -0
- package/python3.4.2/lib/python3.4/idlelib/aboutDialog.py +145 -0
- package/python3.4.2/lib/python3.4/idlelib/config-extensions.def +96 -0
- package/python3.4.2/lib/python3.4/idlelib/config-highlight.def +64 -0
- package/python3.4.2/lib/python3.4/idlelib/config-keys.def +214 -0
- package/python3.4.2/lib/python3.4/idlelib/config-main.def +79 -0
- package/python3.4.2/lib/python3.4/idlelib/configDialog.py +1195 -0
- package/python3.4.2/lib/python3.4/idlelib/configHandler.py +722 -0
- package/python3.4.2/lib/python3.4/idlelib/configHelpSourceEdit.py +166 -0
- package/python3.4.2/lib/python3.4/idlelib/configSectionNameDialog.py +98 -0
- package/python3.4.2/lib/python3.4/idlelib/dynOptionMenuWidget.py +57 -0
- package/python3.4.2/lib/python3.4/idlelib/extend.txt +83 -0
- package/python3.4.2/lib/python3.4/idlelib/help.txt +368 -0
- package/python3.4.2/lib/python3.4/idlelib/idle.bat +4 -0
- package/python3.4.2/lib/python3.4/idlelib/idle.py +11 -0
- package/python3.4.2/lib/python3.4/idlelib/idle.pyw +21 -0
- package/python3.4.2/lib/python3.4/idlelib/idle_test/README.txt +115 -0
- package/python3.4.2/lib/python3.4/idlelib/idle_test/__init__.py +9 -0
- package/python3.4.2/lib/python3.4/idlelib/idle_test/htest.py +369 -0
- package/python3.4.2/lib/python3.4/idlelib/idle_test/mock_idle.py +55 -0
- package/python3.4.2/lib/python3.4/idlelib/idle_test/mock_tk.py +298 -0
- package/python3.4.2/lib/python3.4/idlelib/idle_test/test_autocomplete.py +143 -0
- package/python3.4.2/lib/python3.4/idlelib/idle_test/test_autoexpand.py +141 -0
- package/python3.4.2/lib/python3.4/idlelib/idle_test/test_calltips.py +172 -0
- package/python3.4.2/lib/python3.4/idlelib/idle_test/test_config_name.py +75 -0
- package/python3.4.2/lib/python3.4/idlelib/idle_test/test_configdialog.py +32 -0
- package/python3.4.2/lib/python3.4/idlelib/idle_test/test_delegator.py +37 -0
- package/python3.4.2/lib/python3.4/idlelib/idle_test/test_formatparagraph.py +377 -0
- package/python3.4.2/lib/python3.4/idlelib/idle_test/test_grep.py +80 -0
- package/python3.4.2/lib/python3.4/idlelib/idle_test/test_hyperparser.py +273 -0
- package/python3.4.2/lib/python3.4/idlelib/idle_test/test_idlehistory.py +167 -0
- package/python3.4.2/lib/python3.4/idlelib/idle_test/test_parenmatch.py +109 -0
- package/python3.4.2/lib/python3.4/idlelib/idle_test/test_pathbrowser.py +12 -0
- package/python3.4.2/lib/python3.4/idlelib/idle_test/test_rstrip.py +49 -0
- package/python3.4.2/lib/python3.4/idlelib/idle_test/test_searchdialogbase.py +165 -0
- package/python3.4.2/lib/python3.4/idlelib/idle_test/test_searchengine.py +329 -0
- package/python3.4.2/lib/python3.4/idlelib/idle_test/test_text.py +228 -0
- package/python3.4.2/lib/python3.4/idlelib/idle_test/test_textview.py +97 -0
- package/python3.4.2/lib/python3.4/idlelib/idle_test/test_warning.py +73 -0
- package/python3.4.2/lib/python3.4/idlelib/idle_test/test_widgetredir.py +122 -0
- package/python3.4.2/lib/python3.4/idlelib/idlever.py +1 -0
- package/python3.4.2/lib/python3.4/idlelib/keybindingDialog.py +266 -0
- package/python3.4.2/lib/python3.4/idlelib/macosxSupport.py +239 -0
- package/python3.4.2/lib/python3.4/idlelib/rpc.py +624 -0
- package/python3.4.2/lib/python3.4/idlelib/run.py +404 -0
- package/python3.4.2/lib/python3.4/idlelib/tabbedpages.py +498 -0
- package/python3.4.2/lib/python3.4/idlelib/testcode.py +31 -0
- package/python3.4.2/lib/python3.4/idlelib/textView.py +86 -0
- package/python3.4.2/lib/python3.4/imaplib.py +1549 -0
- package/python3.4.2/lib/python3.4/imghdr.py +154 -0
- package/python3.4.2/lib/python3.4/imp.py +315 -0
- package/python3.4.2/lib/python3.4/importlib/__init__.py +156 -0
- package/python3.4.2/lib/python3.4/importlib/_bootstrap.py +2461 -0
- package/python3.4.2/lib/python3.4/importlib/abc.py +323 -0
- package/python3.4.2/lib/python3.4/importlib/machinery.py +21 -0
- package/python3.4.2/lib/python3.4/importlib/util.py +202 -0
- package/python3.4.2/lib/python3.4/inspect.py +2759 -0
- package/python3.4.2/lib/python3.4/io.py +92 -0
- package/python3.4.2/lib/python3.4/ipaddress.py +2183 -0
- package/python3.4.2/lib/python3.4/json/__init__.py +331 -0
- package/python3.4.2/lib/python3.4/json/decoder.py +362 -0
- package/python3.4.2/lib/python3.4/json/encoder.py +433 -0
- package/python3.4.2/lib/python3.4/json/scanner.py +73 -0
- package/python3.4.2/lib/python3.4/json/tool.py +39 -0
- package/python3.4.2/lib/python3.4/keyword.py +94 -0
- package/python3.4.2/lib/python3.4/lib2to3/Grammar.txt +159 -0
- package/python3.4.2/lib/python3.4/lib2to3/Grammar3.4.2.final.0.pickle +0 -0
- package/python3.4.2/lib/python3.4/lib2to3/PatternGrammar.txt +28 -0
- package/python3.4.2/lib/python3.4/lib2to3/PatternGrammar3.4.2.final.0.pickle +0 -0
- package/python3.4.2/lib/python3.4/lib2to3/__init__.py +1 -0
- package/python3.4.2/lib/python3.4/lib2to3/__main__.py +4 -0
- package/python3.4.2/lib/python3.4/lib2to3/btm_matcher.py +168 -0
- package/python3.4.2/lib/python3.4/lib2to3/btm_utils.py +281 -0
- package/python3.4.2/lib/python3.4/lib2to3/fixer_base.py +187 -0
- package/python3.4.2/lib/python3.4/lib2to3/fixer_util.py +455 -0
- package/python3.4.2/lib/python3.4/lib2to3/fixes/__init__.py +1 -0
- package/python3.4.2/lib/python3.4/lib2to3/fixes/fix_apply.py +59 -0
- package/python3.4.2/lib/python3.4/lib2to3/fixes/fix_asserts.py +34 -0
- package/python3.4.2/lib/python3.4/lib2to3/fixes/fix_basestring.py +14 -0
- package/python3.4.2/lib/python3.4/lib2to3/fixes/fix_buffer.py +22 -0
- package/python3.4.2/lib/python3.4/lib2to3/fixes/fix_callable.py +37 -0
- package/python3.4.2/lib/python3.4/lib2to3/fixes/fix_dict.py +107 -0
- package/python3.4.2/lib/python3.4/lib2to3/fixes/fix_except.py +93 -0
- package/python3.4.2/lib/python3.4/lib2to3/fixes/fix_exec.py +40 -0
- package/python3.4.2/lib/python3.4/lib2to3/fixes/fix_execfile.py +52 -0
- package/python3.4.2/lib/python3.4/lib2to3/fixes/fix_exitfunc.py +72 -0
- package/python3.4.2/lib/python3.4/lib2to3/fixes/fix_filter.py +76 -0
- package/python3.4.2/lib/python3.4/lib2to3/fixes/fix_funcattrs.py +21 -0
- package/python3.4.2/lib/python3.4/lib2to3/fixes/fix_future.py +22 -0
- package/python3.4.2/lib/python3.4/lib2to3/fixes/fix_getcwdu.py +19 -0
- package/python3.4.2/lib/python3.4/lib2to3/fixes/fix_has_key.py +110 -0
- package/python3.4.2/lib/python3.4/lib2to3/fixes/fix_idioms.py +152 -0
- package/python3.4.2/lib/python3.4/lib2to3/fixes/fix_import.py +99 -0
- package/python3.4.2/lib/python3.4/lib2to3/fixes/fix_imports.py +145 -0
- package/python3.4.2/lib/python3.4/lib2to3/fixes/fix_imports2.py +16 -0
- package/python3.4.2/lib/python3.4/lib2to3/fixes/fix_input.py +26 -0
- package/python3.4.2/lib/python3.4/lib2to3/fixes/fix_intern.py +31 -0
- package/python3.4.2/lib/python3.4/lib2to3/fixes/fix_isinstance.py +52 -0
- package/python3.4.2/lib/python3.4/lib2to3/fixes/fix_itertools.py +43 -0
- package/python3.4.2/lib/python3.4/lib2to3/fixes/fix_itertools_imports.py +57 -0
- package/python3.4.2/lib/python3.4/lib2to3/fixes/fix_long.py +19 -0
- package/python3.4.2/lib/python3.4/lib2to3/fixes/fix_map.py +91 -0
- package/python3.4.2/lib/python3.4/lib2to3/fixes/fix_metaclass.py +228 -0
- package/python3.4.2/lib/python3.4/lib2to3/fixes/fix_methodattrs.py +24 -0
- package/python3.4.2/lib/python3.4/lib2to3/fixes/fix_ne.py +23 -0
- package/python3.4.2/lib/python3.4/lib2to3/fixes/fix_next.py +103 -0
- package/python3.4.2/lib/python3.4/lib2to3/fixes/fix_nonzero.py +21 -0
- package/python3.4.2/lib/python3.4/lib2to3/fixes/fix_numliterals.py +28 -0
- package/python3.4.2/lib/python3.4/lib2to3/fixes/fix_operator.py +98 -0
- package/python3.4.2/lib/python3.4/lib2to3/fixes/fix_paren.py +44 -0
- package/python3.4.2/lib/python3.4/lib2to3/fixes/fix_print.py +87 -0
- package/python3.4.2/lib/python3.4/lib2to3/fixes/fix_raise.py +90 -0
- package/python3.4.2/lib/python3.4/lib2to3/fixes/fix_raw_input.py +17 -0
- package/python3.4.2/lib/python3.4/lib2to3/fixes/fix_reduce.py +35 -0
- package/python3.4.2/lib/python3.4/lib2to3/fixes/fix_reload.py +28 -0
- package/python3.4.2/lib/python3.4/lib2to3/fixes/fix_renames.py +70 -0
- package/python3.4.2/lib/python3.4/lib2to3/fixes/fix_repr.py +23 -0
- package/python3.4.2/lib/python3.4/lib2to3/fixes/fix_set_literal.py +53 -0
- package/python3.4.2/lib/python3.4/lib2to3/fixes/fix_standarderror.py +18 -0
- package/python3.4.2/lib/python3.4/lib2to3/fixes/fix_sys_exc.py +30 -0
- package/python3.4.2/lib/python3.4/lib2to3/fixes/fix_throw.py +56 -0
- package/python3.4.2/lib/python3.4/lib2to3/fixes/fix_tuple_params.py +175 -0
- package/python3.4.2/lib/python3.4/lib2to3/fixes/fix_types.py +62 -0
- package/python3.4.2/lib/python3.4/lib2to3/fixes/fix_unicode.py +42 -0
- package/python3.4.2/lib/python3.4/lib2to3/fixes/fix_urllib.py +197 -0
- package/python3.4.2/lib/python3.4/lib2to3/fixes/fix_ws_comma.py +39 -0
- package/python3.4.2/lib/python3.4/lib2to3/fixes/fix_xrange.py +73 -0
- package/python3.4.2/lib/python3.4/lib2to3/fixes/fix_xreadlines.py +25 -0
- package/python3.4.2/lib/python3.4/lib2to3/fixes/fix_zip.py +35 -0
- package/python3.4.2/lib/python3.4/lib2to3/main.py +268 -0
- package/python3.4.2/lib/python3.4/lib2to3/patcomp.py +205 -0
- package/python3.4.2/lib/python3.4/lib2to3/pgen2/__init__.py +4 -0
- package/python3.4.2/lib/python3.4/lib2to3/pgen2/conv.py +257 -0
- package/python3.4.2/lib/python3.4/lib2to3/pgen2/driver.py +157 -0
- package/python3.4.2/lib/python3.4/lib2to3/pgen2/grammar.py +183 -0
- package/python3.4.2/lib/python3.4/lib2to3/pgen2/literals.py +60 -0
- package/python3.4.2/lib/python3.4/lib2to3/pgen2/parse.py +201 -0
- package/python3.4.2/lib/python3.4/lib2to3/pgen2/pgen.py +386 -0
- package/python3.4.2/lib/python3.4/lib2to3/pgen2/token.py +83 -0
- package/python3.4.2/lib/python3.4/lib2to3/pgen2/tokenize.py +502 -0
- package/python3.4.2/lib/python3.4/lib2to3/pygram.py +40 -0
- package/python3.4.2/lib/python3.4/lib2to3/pytree.py +864 -0
- package/python3.4.2/lib/python3.4/lib2to3/refactor.py +747 -0
- package/python3.4.2/lib/python3.4/lib2to3/tests/__init__.py +24 -0
- package/python3.4.2/lib/python3.4/lib2to3/tests/data/README +6 -0
- package/python3.4.2/lib/python3.4/lib2to3/tests/data/bom.py +2 -0
- package/python3.4.2/lib/python3.4/lib2to3/tests/data/crlf.py +3 -0
- package/python3.4.2/lib/python3.4/lib2to3/tests/data/different_encoding.py +6 -0
- package/python3.4.2/lib/python3.4/lib2to3/tests/data/false_encoding.py +2 -0
- package/python3.4.2/lib/python3.4/lib2to3/tests/data/fixers/bad_order.py +5 -0
- package/python3.4.2/lib/python3.4/lib2to3/tests/data/fixers/myfixes/__init__.py +0 -0
- package/python3.4.2/lib/python3.4/lib2to3/tests/data/fixers/myfixes/fix_explicit.py +6 -0
- package/python3.4.2/lib/python3.4/lib2to3/tests/data/fixers/myfixes/fix_first.py +6 -0
- package/python3.4.2/lib/python3.4/lib2to3/tests/data/fixers/myfixes/fix_last.py +7 -0
- package/python3.4.2/lib/python3.4/lib2to3/tests/data/fixers/myfixes/fix_parrot.py +13 -0
- package/python3.4.2/lib/python3.4/lib2to3/tests/data/fixers/myfixes/fix_preorder.py +6 -0
- package/python3.4.2/lib/python3.4/lib2to3/tests/data/fixers/no_fixer_cls.py +1 -0
- package/python3.4.2/lib/python3.4/lib2to3/tests/data/fixers/parrot_example.py +2 -0
- package/python3.4.2/lib/python3.4/lib2to3/tests/data/infinite_recursion.py +2669 -0
- package/python3.4.2/lib/python3.4/lib2to3/tests/data/py2_test_grammar.py +974 -0
- package/python3.4.2/lib/python3.4/lib2to3/tests/data/py3_test_grammar.py +923 -0
- package/python3.4.2/lib/python3.4/lib2to3/tests/pytree_idempotency.py +92 -0
- package/python3.4.2/lib/python3.4/lib2to3/tests/support.py +54 -0
- package/python3.4.2/lib/python3.4/lib2to3/tests/test_all_fixers.py +23 -0
- package/python3.4.2/lib/python3.4/lib2to3/tests/test_fixers.py +4687 -0
- package/python3.4.2/lib/python3.4/lib2to3/tests/test_main.py +139 -0
- package/python3.4.2/lib/python3.4/lib2to3/tests/test_parser.py +249 -0
- package/python3.4.2/lib/python3.4/lib2to3/tests/test_pytree.py +477 -0
- package/python3.4.2/lib/python3.4/lib2to3/tests/test_refactor.py +321 -0
- package/python3.4.2/lib/python3.4/lib2to3/tests/test_util.py +594 -0
- package/python3.4.2/lib/python3.4/linecache.py +134 -0
- package/python3.4.2/lib/python3.4/locale.py +1559 -0
- package/python3.4.2/lib/python3.4/logging/__init__.py +1950 -0
- package/python3.4.2/lib/python3.4/logging/config.py +927 -0
- package/python3.4.2/lib/python3.4/logging/handlers.py +1452 -0
- package/python3.4.2/lib/python3.4/lzma.py +511 -0
- package/python3.4.2/lib/python3.4/macpath.py +205 -0
- package/python3.4.2/lib/python3.4/macurl2path.py +77 -0
- package/python3.4.2/lib/python3.4/mailbox.py +2136 -0
- package/python3.4.2/lib/python3.4/mailcap.py +253 -0
- package/python3.4.2/lib/python3.4/mimetypes.py +592 -0
- package/python3.4.2/lib/python3.4/modulefinder.py +642 -0
- package/python3.4.2/lib/python3.4/multiprocessing/__init__.py +38 -0
- package/python3.4.2/lib/python3.4/multiprocessing/connection.py +954 -0
- package/python3.4.2/lib/python3.4/multiprocessing/context.py +348 -0
- package/python3.4.2/lib/python3.4/multiprocessing/dummy/__init__.py +119 -0
- package/python3.4.2/lib/python3.4/multiprocessing/dummy/connection.py +74 -0
- package/python3.4.2/lib/python3.4/multiprocessing/forkserver.py +267 -0
- package/python3.4.2/lib/python3.4/multiprocessing/heap.py +249 -0
- package/python3.4.2/lib/python3.4/multiprocessing/managers.py +1131 -0
- package/python3.4.2/lib/python3.4/multiprocessing/pool.py +769 -0
- package/python3.4.2/lib/python3.4/multiprocessing/popen_fork.py +83 -0
- package/python3.4.2/lib/python3.4/multiprocessing/popen_forkserver.py +69 -0
- package/python3.4.2/lib/python3.4/multiprocessing/popen_spawn_posix.py +69 -0
- package/python3.4.2/lib/python3.4/multiprocessing/popen_spawn_win32.py +99 -0
- package/python3.4.2/lib/python3.4/multiprocessing/process.py +332 -0
- package/python3.4.2/lib/python3.4/multiprocessing/queues.py +367 -0
- package/python3.4.2/lib/python3.4/multiprocessing/reduction.py +240 -0
- package/python3.4.2/lib/python3.4/multiprocessing/resource_sharer.py +158 -0
- package/python3.4.2/lib/python3.4/multiprocessing/semaphore_tracker.py +143 -0
- package/python3.4.2/lib/python3.4/multiprocessing/sharedctypes.py +245 -0
- package/python3.4.2/lib/python3.4/multiprocessing/spawn.py +287 -0
- package/python3.4.2/lib/python3.4/multiprocessing/synchronize.py +418 -0
- package/python3.4.2/lib/python3.4/multiprocessing/util.py +367 -0
- package/python3.4.2/lib/python3.4/netrc.py +142 -0
- package/python3.4.2/lib/python3.4/nntplib.py +1134 -0
- package/python3.4.2/lib/python3.4/ntpath.py +625 -0
- package/python3.4.2/lib/python3.4/nturl2path.py +66 -0
- package/python3.4.2/lib/python3.4/numbers.py +394 -0
- package/python3.4.2/lib/python3.4/opcode.py +200 -0
- package/python3.4.2/lib/python3.4/operator.py +411 -0
- package/python3.4.2/lib/python3.4/optparse.py +1680 -0
- package/python3.4.2/lib/python3.4/os.py +980 -0
- package/python3.4.2/lib/python3.4/pathlib.py +1291 -0
- package/python3.4.2/lib/python3.4/pdb.py +1685 -0
- package/python3.4.2/lib/python3.4/pickle.py +1599 -0
- package/python3.4.2/lib/python3.4/pickletools.py +2818 -0
- package/python3.4.2/lib/python3.4/pipes.py +247 -0
- package/python3.4.2/lib/python3.4/pkgutil.py +629 -0
- package/python3.4.2/lib/python3.4/plat-linux/CDROM.py +207 -0
- package/python3.4.2/lib/python3.4/plat-linux/DLFCN.py +83 -0
- package/python3.4.2/lib/python3.4/plat-linux/IN.py +615 -0
- package/python3.4.2/lib/python3.4/plat-linux/TYPES.py +170 -0
- package/python3.4.2/lib/python3.4/plat-linux/regen +8 -0
- package/python3.4.2/lib/python3.4/platform.py +1476 -0
- package/python3.4.2/lib/python3.4/plistlib.py +1025 -0
- package/python3.4.2/lib/python3.4/poplib.py +461 -0
- package/python3.4.2/lib/python3.4/posixpath.py +457 -0
- package/python3.4.2/lib/python3.4/pprint.py +416 -0
- package/python3.4.2/lib/python3.4/profile.py +589 -0
- package/python3.4.2/lib/python3.4/pstats.py +691 -0
- package/python3.4.2/lib/python3.4/pty.py +170 -0
- package/python3.4.2/lib/python3.4/py_compile.py +185 -0
- package/python3.4.2/lib/python3.4/pyclbr.py +351 -0
- package/python3.4.2/lib/python3.4/pydoc.py +2622 -0
- package/python3.4.2/lib/python3.4/pydoc_data/__init__.py +0 -0
- package/python3.4.2/lib/python3.4/pydoc_data/_pydoc.css +6 -0
- package/python3.4.2/lib/python3.4/pydoc_data/topics.py +79 -0
- package/python3.4.2/lib/python3.4/queue.py +249 -0
- package/python3.4.2/lib/python3.4/quopri.py +242 -0
- package/python3.4.2/lib/python3.4/random.py +742 -0
- package/python3.4.2/lib/python3.4/re.py +368 -0
- package/python3.4.2/lib/python3.4/reprlib.py +157 -0
- package/python3.4.2/lib/python3.4/rlcompleter.py +165 -0
- package/python3.4.2/lib/python3.4/runpy.py +271 -0
- package/python3.4.2/lib/python3.4/sched.py +167 -0
- package/python3.4.2/lib/python3.4/selectors.py +525 -0
- package/python3.4.2/lib/python3.4/shelve.py +239 -0
- package/python3.4.2/lib/python3.4/shlex.py +304 -0
- package/python3.4.2/lib/python3.4/shutil.py +1127 -0
- package/python3.4.2/lib/python3.4/site-packages/Jinja2-2.7.3-py3.4.egg/EGG-INFO/PKG-INFO +55 -0
- package/python3.4.2/lib/python3.4/site-packages/Jinja2-2.7.3-py3.4.egg/EGG-INFO/SOURCES.txt +126 -0
- package/python3.4.2/lib/python3.4/site-packages/Jinja2-2.7.3-py3.4.egg/EGG-INFO/dependency_links.txt +1 -0
- package/python3.4.2/lib/python3.4/site-packages/Jinja2-2.7.3-py3.4.egg/EGG-INFO/entry_points.txt +4 -0
- package/python3.4.2/lib/python3.4/site-packages/Jinja2-2.7.3-py3.4.egg/EGG-INFO/not-zip-safe +1 -0
- package/python3.4.2/lib/python3.4/site-packages/Jinja2-2.7.3-py3.4.egg/EGG-INFO/requires.txt +4 -0
- package/python3.4.2/lib/python3.4/site-packages/Jinja2-2.7.3-py3.4.egg/EGG-INFO/top_level.txt +1 -0
- package/python3.4.2/lib/python3.4/site-packages/Jinja2-2.7.3-py3.4.egg/jinja2/__init__.py +69 -0
- package/python3.4.2/lib/python3.4/site-packages/Jinja2-2.7.3-py3.4.egg/jinja2/_compat.py +150 -0
- package/python3.4.2/lib/python3.4/site-packages/Jinja2-2.7.3-py3.4.egg/jinja2/_stringdefs.py +132 -0
- package/python3.4.2/lib/python3.4/site-packages/Jinja2-2.7.3-py3.4.egg/jinja2/bccache.py +344 -0
- package/python3.4.2/lib/python3.4/site-packages/Jinja2-2.7.3-py3.4.egg/jinja2/compiler.py +1640 -0
- package/python3.4.2/lib/python3.4/site-packages/Jinja2-2.7.3-py3.4.egg/jinja2/constants.py +32 -0
- package/python3.4.2/lib/python3.4/site-packages/Jinja2-2.7.3-py3.4.egg/jinja2/debug.py +337 -0
- package/python3.4.2/lib/python3.4/site-packages/Jinja2-2.7.3-py3.4.egg/jinja2/defaults.py +43 -0
- package/python3.4.2/lib/python3.4/site-packages/Jinja2-2.7.3-py3.4.egg/jinja2/environment.py +1191 -0
- package/python3.4.2/lib/python3.4/site-packages/Jinja2-2.7.3-py3.4.egg/jinja2/exceptions.py +146 -0
- package/python3.4.2/lib/python3.4/site-packages/Jinja2-2.7.3-py3.4.egg/jinja2/ext.py +636 -0
- package/python3.4.2/lib/python3.4/site-packages/Jinja2-2.7.3-py3.4.egg/jinja2/filters.py +987 -0
- package/python3.4.2/lib/python3.4/site-packages/Jinja2-2.7.3-py3.4.egg/jinja2/lexer.py +733 -0
- package/python3.4.2/lib/python3.4/site-packages/Jinja2-2.7.3-py3.4.egg/jinja2/loaders.py +471 -0
- package/python3.4.2/lib/python3.4/site-packages/Jinja2-2.7.3-py3.4.egg/jinja2/meta.py +103 -0
- package/python3.4.2/lib/python3.4/site-packages/Jinja2-2.7.3-py3.4.egg/jinja2/nodes.py +914 -0
- package/python3.4.2/lib/python3.4/site-packages/Jinja2-2.7.3-py3.4.egg/jinja2/optimizer.py +68 -0
- package/python3.4.2/lib/python3.4/site-packages/Jinja2-2.7.3-py3.4.egg/jinja2/parser.py +895 -0
- package/python3.4.2/lib/python3.4/site-packages/Jinja2-2.7.3-py3.4.egg/jinja2/runtime.py +581 -0
- package/python3.4.2/lib/python3.4/site-packages/Jinja2-2.7.3-py3.4.egg/jinja2/sandbox.py +368 -0
- package/python3.4.2/lib/python3.4/site-packages/Jinja2-2.7.3-py3.4.egg/jinja2/tests.py +149 -0
- package/python3.4.2/lib/python3.4/site-packages/Jinja2-2.7.3-py3.4.egg/jinja2/testsuite/__init__.py +156 -0
- package/python3.4.2/lib/python3.4/site-packages/Jinja2-2.7.3-py3.4.egg/jinja2/testsuite/api.py +261 -0
- package/python3.4.2/lib/python3.4/site-packages/Jinja2-2.7.3-py3.4.egg/jinja2/testsuite/bytecode_cache.py +37 -0
- package/python3.4.2/lib/python3.4/site-packages/Jinja2-2.7.3-py3.4.egg/jinja2/testsuite/core_tags.py +305 -0
- package/python3.4.2/lib/python3.4/site-packages/Jinja2-2.7.3-py3.4.egg/jinja2/testsuite/debug.py +58 -0
- package/python3.4.2/lib/python3.4/site-packages/Jinja2-2.7.3-py3.4.egg/jinja2/testsuite/doctests.py +29 -0
- package/python3.4.2/lib/python3.4/site-packages/Jinja2-2.7.3-py3.4.egg/jinja2/testsuite/ext.py +459 -0
- package/python3.4.2/lib/python3.4/site-packages/Jinja2-2.7.3-py3.4.egg/jinja2/testsuite/filters.py +515 -0
- package/python3.4.2/lib/python3.4/site-packages/Jinja2-2.7.3-py3.4.egg/jinja2/testsuite/imports.py +141 -0
- package/python3.4.2/lib/python3.4/site-packages/Jinja2-2.7.3-py3.4.egg/jinja2/testsuite/inheritance.py +250 -0
- package/python3.4.2/lib/python3.4/site-packages/Jinja2-2.7.3-py3.4.egg/jinja2/testsuite/lexnparse.py +593 -0
- package/python3.4.2/lib/python3.4/site-packages/Jinja2-2.7.3-py3.4.egg/jinja2/testsuite/loader.py +226 -0
- package/python3.4.2/lib/python3.4/site-packages/Jinja2-2.7.3-py3.4.egg/jinja2/testsuite/regression.py +279 -0
- package/python3.4.2/lib/python3.4/site-packages/Jinja2-2.7.3-py3.4.egg/jinja2/testsuite/res/__init__.py +0 -0
- package/python3.4.2/lib/python3.4/site-packages/Jinja2-2.7.3-py3.4.egg/jinja2/testsuite/res/templates/broken.html +3 -0
- package/python3.4.2/lib/python3.4/site-packages/Jinja2-2.7.3-py3.4.egg/jinja2/testsuite/res/templates/foo/test.html +1 -0
- package/python3.4.2/lib/python3.4/site-packages/Jinja2-2.7.3-py3.4.egg/jinja2/testsuite/res/templates/syntaxerror.html +4 -0
- package/python3.4.2/lib/python3.4/site-packages/Jinja2-2.7.3-py3.4.egg/jinja2/testsuite/res/templates/test.html +1 -0
- package/python3.4.2/lib/python3.4/site-packages/Jinja2-2.7.3-py3.4.egg/jinja2/testsuite/security.py +166 -0
- package/python3.4.2/lib/python3.4/site-packages/Jinja2-2.7.3-py3.4.egg/jinja2/testsuite/tests.py +93 -0
- package/python3.4.2/lib/python3.4/site-packages/Jinja2-2.7.3-py3.4.egg/jinja2/testsuite/utils.py +82 -0
- package/python3.4.2/lib/python3.4/site-packages/Jinja2-2.7.3-py3.4.egg/jinja2/utils.py +520 -0
- package/python3.4.2/lib/python3.4/site-packages/Jinja2-2.7.3-py3.4.egg/jinja2/visitor.py +87 -0
- package/python3.4.2/lib/python3.4/site-packages/MarkupSafe-0.23-py3.4.egg/EGG-INFO/PKG-INFO +119 -0
- package/python3.4.2/lib/python3.4/site-packages/MarkupSafe-0.23-py3.4.egg/EGG-INFO/SOURCES.txt +17 -0
- package/python3.4.2/lib/python3.4/site-packages/MarkupSafe-0.23-py3.4.egg/EGG-INFO/dependency_links.txt +1 -0
- package/python3.4.2/lib/python3.4/site-packages/MarkupSafe-0.23-py3.4.egg/EGG-INFO/not-zip-safe +1 -0
- package/python3.4.2/lib/python3.4/site-packages/MarkupSafe-0.23-py3.4.egg/EGG-INFO/top_level.txt +1 -0
- package/python3.4.2/lib/python3.4/site-packages/MarkupSafe-0.23-py3.4.egg/markupsafe/__init__.py +298 -0
- package/python3.4.2/lib/python3.4/site-packages/MarkupSafe-0.23-py3.4.egg/markupsafe/_compat.py +26 -0
- package/python3.4.2/lib/python3.4/site-packages/MarkupSafe-0.23-py3.4.egg/markupsafe/_constants.py +267 -0
- package/python3.4.2/lib/python3.4/site-packages/MarkupSafe-0.23-py3.4.egg/markupsafe/_native.py +46 -0
- package/python3.4.2/lib/python3.4/site-packages/MarkupSafe-0.23-py3.4.egg/markupsafe/_speedups.c +239 -0
- package/python3.4.2/lib/python3.4/site-packages/MarkupSafe-0.23-py3.4.egg/markupsafe/tests.py +179 -0
- package/python3.4.2/lib/python3.4/site-packages/README +2 -0
- package/python3.4.2/lib/python3.4/site-packages/_markerlib/__init__.py +16 -0
- package/python3.4.2/lib/python3.4/site-packages/_markerlib/markers.py +119 -0
- package/python3.4.2/lib/python3.4/site-packages/android_debian_builder-1.0-py3.4.egg/EGG-INFO/PKG-INFO +68 -0
- package/python3.4.2/lib/python3.4/site-packages/android_debian_builder-1.0-py3.4.egg/EGG-INFO/SOURCES.txt +23 -0
- package/python3.4.2/lib/python3.4/site-packages/android_debian_builder-1.0-py3.4.egg/EGG-INFO/dependency_links.txt +1 -0
- package/python3.4.2/lib/python3.4/site-packages/android_debian_builder-1.0-py3.4.egg/EGG-INFO/entry_points.txt +3 -0
- package/python3.4.2/lib/python3.4/site-packages/android_debian_builder-1.0-py3.4.egg/EGG-INFO/not-zip-safe +1 -0
- package/python3.4.2/lib/python3.4/site-packages/android_debian_builder-1.0-py3.4.egg/EGG-INFO/requires.txt +1 -0
- package/python3.4.2/lib/python3.4/site-packages/android_debian_builder-1.0-py3.4.egg/EGG-INFO/scripts/android-debian-builder +6 -0
- package/python3.4.2/lib/python3.4/site-packages/android_debian_builder-1.0-py3.4.egg/EGG-INFO/top_level.txt +1 -0
- package/python3.4.2/lib/python3.4/site-packages/android_debian_builder-1.0-py3.4.egg/android_debian_builder/__init__.py +0 -0
- package/python3.4.2/lib/python3.4/site-packages/android_debian_builder-1.0-py3.4.egg/android_debian_builder/__main__.py +26 -0
- package/python3.4.2/lib/python3.4/site-packages/android_debian_builder-1.0-py3.4.egg/android_debian_builder/build.py +63 -0
- package/python3.4.2/lib/python3.4/site-packages/android_debian_builder-1.0-py3.4.egg/android_debian_builder/config.py +82 -0
- package/python3.4.2/lib/python3.4/site-packages/android_debian_builder-1.0-py3.4.egg/android_debian_builder/data/deb.sh +106 -0
- package/python3.4.2/lib/python3.4/site-packages/android_debian_builder-1.0-py3.4.egg/android_debian_builder/data/default-config +42 -0
- package/python3.4.2/lib/python3.4/site-packages/android_debian_builder-1.0-py3.4.egg/android_debian_builder/data/first-time-setup.sh +94 -0
- package/python3.4.2/lib/python3.4/site-packages/android_debian_builder-1.0-py3.4.egg/android_debian_builder/data/init.sh +27 -0
- package/python3.4.2/lib/python3.4/site-packages/android_debian_builder-1.0-py3.4.egg/android_debian_builder/examples/jessie-armhf.cfg +26 -0
- package/python3.4.2/lib/python3.4/site-packages/android_debian_builder-1.0-py3.4.egg/android_debian_builder/run_tests.py +38 -0
- package/python3.4.2/lib/python3.4/site-packages/android_debian_builder-1.0-py3.4.egg/android_debian_builder/script.py +110 -0
- package/python3.4.2/lib/python3.4/site-packages/android_debian_builder-1.0-py3.4.egg/android_debian_builder/util.py +177 -0
- package/python3.4.2/lib/python3.4/site-packages/easy-install.pth +4 -0
- package/python3.4.2/lib/python3.4/site-packages/easy_install.py +5 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/__init__.py +277 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/__main__.py +7 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/__init__.py +8 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/_markerlib/__init__.py +16 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/_markerlib/markers.py +119 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/colorama/__init__.py +7 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/colorama/ansi.py +50 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/colorama/ansitowin32.py +190 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/colorama/initialise.py +56 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/colorama/win32.py +137 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/colorama/winterm.py +120 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/__init__.py +23 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/_backport/__init__.py +6 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/_backport/misc.py +41 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/_backport/shutil.py +761 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/_backport/sysconfig.cfg +84 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/_backport/sysconfig.py +788 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/_backport/tarfile.py +2607 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/compat.py +1064 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/database.py +1301 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/index.py +488 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/locators.py +1194 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/manifest.py +364 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/markers.py +190 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/metadata.py +1026 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/resources.py +317 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/scripts.py +323 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/t32.exe +0 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/t64.exe +0 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/util.py +1575 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/version.py +721 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/w32.exe +0 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/w64.exe +0 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/distlib/wheel.py +958 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/__init__.py +23 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/constants.py +3104 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/filters/__init__.py +0 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/filters/_base.py +12 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/filters/alphabeticalattributes.py +20 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/filters/inject_meta_charset.py +65 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/filters/lint.py +93 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/filters/optionaltags.py +205 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/filters/sanitizer.py +12 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/filters/whitespace.py +38 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/html5parser.py +2713 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/ihatexml.py +285 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/inputstream.py +881 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/sanitizer.py +271 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/serializer/__init__.py +16 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/serializer/htmlserializer.py +320 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/tokenizer.py +1731 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/treeadapters/__init__.py +0 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/treeadapters/sax.py +44 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/treebuilders/__init__.py +76 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/treebuilders/_base.py +377 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/treebuilders/dom.py +227 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/treebuilders/etree.py +337 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/treebuilders/etree_lxml.py +369 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/treewalkers/__init__.py +57 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/treewalkers/_base.py +200 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/treewalkers/dom.py +46 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/treewalkers/etree.py +138 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/treewalkers/genshistream.py +69 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/treewalkers/lxmletree.py +208 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/treewalkers/pulldom.py +63 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/trie/__init__.py +12 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/trie/_base.py +37 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/trie/datrie.py +44 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/trie/py.py +67 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/html5lib/utils.py +82 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/pkg_resources.py +2762 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/re-vendor.py +34 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/__init__.py +77 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/adapters.py +388 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/api.py +120 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/auth.py +193 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/cacert.pem +5026 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/certs.py +24 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/compat.py +115 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/cookies.py +454 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/exceptions.py +75 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/hooks.py +45 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/models.py +803 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/__init__.py +3 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/__init__.py +32 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/big5freq.py +925 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/big5prober.py +42 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/chardetect.py +46 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/chardistribution.py +231 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/charsetgroupprober.py +106 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/charsetprober.py +62 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/codingstatemachine.py +61 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/compat.py +34 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/constants.py +39 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/cp949prober.py +44 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/escprober.py +86 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/escsm.py +242 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/eucjpprober.py +90 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/euckrfreq.py +596 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/euckrprober.py +42 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/euctwfreq.py +428 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/euctwprober.py +41 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/gb2312freq.py +472 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/gb2312prober.py +41 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/hebrewprober.py +283 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/jisfreq.py +569 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/jpcntx.py +219 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/langbulgarianmodel.py +229 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/langcyrillicmodel.py +329 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/langgreekmodel.py +225 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/langhebrewmodel.py +201 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/langhungarianmodel.py +225 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/langthaimodel.py +200 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/latin1prober.py +139 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/mbcharsetprober.py +86 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/mbcsgroupprober.py +54 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/mbcssm.py +575 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/sbcharsetprober.py +120 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/sbcsgroupprober.py +69 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/sjisprober.py +91 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/universaldetector.py +170 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/utf8prober.py +76 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/__init__.py +58 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/_collections.py +205 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/connection.py +204 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/connectionpool.py +710 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/contrib/__init__.py +0 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/contrib/ntlmpool.py +120 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/contrib/pyopenssl.py +422 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/exceptions.py +126 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/fields.py +177 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/filepost.py +100 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/packages/__init__.py +4 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/packages/ordered_dict.py +260 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/packages/six.py +385 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/packages/ssl_match_hostname/__init__.py +13 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/packages/ssl_match_hostname/_implementation.py +105 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/poolmanager.py +258 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/request.py +141 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/response.py +308 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/util/__init__.py +27 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/util/connection.py +45 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/util/request.py +68 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/util/response.py +13 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py +133 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/util/timeout.py +234 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/util/url.py +162 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/sessions.py +637 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/status_codes.py +88 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/structures.py +127 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/requests/utils.py +673 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/_vendor/six.py +646 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/backwardcompat/__init__.py +138 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/basecommand.py +201 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/baseparser.py +224 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/cmdoptions.py +371 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/commands/__init__.py +88 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/commands/bundle.py +42 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/commands/completion.py +59 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/commands/freeze.py +114 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/commands/help.py +33 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/commands/install.py +314 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/commands/list.py +162 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/commands/search.py +132 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/commands/show.py +80 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/commands/uninstall.py +59 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/commands/unzip.py +7 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/commands/wheel.py +195 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/commands/zip.py +351 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/download.py +644 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/exceptions.py +46 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/index.py +990 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/locations.py +172 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/log.py +276 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/pep425tags.py +102 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/req.py +1931 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/runner.py +18 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/status_codes.py +6 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/util.py +720 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/vcs/__init__.py +251 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/vcs/bazaar.py +131 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/vcs/git.py +194 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/vcs/mercurial.py +151 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/vcs/subversion.py +273 -0
- package/python3.4.2/lib/python3.4/site-packages/pip/wheel.py +560 -0
- package/python3.4.2/lib/python3.4/site-packages/pip-1.5.6.dist-info/DESCRIPTION.rst +71 -0
- package/python3.4.2/lib/python3.4/site-packages/pip-1.5.6.dist-info/METADATA +98 -0
- package/python3.4.2/lib/python3.4/site-packages/pip-1.5.6.dist-info/RECORD +373 -0
- package/python3.4.2/lib/python3.4/site-packages/pip-1.5.6.dist-info/WHEEL +6 -0
- package/python3.4.2/lib/python3.4/site-packages/pip-1.5.6.dist-info/entry_points.txt +5 -0
- package/python3.4.2/lib/python3.4/site-packages/pip-1.5.6.dist-info/metadata.json +1 -0
- package/python3.4.2/lib/python3.4/site-packages/pip-1.5.6.dist-info/top_level.txt +1 -0
- package/python3.4.2/lib/python3.4/site-packages/pkg_resources.py +2719 -0
- package/python3.4.2/lib/python3.4/site-packages/setuptools/__init__.py +98 -0
- package/python3.4.2/lib/python3.4/site-packages/setuptools/archive_util.py +210 -0
- package/python3.4.2/lib/python3.4/site-packages/setuptools/cli-32.exe +0 -0
- package/python3.4.2/lib/python3.4/site-packages/setuptools/cli-64.exe +0 -0
- package/python3.4.2/lib/python3.4/site-packages/setuptools/cli-arm-32.exe +0 -0
- package/python3.4.2/lib/python3.4/site-packages/setuptools/cli.exe +0 -0
- package/python3.4.2/lib/python3.4/site-packages/setuptools/command/__init__.py +17 -0
- package/python3.4.2/lib/python3.4/site-packages/setuptools/command/alias.py +82 -0
- package/python3.4.2/lib/python3.4/site-packages/setuptools/command/bdist_egg.py +553 -0
- package/python3.4.2/lib/python3.4/site-packages/setuptools/command/bdist_rpm.py +82 -0
- package/python3.4.2/lib/python3.4/site-packages/setuptools/command/bdist_wininst.py +82 -0
- package/python3.4.2/lib/python3.4/site-packages/setuptools/command/build_ext.py +298 -0
- package/python3.4.2/lib/python3.4/site-packages/setuptools/command/build_py.py +221 -0
- package/python3.4.2/lib/python3.4/site-packages/setuptools/command/develop.py +167 -0
- package/python3.4.2/lib/python3.4/site-packages/setuptools/command/easy_install.py +1915 -0
- package/python3.4.2/lib/python3.4/site-packages/setuptools/command/egg_info.py +392 -0
- package/python3.4.2/lib/python3.4/site-packages/setuptools/command/install.py +103 -0
- package/python3.4.2/lib/python3.4/site-packages/setuptools/command/install_egg_info.py +125 -0
- package/python3.4.2/lib/python3.4/site-packages/setuptools/command/install_lib.py +82 -0
- package/python3.4.2/lib/python3.4/site-packages/setuptools/command/install_scripts.py +54 -0
- package/python3.4.2/lib/python3.4/site-packages/setuptools/command/launcher manifest.xml +15 -0
- package/python3.4.2/lib/python3.4/site-packages/setuptools/command/register.py +10 -0
- package/python3.4.2/lib/python3.4/site-packages/setuptools/command/rotate.py +83 -0
- package/python3.4.2/lib/python3.4/site-packages/setuptools/command/saveopts.py +24 -0
- package/python3.4.2/lib/python3.4/site-packages/setuptools/command/sdist.py +238 -0
- package/python3.4.2/lib/python3.4/site-packages/setuptools/command/setopt.py +164 -0
- package/python3.4.2/lib/python3.4/site-packages/setuptools/command/test.py +198 -0
- package/python3.4.2/lib/python3.4/site-packages/setuptools/command/upload_docs.py +193 -0
- package/python3.4.2/lib/python3.4/site-packages/setuptools/compat.py +83 -0
- package/python3.4.2/lib/python3.4/site-packages/setuptools/depends.py +246 -0
- package/python3.4.2/lib/python3.4/site-packages/setuptools/dist.py +796 -0
- package/python3.4.2/lib/python3.4/site-packages/setuptools/extension.py +46 -0
- package/python3.4.2/lib/python3.4/site-packages/setuptools/gui-32.exe +0 -0
- package/python3.4.2/lib/python3.4/site-packages/setuptools/gui-64.exe +0 -0
- package/python3.4.2/lib/python3.4/site-packages/setuptools/gui-arm-32.exe +0 -0
- package/python3.4.2/lib/python3.4/site-packages/setuptools/gui.exe +0 -0
- package/python3.4.2/lib/python3.4/site-packages/setuptools/lib2to3_ex.py +58 -0
- package/python3.4.2/lib/python3.4/site-packages/setuptools/package_index.py +1057 -0
- package/python3.4.2/lib/python3.4/site-packages/setuptools/py26compat.py +19 -0
- package/python3.4.2/lib/python3.4/site-packages/setuptools/py27compat.py +15 -0
- package/python3.4.2/lib/python3.4/site-packages/setuptools/py31compat.py +11 -0
- package/python3.4.2/lib/python3.4/site-packages/setuptools/sandbox.py +322 -0
- package/python3.4.2/lib/python3.4/site-packages/setuptools/script template (dev).py +11 -0
- package/python3.4.2/lib/python3.4/site-packages/setuptools/script template.py +4 -0
- package/python3.4.2/lib/python3.4/site-packages/setuptools/site-patch.py +83 -0
- package/python3.4.2/lib/python3.4/site-packages/setuptools/ssl_support.py +234 -0
- package/python3.4.2/lib/python3.4/site-packages/setuptools/svn_utils.py +564 -0
- package/python3.4.2/lib/python3.4/site-packages/setuptools/tests/__init__.py +352 -0
- package/python3.4.2/lib/python3.4/site-packages/setuptools/tests/doctest.py +2683 -0
- package/python3.4.2/lib/python3.4/site-packages/setuptools/tests/environment.py +165 -0
- package/python3.4.2/lib/python3.4/site-packages/setuptools/tests/py26compat.py +14 -0
- package/python3.4.2/lib/python3.4/site-packages/setuptools/tests/script-with-bom.py +3 -0
- package/python3.4.2/lib/python3.4/site-packages/setuptools/tests/server.py +82 -0
- package/python3.4.2/lib/python3.4/site-packages/setuptools/tests/test_bdist_egg.py +69 -0
- package/python3.4.2/lib/python3.4/site-packages/setuptools/tests/test_build_ext.py +20 -0
- package/python3.4.2/lib/python3.4/site-packages/setuptools/tests/test_develop.py +122 -0
- package/python3.4.2/lib/python3.4/site-packages/setuptools/tests/test_dist_info.py +83 -0
- package/python3.4.2/lib/python3.4/site-packages/setuptools/tests/test_easy_install.py +394 -0
- package/python3.4.2/lib/python3.4/site-packages/setuptools/tests/test_egg_info.py +173 -0
- package/python3.4.2/lib/python3.4/site-packages/setuptools/tests/test_markerlib.py +68 -0
- package/python3.4.2/lib/python3.4/site-packages/setuptools/tests/test_packageindex.py +203 -0
- package/python3.4.2/lib/python3.4/site-packages/setuptools/tests/test_resources.py +620 -0
- package/python3.4.2/lib/python3.4/site-packages/setuptools/tests/test_sandbox.py +79 -0
- package/python3.4.2/lib/python3.4/site-packages/setuptools/tests/test_sdist.py +535 -0
- package/python3.4.2/lib/python3.4/site-packages/setuptools/tests/test_svn.py +246 -0
- package/python3.4.2/lib/python3.4/site-packages/setuptools/tests/test_test.py +124 -0
- package/python3.4.2/lib/python3.4/site-packages/setuptools/tests/test_upload_docs.py +72 -0
- package/python3.4.2/lib/python3.4/site-packages/setuptools/version.py +1 -0
- package/python3.4.2/lib/python3.4/site-packages/setuptools-2.1.dist-info/DESCRIPTION.rst +1742 -0
- package/python3.4.2/lib/python3.4/site-packages/setuptools-2.1.dist-info/METADATA +1772 -0
- package/python3.4.2/lib/python3.4/site-packages/setuptools-2.1.dist-info/RECORD +149 -0
- package/python3.4.2/lib/python3.4/site-packages/setuptools-2.1.dist-info/WHEEL +6 -0
- package/python3.4.2/lib/python3.4/site-packages/setuptools-2.1.dist-info/dependency_links.txt +2 -0
- package/python3.4.2/lib/python3.4/site-packages/setuptools-2.1.dist-info/entry_points.txt +62 -0
- package/python3.4.2/lib/python3.4/site-packages/setuptools-2.1.dist-info/entry_points.txt.orig +62 -0
- package/python3.4.2/lib/python3.4/site-packages/setuptools-2.1.dist-info/pydist.json +1 -0
- package/python3.4.2/lib/python3.4/site-packages/setuptools-2.1.dist-info/requires.txt.orig +7 -0
- package/python3.4.2/lib/python3.4/site-packages/setuptools-2.1.dist-info/top_level.txt +4 -0
- package/python3.4.2/lib/python3.4/site-packages/setuptools-2.1.dist-info/zip-safe +1 -0
- package/python3.4.2/lib/python3.4/site.py +616 -0
- package/python3.4.2/lib/python3.4/smtpd.py +861 -0
- package/python3.4.2/lib/python3.4/smtplib.py +999 -0
- package/python3.4.2/lib/python3.4/sndhdr.py +240 -0
- package/python3.4.2/lib/python3.4/socket.py +535 -0
- package/python3.4.2/lib/python3.4/socketserver.py +748 -0
- package/python3.4.2/lib/python3.4/sqlite3/__init__.py +23 -0
- package/python3.4.2/lib/python3.4/sqlite3/dbapi2.py +89 -0
- package/python3.4.2/lib/python3.4/sqlite3/dump.py +70 -0
- package/python3.4.2/lib/python3.4/sqlite3/test/__init__.py +0 -0
- package/python3.4.2/lib/python3.4/sqlite3/test/dbapi.py +911 -0
- package/python3.4.2/lib/python3.4/sqlite3/test/dump.py +81 -0
- package/python3.4.2/lib/python3.4/sqlite3/test/factory.py +253 -0
- package/python3.4.2/lib/python3.4/sqlite3/test/hooks.py +258 -0
- package/python3.4.2/lib/python3.4/sqlite3/test/regression.py +358 -0
- package/python3.4.2/lib/python3.4/sqlite3/test/transactions.py +204 -0
- package/python3.4.2/lib/python3.4/sqlite3/test/types.py +403 -0
- package/python3.4.2/lib/python3.4/sqlite3/test/userfunctions.py +468 -0
- package/python3.4.2/lib/python3.4/sre_compile.py +489 -0
- package/python3.4.2/lib/python3.4/sre_constants.py +261 -0
- package/python3.4.2/lib/python3.4/sre_parse.py +859 -0
- package/python3.4.2/lib/python3.4/ssl.py +945 -0
- package/python3.4.2/lib/python3.4/stat.py +155 -0
- package/python3.4.2/lib/python3.4/statistics.py +595 -0
- package/python3.4.2/lib/python3.4/string.py +282 -0
- package/python3.4.2/lib/python3.4/stringprep.py +272 -0
- package/python3.4.2/lib/python3.4/struct.py +15 -0
- package/python3.4.2/lib/python3.4/subprocess.py +1690 -0
- package/python3.4.2/lib/python3.4/sunau.py +525 -0
- package/python3.4.2/lib/python3.4/symbol.py +111 -0
- package/python3.4.2/lib/python3.4/symtable.py +240 -0
- package/python3.4.2/lib/python3.4/sysconfig.py +709 -0
- package/python3.4.2/lib/python3.4/tabnanny.py +332 -0
- package/python3.4.2/lib/python3.4/tarfile.py +2519 -0
- package/python3.4.2/lib/python3.4/telnetlib.py +672 -0
- package/python3.4.2/lib/python3.4/tempfile.py +698 -0
- package/python3.4.2/lib/python3.4/test/185test.db +0 -0
- package/python3.4.2/lib/python3.4/test/Sine-1000Hz-300ms.aif +0 -0
- package/python3.4.2/lib/python3.4/test/__init__.py +1 -0
- package/python3.4.2/lib/python3.4/test/__main__.py +3 -0
- package/python3.4.2/lib/python3.4/test/_test_multiprocessing.py +3841 -0
- package/python3.4.2/lib/python3.4/test/audiodata/pluck-alaw.aifc +0 -0
- package/python3.4.2/lib/python3.4/test/audiodata/pluck-pcm16.aiff +0 -0
- package/python3.4.2/lib/python3.4/test/audiodata/pluck-pcm16.au +0 -0
- package/python3.4.2/lib/python3.4/test/audiodata/pluck-pcm16.wav +0 -0
- package/python3.4.2/lib/python3.4/test/audiodata/pluck-pcm24.aiff +0 -0
- package/python3.4.2/lib/python3.4/test/audiodata/pluck-pcm24.au +0 -0
- package/python3.4.2/lib/python3.4/test/audiodata/pluck-pcm24.wav +0 -0
- package/python3.4.2/lib/python3.4/test/audiodata/pluck-pcm32.aiff +0 -0
- package/python3.4.2/lib/python3.4/test/audiodata/pluck-pcm32.au +0 -0
- package/python3.4.2/lib/python3.4/test/audiodata/pluck-pcm32.wav +0 -0
- package/python3.4.2/lib/python3.4/test/audiodata/pluck-pcm8.aiff +0 -0
- package/python3.4.2/lib/python3.4/test/audiodata/pluck-pcm8.au +0 -0
- package/python3.4.2/lib/python3.4/test/audiodata/pluck-pcm8.wav +0 -0
- package/python3.4.2/lib/python3.4/test/audiodata/pluck-ulaw.aifc +0 -0
- package/python3.4.2/lib/python3.4/test/audiodata/pluck-ulaw.au +0 -0
- package/python3.4.2/lib/python3.4/test/audiotest.au +0 -0
- package/python3.4.2/lib/python3.4/test/audiotests.py +329 -0
- package/python3.4.2/lib/python3.4/test/autotest.py +6 -0
- package/python3.4.2/lib/python3.4/test/bad_coding.py +1 -0
- package/python3.4.2/lib/python3.4/test/bad_coding2.py +2 -0
- package/python3.4.2/lib/python3.4/test/badcert.pem +36 -0
- package/python3.4.2/lib/python3.4/test/badkey.pem +40 -0
- package/python3.4.2/lib/python3.4/test/badsyntax_3131.py +2 -0
- package/python3.4.2/lib/python3.4/test/badsyntax_future10.py +3 -0
- package/python3.4.2/lib/python3.4/test/badsyntax_future3.py +10 -0
- package/python3.4.2/lib/python3.4/test/badsyntax_future4.py +10 -0
- package/python3.4.2/lib/python3.4/test/badsyntax_future5.py +12 -0
- package/python3.4.2/lib/python3.4/test/badsyntax_future6.py +10 -0
- package/python3.4.2/lib/python3.4/test/badsyntax_future7.py +11 -0
- package/python3.4.2/lib/python3.4/test/badsyntax_future8.py +10 -0
- package/python3.4.2/lib/python3.4/test/badsyntax_future9.py +10 -0
- package/python3.4.2/lib/python3.4/test/badsyntax_pep3120.py +1 -0
- package/python3.4.2/lib/python3.4/test/buffer_tests.py +218 -0
- package/python3.4.2/lib/python3.4/test/bytecode_helper.py +41 -0
- package/python3.4.2/lib/python3.4/test/capath/4e1295a3.0 +14 -0
- package/python3.4.2/lib/python3.4/test/capath/5ed36f99.0 +41 -0
- package/python3.4.2/lib/python3.4/test/capath/6e88d7b8.0 +14 -0
- package/python3.4.2/lib/python3.4/test/capath/99d0fa06.0 +41 -0
- package/python3.4.2/lib/python3.4/test/cfgparser.1 +2 -0
- package/python3.4.2/lib/python3.4/test/cfgparser.2 +537 -0
- package/python3.4.2/lib/python3.4/test/cfgparser.3 +69 -0
- package/python3.4.2/lib/python3.4/test/check_soundcard.vbs +13 -0
- package/python3.4.2/lib/python3.4/test/cjkencodings/big5-utf8.txt +9 -0
- package/python3.4.2/lib/python3.4/test/cjkencodings/big5.txt +9 -0
- package/python3.4.2/lib/python3.4/test/cjkencodings/big5hkscs-utf8.txt +2 -0
- package/python3.4.2/lib/python3.4/test/cjkencodings/big5hkscs.txt +2 -0
- package/python3.4.2/lib/python3.4/test/cjkencodings/cp949-utf8.txt +9 -0
- package/python3.4.2/lib/python3.4/test/cjkencodings/cp949.txt +9 -0
- package/python3.4.2/lib/python3.4/test/cjkencodings/euc_jisx0213-utf8.txt +8 -0
- package/python3.4.2/lib/python3.4/test/cjkencodings/euc_jisx0213.txt +8 -0
- package/python3.4.2/lib/python3.4/test/cjkencodings/euc_jp-utf8.txt +7 -0
- package/python3.4.2/lib/python3.4/test/cjkencodings/euc_jp.txt +7 -0
- package/python3.4.2/lib/python3.4/test/cjkencodings/euc_kr-utf8.txt +7 -0
- package/python3.4.2/lib/python3.4/test/cjkencodings/euc_kr.txt +7 -0
- package/python3.4.2/lib/python3.4/test/cjkencodings/gb18030-utf8.txt +15 -0
- package/python3.4.2/lib/python3.4/test/cjkencodings/gb18030.txt +15 -0
- package/python3.4.2/lib/python3.4/test/cjkencodings/gb2312-utf8.txt +6 -0
- package/python3.4.2/lib/python3.4/test/cjkencodings/gb2312.txt +6 -0
- package/python3.4.2/lib/python3.4/test/cjkencodings/gbk-utf8.txt +14 -0
- package/python3.4.2/lib/python3.4/test/cjkencodings/gbk.txt +14 -0
- package/python3.4.2/lib/python3.4/test/cjkencodings/hz-utf8.txt +2 -0
- package/python3.4.2/lib/python3.4/test/cjkencodings/hz.txt +2 -0
- package/python3.4.2/lib/python3.4/test/cjkencodings/iso2022_jp-utf8.txt +7 -0
- package/python3.4.2/lib/python3.4/test/cjkencodings/iso2022_jp.txt +7 -0
- package/python3.4.2/lib/python3.4/test/cjkencodings/iso2022_kr-utf8.txt +7 -0
- package/python3.4.2/lib/python3.4/test/cjkencodings/iso2022_kr.txt +7 -0
- package/python3.4.2/lib/python3.4/test/cjkencodings/johab-utf8.txt +9 -0
- package/python3.4.2/lib/python3.4/test/cjkencodings/johab.txt +9 -0
- package/python3.4.2/lib/python3.4/test/cjkencodings/shift_jis-utf8.txt +7 -0
- package/python3.4.2/lib/python3.4/test/cjkencodings/shift_jis.txt +7 -0
- package/python3.4.2/lib/python3.4/test/cjkencodings/shift_jisx0213-utf8.txt +8 -0
- package/python3.4.2/lib/python3.4/test/cjkencodings/shift_jisx0213.txt +8 -0
- package/python3.4.2/lib/python3.4/test/cmath_testcases.txt +2370 -0
- package/python3.4.2/lib/python3.4/test/coding20731.py +4 -0
- package/python3.4.2/lib/python3.4/test/curses_tests.py +46 -0
- package/python3.4.2/lib/python3.4/test/data/README +2 -0
- package/python3.4.2/lib/python3.4/test/datetimetester.py +3786 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/abs.decTest +161 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/add.decTest +2716 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/and.decTest +338 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/base.decTest +1411 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/clamp.decTest +211 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/class.decTest +131 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/compare.decTest +758 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/comparetotal.decTest +798 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/comparetotmag.decTest +790 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/copy.decTest +86 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/copyabs.decTest +86 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/copynegate.decTest +86 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/copysign.decTest +177 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/ddAbs.decTest +126 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/ddAdd.decTest +1328 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/ddAnd.decTest +347 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/ddBase.decTest +1104 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/ddCanonical.decTest +357 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/ddClass.decTest +76 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/ddCompare.decTest +744 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/ddCompareSig.decTest +647 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/ddCompareTotal.decTest +706 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/ddCompareTotalMag.decTest +706 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/ddCopy.decTest +88 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/ddCopyAbs.decTest +88 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/ddCopyNegate.decTest +88 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/ddCopySign.decTest +175 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/ddDivide.decTest +863 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/ddDivideInt.decTest +449 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/ddEncode.decTest +495 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/ddFMA.decTest +1698 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/ddInvert.decTest +202 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/ddLogB.decTest +159 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/ddMax.decTest +322 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/ddMaxMag.decTest +304 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/ddMin.decTest +309 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/ddMinMag.decTest +293 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/ddMinus.decTest +88 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/ddMultiply.decTest +553 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/ddNextMinus.decTest +126 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/ddNextPlus.decTest +124 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/ddNextToward.decTest +374 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/ddOr.decTest +292 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/ddPlus.decTest +88 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/ddQuantize.decTest +833 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/ddReduce.decTest +182 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/ddRemainder.decTest +600 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/ddRemainderNear.decTest +629 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/ddRotate.decTest +262 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/ddSameQuantum.decTest +389 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/ddScaleB.decTest +243 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/ddShift.decTest +262 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/ddSubtract.decTest +629 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/ddToIntegral.decTest +257 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/ddXor.decTest +337 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/decDouble.decTest +65 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/decQuad.decTest +65 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/decSingle.decTest +25 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/divide.decTest +854 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/divideint.decTest +486 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/dqAbs.decTest +126 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/dqAdd.decTest +1215 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/dqAnd.decTest +420 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/dqBase.decTest +1081 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/dqCanonical.decTest +372 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/dqClass.decTest +77 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/dqCompare.decTest +753 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/dqCompareSig.decTest +647 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/dqCompareTotal.decTest +706 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/dqCompareTotalMag.decTest +706 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/dqCopy.decTest +88 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/dqCopyAbs.decTest +88 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/dqCopyNegate.decTest +88 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/dqCopySign.decTest +175 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/dqDivide.decTest +808 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/dqDivideInt.decTest +453 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/dqEncode.decTest +477 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/dqFMA.decTest +1786 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/dqInvert.decTest +245 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/dqLogB.decTest +160 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/dqMax.decTest +322 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/dqMaxMag.decTest +304 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/dqMin.decTest +309 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/dqMinMag.decTest +293 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/dqMinus.decTest +88 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/dqMultiply.decTest +589 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/dqNextMinus.decTest +126 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/dqNextPlus.decTest +124 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/dqNextToward.decTest +375 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/dqOr.decTest +401 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/dqPlus.decTest +88 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/dqQuantize.decTest +836 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/dqReduce.decTest +183 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/dqRemainder.decTest +597 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/dqRemainderNear.decTest +631 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/dqRotate.decTest +298 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/dqSameQuantum.decTest +389 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/dqScaleB.decTest +260 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/dqShift.decTest +298 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/dqSubtract.decTest +635 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/dqToIntegral.decTest +257 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/dqXor.decTest +410 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/dsBase.decTest +1062 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/dsEncode.decTest +372 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/exp.decTest +674 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/extra.decTest +2830 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/fma.decTest +3426 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/inexact.decTest +215 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/invert.decTest +176 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/ln.decTest +611 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/log10.decTest +551 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/logb.decTest +188 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/max.decTest +424 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/maxmag.decTest +404 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/min.decTest +407 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/minmag.decTest +390 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/minus.decTest +182 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/multiply.decTest +731 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/nextminus.decTest +148 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/nextplus.decTest +150 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/nexttoward.decTest +426 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/or.decTest +334 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/plus.decTest +195 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/power.decTest +1624 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/powersqrt.decTest +2970 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/quantize.decTest +948 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/randomBound32.decTest +2443 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/randoms.decTest +4030 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/reduce.decTest +234 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/remainder.decTest +640 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/remainderNear.decTest +572 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/rescale.decTest +764 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/rotate.decTest +247 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/rounding.decTest +1303 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/samequantum.decTest +389 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/scaleb.decTest +209 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/shift.decTest +250 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/squareroot.decTest +3834 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/subtract.decTest +873 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/testall.decTest +87 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/tointegral.decTest +241 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/tointegralx.decTest +255 -0
- package/python3.4.2/lib/python3.4/test/decimaltestdata/xor.decTest +335 -0
- package/python3.4.2/lib/python3.4/test/dh512.pem +9 -0
- package/python3.4.2/lib/python3.4/test/dis_module.py +5 -0
- package/python3.4.2/lib/python3.4/test/doctest_aliases.py +13 -0
- package/python3.4.2/lib/python3.4/test/double_const.py +30 -0
- package/python3.4.2/lib/python3.4/test/empty.vbs +1 -0
- package/python3.4.2/lib/python3.4/test/encoded_modules/__init__.py +23 -0
- package/python3.4.2/lib/python3.4/test/encoded_modules/module_iso_8859_1.py +5 -0
- package/python3.4.2/lib/python3.4/test/encoded_modules/module_koi8_r.py +3 -0
- package/python3.4.2/lib/python3.4/test/exception_hierarchy.txt +61 -0
- package/python3.4.2/lib/python3.4/test/final_a.py +19 -0
- package/python3.4.2/lib/python3.4/test/final_b.py +19 -0
- package/python3.4.2/lib/python3.4/test/floating_points.txt +1028 -0
- package/python3.4.2/lib/python3.4/test/fork_wait.py +77 -0
- package/python3.4.2/lib/python3.4/test/formatfloat_testcases.txt +355 -0
- package/python3.4.2/lib/python3.4/test/future_test1.py +11 -0
- package/python3.4.2/lib/python3.4/test/future_test2.py +10 -0
- package/python3.4.2/lib/python3.4/test/gdb_sample.py +12 -0
- package/python3.4.2/lib/python3.4/test/https_svn_python_org_root.pem +41 -0
- package/python3.4.2/lib/python3.4/test/ieee754.txt +185 -0
- package/python3.4.2/lib/python3.4/test/imghdrdata/python.bmp +0 -0
- package/python3.4.2/lib/python3.4/test/imghdrdata/python.gif +0 -0
- package/python3.4.2/lib/python3.4/test/imghdrdata/python.jpg +0 -0
- package/python3.4.2/lib/python3.4/test/imghdrdata/python.pbm +3 -0
- package/python3.4.2/lib/python3.4/test/imghdrdata/python.pgm +0 -0
- package/python3.4.2/lib/python3.4/test/imghdrdata/python.png +0 -0
- package/python3.4.2/lib/python3.4/test/imghdrdata/python.ppm +0 -0
- package/python3.4.2/lib/python3.4/test/imghdrdata/python.ras +0 -0
- package/python3.4.2/lib/python3.4/test/imghdrdata/python.sgi +0 -0
- package/python3.4.2/lib/python3.4/test/imghdrdata/python.tiff +0 -0
- package/python3.4.2/lib/python3.4/test/imghdrdata/python.xbm +6 -0
- package/python3.4.2/lib/python3.4/test/inspect_fodder.py +58 -0
- package/python3.4.2/lib/python3.4/test/inspect_fodder2.py +111 -0
- package/python3.4.2/lib/python3.4/test/keycert.passwd.pem +33 -0
- package/python3.4.2/lib/python3.4/test/keycert.pem +31 -0
- package/python3.4.2/lib/python3.4/test/keycert2.pem +31 -0
- package/python3.4.2/lib/python3.4/test/keycert3.pem +73 -0
- package/python3.4.2/lib/python3.4/test/keycert4.pem +73 -0
- package/python3.4.2/lib/python3.4/test/list_tests.py +585 -0
- package/python3.4.2/lib/python3.4/test/lock_tests.py +896 -0
- package/python3.4.2/lib/python3.4/test/mailcap.txt +39 -0
- package/python3.4.2/lib/python3.4/test/make_ssl_certs.py +176 -0
- package/python3.4.2/lib/python3.4/test/mapping_tests.py +657 -0
- package/python3.4.2/lib/python3.4/test/math_testcases.txt +633 -0
- package/python3.4.2/lib/python3.4/test/memory_watchdog.py +28 -0
- package/python3.4.2/lib/python3.4/test/mime.types +1445 -0
- package/python3.4.2/lib/python3.4/test/mock_socket.py +156 -0
- package/python3.4.2/lib/python3.4/test/mp_fork_bomb.py +18 -0
- package/python3.4.2/lib/python3.4/test/multibytecodec_support.py +377 -0
- package/python3.4.2/lib/python3.4/test/nokia.pem +31 -0
- package/python3.4.2/lib/python3.4/test/nullbytecert.pem +90 -0
- package/python3.4.2/lib/python3.4/test/nullcert.pem +0 -0
- package/python3.4.2/lib/python3.4/test/outstanding_bugs.py +18 -0
- package/python3.4.2/lib/python3.4/test/pickletester.py +2253 -0
- package/python3.4.2/lib/python3.4/test/profilee.py +115 -0
- package/python3.4.2/lib/python3.4/test/pstats.pck +0 -0
- package/python3.4.2/lib/python3.4/test/pycacert.pem +78 -0
- package/python3.4.2/lib/python3.4/test/pycakey.pem +28 -0
- package/python3.4.2/lib/python3.4/test/pyclbr_input.py +33 -0
- package/python3.4.2/lib/python3.4/test/pydoc_mod.py +37 -0
- package/python3.4.2/lib/python3.4/test/pydocfodder.py +216 -0
- package/python3.4.2/lib/python3.4/test/pystone.py +277 -0
- package/python3.4.2/lib/python3.4/test/randv2_32.pck +633 -0
- package/python3.4.2/lib/python3.4/test/randv2_64.pck +633 -0
- package/python3.4.2/lib/python3.4/test/randv3.pck +633 -0
- package/python3.4.2/lib/python3.4/test/re_tests.py +670 -0
- package/python3.4.2/lib/python3.4/test/regrtest.py +1589 -0
- package/python3.4.2/lib/python3.4/test/relimport.py +1 -0
- package/python3.4.2/lib/python3.4/test/reperf.py +23 -0
- package/python3.4.2/lib/python3.4/test/revocation.crl +11 -0
- package/python3.4.2/lib/python3.4/test/sample_doctest.py +76 -0
- package/python3.4.2/lib/python3.4/test/sample_doctest_no_docstrings.py +12 -0
- package/python3.4.2/lib/python3.4/test/sample_doctest_no_doctests.py +15 -0
- package/python3.4.2/lib/python3.4/test/script_helper.py +178 -0
- package/python3.4.2/lib/python3.4/test/seq_tests.py +397 -0
- package/python3.4.2/lib/python3.4/test/sgml_input.html +212 -0
- package/python3.4.2/lib/python3.4/test/sha256.pem +128 -0
- package/python3.4.2/lib/python3.4/test/sndhdrdata/README +12 -0
- package/python3.4.2/lib/python3.4/test/sndhdrdata/sndhdr.8svx +0 -0
- package/python3.4.2/lib/python3.4/test/sndhdrdata/sndhdr.aifc +0 -0
- package/python3.4.2/lib/python3.4/test/sndhdrdata/sndhdr.aiff +0 -0
- package/python3.4.2/lib/python3.4/test/sndhdrdata/sndhdr.au +0 -0
- package/python3.4.2/lib/python3.4/test/sndhdrdata/sndhdr.hcom +0 -0
- package/python3.4.2/lib/python3.4/test/sndhdrdata/sndhdr.sndt +0 -0
- package/python3.4.2/lib/python3.4/test/sndhdrdata/sndhdr.voc +0 -0
- package/python3.4.2/lib/python3.4/test/sndhdrdata/sndhdr.wav +0 -0
- package/python3.4.2/lib/python3.4/test/sortperf.py +169 -0
- package/python3.4.2/lib/python3.4/test/ssl_cert.pem +15 -0
- package/python3.4.2/lib/python3.4/test/ssl_key.passwd.pem +18 -0
- package/python3.4.2/lib/python3.4/test/ssl_key.pem +16 -0
- package/python3.4.2/lib/python3.4/test/ssl_servers.py +205 -0
- package/python3.4.2/lib/python3.4/test/ssltests.py +22 -0
- package/python3.4.2/lib/python3.4/test/string_tests.py +1385 -0
- package/python3.4.2/lib/python3.4/test/subprocessdata/fd_status.py +34 -0
- package/python3.4.2/lib/python3.4/test/subprocessdata/input_reader.py +7 -0
- package/python3.4.2/lib/python3.4/test/subprocessdata/qcat.py +7 -0
- package/python3.4.2/lib/python3.4/test/subprocessdata/qgrep.py +10 -0
- package/python3.4.2/lib/python3.4/test/subprocessdata/sigchild_ignore.py +15 -0
- package/python3.4.2/lib/python3.4/test/support/__init__.py +2241 -0
- package/python3.4.2/lib/python3.4/test/test___all__.py +117 -0
- package/python3.4.2/lib/python3.4/test/test___future__.py +65 -0
- package/python3.4.2/lib/python3.4/test/test__locale.py +170 -0
- package/python3.4.2/lib/python3.4/test/test__opcode.py +23 -0
- package/python3.4.2/lib/python3.4/test/test__osx_support.py +281 -0
- package/python3.4.2/lib/python3.4/test/test_abc.py +408 -0
- package/python3.4.2/lib/python3.4/test/test_abstract_numbers.py +44 -0
- package/python3.4.2/lib/python3.4/test/test_aifc.py +384 -0
- package/python3.4.2/lib/python3.4/test/test_argparse.py +4979 -0
- package/python3.4.2/lib/python3.4/test/test_array.py +1323 -0
- package/python3.4.2/lib/python3.4/test/test_ast.py +1038 -0
- package/python3.4.2/lib/python3.4/test/test_asynchat.py +333 -0
- package/python3.4.2/lib/python3.4/test/test_asyncio/__init__.py +10 -0
- package/python3.4.2/lib/python3.4/test/test_asyncio/__main__.py +4 -0
- package/python3.4.2/lib/python3.4/test/test_asyncio/echo.py +8 -0
- package/python3.4.2/lib/python3.4/test/test_asyncio/echo2.py +6 -0
- package/python3.4.2/lib/python3.4/test/test_asyncio/echo3.py +11 -0
- package/python3.4.2/lib/python3.4/test/test_asyncio/keycert3.pem +73 -0
- package/python3.4.2/lib/python3.4/test/test_asyncio/pycacert.pem +78 -0
- package/python3.4.2/lib/python3.4/test/test_asyncio/ssl_cert.pem +15 -0
- package/python3.4.2/lib/python3.4/test/test_asyncio/ssl_key.pem +16 -0
- package/python3.4.2/lib/python3.4/test/test_asyncio/test_base_events.py +1064 -0
- package/python3.4.2/lib/python3.4/test/test_asyncio/test_events.py +2240 -0
- package/python3.4.2/lib/python3.4/test/test_asyncio/test_futures.py +442 -0
- package/python3.4.2/lib/python3.4/test/test_asyncio/test_locks.py +858 -0
- package/python3.4.2/lib/python3.4/test/test_asyncio/test_proactor_events.py +492 -0
- package/python3.4.2/lib/python3.4/test/test_asyncio/test_queues.py +476 -0
- package/python3.4.2/lib/python3.4/test/test_asyncio/test_selector_events.py +1737 -0
- package/python3.4.2/lib/python3.4/test/test_asyncio/test_streams.py +628 -0
- package/python3.4.2/lib/python3.4/test/test_asyncio/test_subprocess.py +217 -0
- package/python3.4.2/lib/python3.4/test/test_asyncio/test_tasks.py +1977 -0
- package/python3.4.2/lib/python3.4/test/test_asyncio/test_transports.py +90 -0
- package/python3.4.2/lib/python3.4/test/test_asyncio/test_unix_events.py +1582 -0
- package/python3.4.2/lib/python3.4/test/test_asyncio/test_windows_events.py +141 -0
- package/python3.4.2/lib/python3.4/test/test_asyncio/test_windows_utils.py +171 -0
- package/python3.4.2/lib/python3.4/test/test_asyncore.py +859 -0
- package/python3.4.2/lib/python3.4/test/test_atexit.py +185 -0
- package/python3.4.2/lib/python3.4/test/test_audioop.py +534 -0
- package/python3.4.2/lib/python3.4/test/test_augassign.py +315 -0
- package/python3.4.2/lib/python3.4/test/test_base64.py +666 -0
- package/python3.4.2/lib/python3.4/test/test_bigaddrspace.py +101 -0
- package/python3.4.2/lib/python3.4/test/test_bigmem.py +1257 -0
- package/python3.4.2/lib/python3.4/test/test_binascii.py +270 -0
- package/python3.4.2/lib/python3.4/test/test_binhex.py +56 -0
- package/python3.4.2/lib/python3.4/test/test_binop.py +380 -0
- package/python3.4.2/lib/python3.4/test/test_bisect.py +328 -0
- package/python3.4.2/lib/python3.4/test/test_bool.py +347 -0
- package/python3.4.2/lib/python3.4/test/test_buffer.py +4294 -0
- package/python3.4.2/lib/python3.4/test/test_bufio.py +73 -0
- package/python3.4.2/lib/python3.4/test/test_builtin.py +1637 -0
- package/python3.4.2/lib/python3.4/test/test_bytes.py +1433 -0
- package/python3.4.2/lib/python3.4/test/test_bz2.py +880 -0
- package/python3.4.2/lib/python3.4/test/test_calendar.py +714 -0
- package/python3.4.2/lib/python3.4/test/test_call.py +131 -0
- package/python3.4.2/lib/python3.4/test/test_capi.py +469 -0
- package/python3.4.2/lib/python3.4/test/test_cgi.py +489 -0
- package/python3.4.2/lib/python3.4/test/test_cgitb.py +70 -0
- package/python3.4.2/lib/python3.4/test/test_charmapcodec.py +56 -0
- package/python3.4.2/lib/python3.4/test/test_class.py +552 -0
- package/python3.4.2/lib/python3.4/test/test_cmath.py +536 -0
- package/python3.4.2/lib/python3.4/test/test_cmd.py +243 -0
- package/python3.4.2/lib/python3.4/test/test_cmd_line.py +473 -0
- package/python3.4.2/lib/python3.4/test/test_cmd_line_script.py +481 -0
- package/python3.4.2/lib/python3.4/test/test_code.py +170 -0
- package/python3.4.2/lib/python3.4/test/test_code_module.py +86 -0
- package/python3.4.2/lib/python3.4/test/test_codeccallbacks.py +880 -0
- package/python3.4.2/lib/python3.4/test/test_codecencodings_cn.py +90 -0
- package/python3.4.2/lib/python3.4/test/test_codecencodings_hk.py +26 -0
- package/python3.4.2/lib/python3.4/test/test_codecencodings_iso2022.py +45 -0
- package/python3.4.2/lib/python3.4/test/test_codecencodings_jp.py +130 -0
- package/python3.4.2/lib/python3.4/test/test_codecencodings_kr.py +73 -0
- package/python3.4.2/lib/python3.4/test/test_codecencodings_tw.py +26 -0
- package/python3.4.2/lib/python3.4/test/test_codecmaps_cn.py +29 -0
- package/python3.4.2/lib/python3.4/test/test_codecmaps_hk.py +16 -0
- package/python3.4.2/lib/python3.4/test/test_codecmaps_jp.py +63 -0
- package/python3.4.2/lib/python3.4/test/test_codecmaps_kr.py +40 -0
- package/python3.4.2/lib/python3.4/test/test_codecmaps_tw.py +30 -0
- package/python3.4.2/lib/python3.4/test/test_codecs.py +2901 -0
- package/python3.4.2/lib/python3.4/test/test_codeop.py +304 -0
- package/python3.4.2/lib/python3.4/test/test_collections.py +1552 -0
- package/python3.4.2/lib/python3.4/test/test_colorsys.py +100 -0
- package/python3.4.2/lib/python3.4/test/test_compare.py +67 -0
- package/python3.4.2/lib/python3.4/test/test_compile.py +561 -0
- package/python3.4.2/lib/python3.4/test/test_compileall.py +384 -0
- package/python3.4.2/lib/python3.4/test/test_complex.py +638 -0
- package/python3.4.2/lib/python3.4/test/test_concurrent_futures.py +685 -0
- package/python3.4.2/lib/python3.4/test/test_configparser.py +1768 -0
- package/python3.4.2/lib/python3.4/test/test_contains.py +93 -0
- package/python3.4.2/lib/python3.4/test/test_contextlib.py +828 -0
- package/python3.4.2/lib/python3.4/test/test_copy.py +759 -0
- package/python3.4.2/lib/python3.4/test/test_copyreg.py +121 -0
- package/python3.4.2/lib/python3.4/test/test_cprofile.py +98 -0
- package/python3.4.2/lib/python3.4/test/test_crashers.py +38 -0
- package/python3.4.2/lib/python3.4/test/test_crypt.py +33 -0
- package/python3.4.2/lib/python3.4/test/test_csv.py +1074 -0
- package/python3.4.2/lib/python3.4/test/test_ctypes.py +6 -0
- package/python3.4.2/lib/python3.4/test/test_curses.py +395 -0
- package/python3.4.2/lib/python3.4/test/test_datetime.py +48 -0
- package/python3.4.2/lib/python3.4/test/test_dbm.py +193 -0
- package/python3.4.2/lib/python3.4/test/test_dbm_dumb.py +228 -0
- package/python3.4.2/lib/python3.4/test/test_dbm_gnu.py +97 -0
- package/python3.4.2/lib/python3.4/test/test_dbm_ndbm.py +54 -0
- package/python3.4.2/lib/python3.4/test/test_decimal.py +5504 -0
- package/python3.4.2/lib/python3.4/test/test_decorators.py +309 -0
- package/python3.4.2/lib/python3.4/test/test_defaultdict.py +190 -0
- package/python3.4.2/lib/python3.4/test/test_deque.py +817 -0
- package/python3.4.2/lib/python3.4/test/test_descr.py +5006 -0
- package/python3.4.2/lib/python3.4/test/test_descrtut.py +485 -0
- package/python3.4.2/lib/python3.4/test/test_devpoll.py +146 -0
- package/python3.4.2/lib/python3.4/test/test_dict.py +928 -0
- package/python3.4.2/lib/python3.4/test/test_dictcomps.py +88 -0
- package/python3.4.2/lib/python3.4/test/test_dictviews.py +206 -0
- package/python3.4.2/lib/python3.4/test/test_difflib.py +298 -0
- package/python3.4.2/lib/python3.4/test/test_difflib_expect.html +526 -0
- package/python3.4.2/lib/python3.4/test/test_dis.py +832 -0
- package/python3.4.2/lib/python3.4/test/test_distutils.py +18 -0
- package/python3.4.2/lib/python3.4/test/test_doctest.py +2921 -0
- package/python3.4.2/lib/python3.4/test/test_doctest.txt +17 -0
- package/python3.4.2/lib/python3.4/test/test_doctest2.py +123 -0
- package/python3.4.2/lib/python3.4/test/test_doctest2.txt +14 -0
- package/python3.4.2/lib/python3.4/test/test_doctest3.txt +5 -0
- package/python3.4.2/lib/python3.4/test/test_doctest4.txt +11 -0
- package/python3.4.2/lib/python3.4/test/test_docxmlrpc.py +219 -0
- package/python3.4.2/lib/python3.4/test/test_dummy_thread.py +182 -0
- package/python3.4.2/lib/python3.4/test/test_dummy_threading.py +64 -0
- package/python3.4.2/lib/python3.4/test/test_dynamic.py +143 -0
- package/python3.4.2/lib/python3.4/test/test_dynamicclassattribute.py +304 -0
- package/python3.4.2/lib/python3.4/test/test_email/__init__.py +159 -0
- package/python3.4.2/lib/python3.4/test/test_email/__main__.py +4 -0
- package/python3.4.2/lib/python3.4/test/test_email/data/PyBanner048.gif +0 -0
- package/python3.4.2/lib/python3.4/test/test_email/data/audiotest.au +0 -0
- package/python3.4.2/lib/python3.4/test/test_email/data/msg_01.txt +19 -0
- package/python3.4.2/lib/python3.4/test/test_email/data/msg_02.txt +136 -0
- package/python3.4.2/lib/python3.4/test/test_email/data/msg_03.txt +16 -0
- package/python3.4.2/lib/python3.4/test/test_email/data/msg_04.txt +37 -0
- package/python3.4.2/lib/python3.4/test/test_email/data/msg_05.txt +28 -0
- package/python3.4.2/lib/python3.4/test/test_email/data/msg_06.txt +33 -0
- package/python3.4.2/lib/python3.4/test/test_email/data/msg_07.txt +83 -0
- package/python3.4.2/lib/python3.4/test/test_email/data/msg_08.txt +24 -0
- package/python3.4.2/lib/python3.4/test/test_email/data/msg_09.txt +24 -0
- package/python3.4.2/lib/python3.4/test/test_email/data/msg_10.txt +39 -0
- package/python3.4.2/lib/python3.4/test/test_email/data/msg_11.txt +7 -0
- package/python3.4.2/lib/python3.4/test/test_email/data/msg_12.txt +36 -0
- package/python3.4.2/lib/python3.4/test/test_email/data/msg_12a.txt +38 -0
- package/python3.4.2/lib/python3.4/test/test_email/data/msg_13.txt +94 -0
- package/python3.4.2/lib/python3.4/test/test_email/data/msg_14.txt +23 -0
- package/python3.4.2/lib/python3.4/test/test_email/data/msg_15.txt +52 -0
- package/python3.4.2/lib/python3.4/test/test_email/data/msg_16.txt +123 -0
- package/python3.4.2/lib/python3.4/test/test_email/data/msg_17.txt +12 -0
- package/python3.4.2/lib/python3.4/test/test_email/data/msg_18.txt +6 -0
- package/python3.4.2/lib/python3.4/test/test_email/data/msg_19.txt +43 -0
- package/python3.4.2/lib/python3.4/test/test_email/data/msg_20.txt +22 -0
- package/python3.4.2/lib/python3.4/test/test_email/data/msg_21.txt +20 -0
- package/python3.4.2/lib/python3.4/test/test_email/data/msg_22.txt +46 -0
- package/python3.4.2/lib/python3.4/test/test_email/data/msg_23.txt +8 -0
- package/python3.4.2/lib/python3.4/test/test_email/data/msg_24.txt +10 -0
- package/python3.4.2/lib/python3.4/test/test_email/data/msg_25.txt +117 -0
- package/python3.4.2/lib/python3.4/test/test_email/data/msg_26.txt +46 -0
- package/python3.4.2/lib/python3.4/test/test_email/data/msg_27.txt +15 -0
- package/python3.4.2/lib/python3.4/test/test_email/data/msg_28.txt +25 -0
- package/python3.4.2/lib/python3.4/test/test_email/data/msg_29.txt +22 -0
- package/python3.4.2/lib/python3.4/test/test_email/data/msg_30.txt +23 -0
- package/python3.4.2/lib/python3.4/test/test_email/data/msg_31.txt +15 -0
- package/python3.4.2/lib/python3.4/test/test_email/data/msg_32.txt +14 -0
- package/python3.4.2/lib/python3.4/test/test_email/data/msg_33.txt +29 -0
- package/python3.4.2/lib/python3.4/test/test_email/data/msg_34.txt +19 -0
- package/python3.4.2/lib/python3.4/test/test_email/data/msg_35.txt +4 -0
- package/python3.4.2/lib/python3.4/test/test_email/data/msg_36.txt +40 -0
- package/python3.4.2/lib/python3.4/test/test_email/data/msg_37.txt +22 -0
- package/python3.4.2/lib/python3.4/test/test_email/data/msg_38.txt +101 -0
- package/python3.4.2/lib/python3.4/test/test_email/data/msg_39.txt +83 -0
- package/python3.4.2/lib/python3.4/test/test_email/data/msg_40.txt +10 -0
- package/python3.4.2/lib/python3.4/test/test_email/data/msg_41.txt +8 -0
- package/python3.4.2/lib/python3.4/test/test_email/data/msg_42.txt +20 -0
- package/python3.4.2/lib/python3.4/test/test_email/data/msg_43.txt +217 -0
- package/python3.4.2/lib/python3.4/test/test_email/data/msg_44.txt +33 -0
- package/python3.4.2/lib/python3.4/test/test_email/data/msg_45.txt +33 -0
- package/python3.4.2/lib/python3.4/test/test_email/data/msg_46.txt +23 -0
- package/python3.4.2/lib/python3.4/test/test_email/test__encoded_words.py +192 -0
- package/python3.4.2/lib/python3.4/test/test_email/test__header_value_parser.py +2606 -0
- package/python3.4.2/lib/python3.4/test/test_email/test_asian_codecs.py +82 -0
- package/python3.4.2/lib/python3.4/test/test_email/test_contentmanager.py +796 -0
- package/python3.4.2/lib/python3.4/test/test_email/test_defect_handling.py +320 -0
- package/python3.4.2/lib/python3.4/test/test_email/test_email.py +5289 -0
- package/python3.4.2/lib/python3.4/test/test_email/test_generator.py +199 -0
- package/python3.4.2/lib/python3.4/test/test_email/test_headerregistry.py +1594 -0
- package/python3.4.2/lib/python3.4/test/test_email/test_inversion.py +49 -0
- package/python3.4.2/lib/python3.4/test/test_email/test_message.py +783 -0
- package/python3.4.2/lib/python3.4/test/test_email/test_parser.py +36 -0
- package/python3.4.2/lib/python3.4/test/test_email/test_pickleable.py +74 -0
- package/python3.4.2/lib/python3.4/test/test_email/test_policy.py +332 -0
- package/python3.4.2/lib/python3.4/test/test_email/test_utils.py +140 -0
- package/python3.4.2/lib/python3.4/test/test_email/torture_test.py +136 -0
- package/python3.4.2/lib/python3.4/test/test_ensurepip.py +345 -0
- package/python3.4.2/lib/python3.4/test/test_enum.py +1592 -0
- package/python3.4.2/lib/python3.4/test/test_enumerate.py +272 -0
- package/python3.4.2/lib/python3.4/test/test_eof.py +31 -0
- package/python3.4.2/lib/python3.4/test/test_epoll.py +259 -0
- package/python3.4.2/lib/python3.4/test/test_errno.py +40 -0
- package/python3.4.2/lib/python3.4/test/test_exception_variations.py +180 -0
- package/python3.4.2/lib/python3.4/test/test_exceptions.py +978 -0
- package/python3.4.2/lib/python3.4/test/test_extcall.py +349 -0
- package/python3.4.2/lib/python3.4/test/test_faulthandler.py +623 -0
- package/python3.4.2/lib/python3.4/test/test_fcntl.py +152 -0
- package/python3.4.2/lib/python3.4/test/test_file.py +329 -0
- package/python3.4.2/lib/python3.4/test/test_file_eintr.py +236 -0
- package/python3.4.2/lib/python3.4/test/test_filecmp.py +217 -0
- package/python3.4.2/lib/python3.4/test/test_fileinput.py +891 -0
- package/python3.4.2/lib/python3.4/test/test_fileio.py +480 -0
- package/python3.4.2/lib/python3.4/test/test_finalization.py +522 -0
- package/python3.4.2/lib/python3.4/test/test_float.py +1312 -0
- package/python3.4.2/lib/python3.4/test/test_flufl.py +27 -0
- package/python3.4.2/lib/python3.4/test/test_fnmatch.py +89 -0
- package/python3.4.2/lib/python3.4/test/test_fork1.py +111 -0
- package/python3.4.2/lib/python3.4/test/test_format.py +362 -0
- package/python3.4.2/lib/python3.4/test/test_fractions.py +612 -0
- package/python3.4.2/lib/python3.4/test/test_frame.py +168 -0
- package/python3.4.2/lib/python3.4/test/test_ftplib.py +1080 -0
- package/python3.4.2/lib/python3.4/test/test_funcattrs.py +385 -0
- package/python3.4.2/lib/python3.4/test/test_functools.py +1584 -0
- package/python3.4.2/lib/python3.4/test/test_future.py +125 -0
- package/python3.4.2/lib/python3.4/test/test_future3.py +26 -0
- package/python3.4.2/lib/python3.4/test/test_future4.py +6 -0
- package/python3.4.2/lib/python3.4/test/test_future5.py +21 -0
- package/python3.4.2/lib/python3.4/test/test_gc.py +1013 -0
- package/python3.4.2/lib/python3.4/test/test_gdb.py +870 -0
- package/python3.4.2/lib/python3.4/test/test_generators.py +1940 -0
- package/python3.4.2/lib/python3.4/test/test_genericpath.py +439 -0
- package/python3.4.2/lib/python3.4/test/test_genexps.py +285 -0
- package/python3.4.2/lib/python3.4/test/test_getargs2.py +615 -0
- package/python3.4.2/lib/python3.4/test/test_getopt.py +187 -0
- package/python3.4.2/lib/python3.4/test/test_getpass.py +163 -0
- package/python3.4.2/lib/python3.4/test/test_gettext.py +467 -0
- package/python3.4.2/lib/python3.4/test/test_glob.py +200 -0
- package/python3.4.2/lib/python3.4/test/test_global.py +61 -0
- package/python3.4.2/lib/python3.4/test/test_grammar.py +1024 -0
- package/python3.4.2/lib/python3.4/test/test_grp.py +99 -0
- package/python3.4.2/lib/python3.4/test/test_gzip.py +561 -0
- package/python3.4.2/lib/python3.4/test/test_hash.py +346 -0
- package/python3.4.2/lib/python3.4/test/test_hashlib.py +533 -0
- package/python3.4.2/lib/python3.4/test/test_heapq.py +417 -0
- package/python3.4.2/lib/python3.4/test/test_hmac.py +506 -0
- package/python3.4.2/lib/python3.4/test/test_html.py +104 -0
- package/python3.4.2/lib/python3.4/test/test_htmlparser.py +832 -0
- package/python3.4.2/lib/python3.4/test/test_http_cookiejar.py +1714 -0
- package/python3.4.2/lib/python3.4/test/test_http_cookies.py +243 -0
- package/python3.4.2/lib/python3.4/test/test_httplib.py +1025 -0
- package/python3.4.2/lib/python3.4/test/test_httpservers.py +770 -0
- package/python3.4.2/lib/python3.4/test/test_idle.py +16 -0
- package/python3.4.2/lib/python3.4/test/test_imaplib.py +504 -0
- package/python3.4.2/lib/python3.4/test/test_imghdr.py +131 -0
- package/python3.4.2/lib/python3.4/test/test_imp.py +485 -0
- package/python3.4.2/lib/python3.4/test/test_import.py +1072 -0
- package/python3.4.2/lib/python3.4/test/test_importlib/__init__.py +5 -0
- package/python3.4.2/lib/python3.4/test/test_importlib/__main__.py +4 -0
- package/python3.4.2/lib/python3.4/test/test_importlib/abc.py +94 -0
- package/python3.4.2/lib/python3.4/test/test_importlib/builtin/__init__.py +5 -0
- package/python3.4.2/lib/python3.4/test/test_importlib/builtin/__main__.py +4 -0
- package/python3.4.2/lib/python3.4/test/test_importlib/builtin/test_finder.py +85 -0
- package/python3.4.2/lib/python3.4/test/test_importlib/builtin/test_loader.py +106 -0
- package/python3.4.2/lib/python3.4/test/test_importlib/builtin/util.py +7 -0
- package/python3.4.2/lib/python3.4/test/test_importlib/extension/__init__.py +5 -0
- package/python3.4.2/lib/python3.4/test/test_importlib/extension/__main__.py +4 -0
- package/python3.4.2/lib/python3.4/test/test_importlib/extension/test_case_sensitivity.py +51 -0
- package/python3.4.2/lib/python3.4/test/test_importlib/extension/test_finder.py +44 -0
- package/python3.4.2/lib/python3.4/test/test_importlib/extension/test_loader.py +86 -0
- package/python3.4.2/lib/python3.4/test/test_importlib/extension/test_path_hook.py +32 -0
- package/python3.4.2/lib/python3.4/test/test_importlib/extension/util.py +19 -0
- package/python3.4.2/lib/python3.4/test/test_importlib/frozen/__init__.py +5 -0
- package/python3.4.2/lib/python3.4/test/test_importlib/frozen/__main__.py +4 -0
- package/python3.4.2/lib/python3.4/test/test_importlib/frozen/test_finder.py +80 -0
- package/python3.4.2/lib/python3.4/test/test_importlib/frozen/test_loader.py +222 -0
- package/python3.4.2/lib/python3.4/test/test_importlib/import_/__init__.py +5 -0
- package/python3.4.2/lib/python3.4/test/test_importlib/import_/__main__.py +4 -0
- package/python3.4.2/lib/python3.4/test/test_importlib/import_/test___loader__.py +70 -0
- package/python3.4.2/lib/python3.4/test/test_importlib/import_/test___package__.py +133 -0
- package/python3.4.2/lib/python3.4/test/test_importlib/import_/test_api.py +94 -0
- package/python3.4.2/lib/python3.4/test/test_importlib/import_/test_caching.py +92 -0
- package/python3.4.2/lib/python3.4/test/test_importlib/import_/test_fromlist.py +129 -0
- package/python3.4.2/lib/python3.4/test/test_importlib/import_/test_meta_path.py +119 -0
- package/python3.4.2/lib/python3.4/test/test_importlib/import_/test_packages.py +110 -0
- package/python3.4.2/lib/python3.4/test/test_importlib/import_/test_path.py +144 -0
- package/python3.4.2/lib/python3.4/test/test_importlib/import_/test_relative_imports.py +216 -0
- package/python3.4.2/lib/python3.4/test/test_importlib/import_/util.py +20 -0
- package/python3.4.2/lib/python3.4/test/test_importlib/namespace_pkgs/both_portions/foo/one.py +1 -0
- package/python3.4.2/lib/python3.4/test/test_importlib/namespace_pkgs/both_portions/foo/two.py +1 -0
- package/python3.4.2/lib/python3.4/test/test_importlib/namespace_pkgs/missing_directory.zip +0 -0
- package/python3.4.2/lib/python3.4/test/test_importlib/namespace_pkgs/module_and_namespace_package/a_test/empty +0 -0
- package/python3.4.2/lib/python3.4/test/test_importlib/namespace_pkgs/module_and_namespace_package/a_test.py +1 -0
- package/python3.4.2/lib/python3.4/test/test_importlib/namespace_pkgs/nested_portion1.zip +0 -0
- package/python3.4.2/lib/python3.4/test/test_importlib/namespace_pkgs/not_a_namespace_pkg/foo/__init__.py +0 -0
- package/python3.4.2/lib/python3.4/test/test_importlib/namespace_pkgs/not_a_namespace_pkg/foo/one.py +1 -0
- package/python3.4.2/lib/python3.4/test/test_importlib/namespace_pkgs/portion1/foo/one.py +1 -0
- package/python3.4.2/lib/python3.4/test/test_importlib/namespace_pkgs/portion2/foo/two.py +1 -0
- package/python3.4.2/lib/python3.4/test/test_importlib/namespace_pkgs/project1/parent/child/one.py +1 -0
- package/python3.4.2/lib/python3.4/test/test_importlib/namespace_pkgs/project2/parent/child/two.py +1 -0
- package/python3.4.2/lib/python3.4/test/test_importlib/namespace_pkgs/project3/parent/child/three.py +1 -0
- package/python3.4.2/lib/python3.4/test/test_importlib/namespace_pkgs/top_level_portion1.zip +0 -0
- package/python3.4.2/lib/python3.4/test/test_importlib/regrtest.py +17 -0
- package/python3.4.2/lib/python3.4/test/test_importlib/source/__init__.py +5 -0
- package/python3.4.2/lib/python3.4/test/test_importlib/source/__main__.py +4 -0
- package/python3.4.2/lib/python3.4/test/test_importlib/source/test_case_sensitivity.py +83 -0
- package/python3.4.2/lib/python3.4/test/test_importlib/source/test_file_loader.py +588 -0
- package/python3.4.2/lib/python3.4/test/test_importlib/source/test_finder.py +232 -0
- package/python3.4.2/lib/python3.4/test/test_importlib/source/test_path_hook.py +30 -0
- package/python3.4.2/lib/python3.4/test/test_importlib/source/test_source_encoding.py +165 -0
- package/python3.4.2/lib/python3.4/test/test_importlib/source/util.py +96 -0
- package/python3.4.2/lib/python3.4/test/test_importlib/test_abc.py +951 -0
- package/python3.4.2/lib/python3.4/test/test_importlib/test_api.py +437 -0
- package/python3.4.2/lib/python3.4/test/test_importlib/test_locks.py +156 -0
- package/python3.4.2/lib/python3.4/test/test_importlib/test_namespace_pkgs.py +293 -0
- package/python3.4.2/lib/python3.4/test/test_importlib/test_spec.py +957 -0
- package/python3.4.2/lib/python3.4/test/test_importlib/test_util.py +592 -0
- package/python3.4.2/lib/python3.4/test/test_importlib/test_windows.py +29 -0
- package/python3.4.2/lib/python3.4/test/test_importlib/util.py +225 -0
- package/python3.4.2/lib/python3.4/test/test_index.py +275 -0
- package/python3.4.2/lib/python3.4/test/test_inspect.py +3103 -0
- package/python3.4.2/lib/python3.4/test/test_int.py +458 -0
- package/python3.4.2/lib/python3.4/test/test_int_literal.py +147 -0
- package/python3.4.2/lib/python3.4/test/test_io.py +3481 -0
- package/python3.4.2/lib/python3.4/test/test_ioctl.py +91 -0
- package/python3.4.2/lib/python3.4/test/test_ipaddress.py +1693 -0
- package/python3.4.2/lib/python3.4/test/test_isinstance.py +289 -0
- package/python3.4.2/lib/python3.4/test/test_iter.py +927 -0
- package/python3.4.2/lib/python3.4/test/test_iterlen.py +229 -0
- package/python3.4.2/lib/python3.4/test/test_itertools.py +2142 -0
- package/python3.4.2/lib/python3.4/test/test_json/__init__.py +53 -0
- package/python3.4.2/lib/python3.4/test/test_json/__main__.py +4 -0
- package/python3.4.2/lib/python3.4/test/test_json/test_decode.py +99 -0
- package/python3.4.2/lib/python3.4/test/test_json/test_default.py +12 -0
- package/python3.4.2/lib/python3.4/test/test_json/test_dump.py +49 -0
- package/python3.4.2/lib/python3.4/test/test_json/test_encode_basestring_ascii.py +44 -0
- package/python3.4.2/lib/python3.4/test/test_json/test_enum.py +120 -0
- package/python3.4.2/lib/python3.4/test/test_json/test_fail.py +194 -0
- package/python3.4.2/lib/python3.4/test/test_json/test_float.py +33 -0
- package/python3.4.2/lib/python3.4/test/test_json/test_indent.py +67 -0
- package/python3.4.2/lib/python3.4/test/test_json/test_pass1.py +75 -0
- package/python3.4.2/lib/python3.4/test/test_json/test_pass2.py +18 -0
- package/python3.4.2/lib/python3.4/test/test_json/test_pass3.py +24 -0
- package/python3.4.2/lib/python3.4/test/test_json/test_recursion.py +100 -0
- package/python3.4.2/lib/python3.4/test/test_json/test_scanstring.py +141 -0
- package/python3.4.2/lib/python3.4/test/test_json/test_separators.py +44 -0
- package/python3.4.2/lib/python3.4/test/test_json/test_speedups.py +24 -0
- package/python3.4.2/lib/python3.4/test/test_json/test_tool.py +69 -0
- package/python3.4.2/lib/python3.4/test/test_json/test_unicode.py +75 -0
- package/python3.4.2/lib/python3.4/test/test_keyword.py +138 -0
- package/python3.4.2/lib/python3.4/test/test_keywordonlyarg.py +193 -0
- package/python3.4.2/lib/python3.4/test/test_kqueue.py +219 -0
- package/python3.4.2/lib/python3.4/test/test_largefile.py +180 -0
- package/python3.4.2/lib/python3.4/test/test_lib2to3.py +22 -0
- package/python3.4.2/lib/python3.4/test/test_linecache.py +133 -0
- package/python3.4.2/lib/python3.4/test/test_list.py +125 -0
- package/python3.4.2/lib/python3.4/test/test_listcomps.py +148 -0
- package/python3.4.2/lib/python3.4/test/test_locale.py +528 -0
- package/python3.4.2/lib/python3.4/test/test_logging.py +4179 -0
- package/python3.4.2/lib/python3.4/test/test_long.py +1250 -0
- package/python3.4.2/lib/python3.4/test/test_longexp.py +14 -0
- package/python3.4.2/lib/python3.4/test/test_lzma.py +1592 -0
- package/python3.4.2/lib/python3.4/test/test_macpath.py +123 -0
- package/python3.4.2/lib/python3.4/test/test_macurl2path.py +31 -0
- package/python3.4.2/lib/python3.4/test/test_mailbox.py +2287 -0
- package/python3.4.2/lib/python3.4/test/test_mailcap.py +221 -0
- package/python3.4.2/lib/python3.4/test/test_marshal.py +451 -0
- package/python3.4.2/lib/python3.4/test/test_math.py +1107 -0
- package/python3.4.2/lib/python3.4/test/test_memoryio.py +784 -0
- package/python3.4.2/lib/python3.4/test/test_memoryview.py +478 -0
- package/python3.4.2/lib/python3.4/test/test_metaclass.py +265 -0
- package/python3.4.2/lib/python3.4/test/test_mimetypes.py +111 -0
- package/python3.4.2/lib/python3.4/test/test_minidom.py +1545 -0
- package/python3.4.2/lib/python3.4/test/test_mmap.py +774 -0
- package/python3.4.2/lib/python3.4/test/test_module.py +222 -0
- package/python3.4.2/lib/python3.4/test/test_modulefinder.py +324 -0
- package/python3.4.2/lib/python3.4/test/test_msilib.py +46 -0
- package/python3.4.2/lib/python3.4/test/test_multibytecodec.py +263 -0
- package/python3.4.2/lib/python3.4/test/test_multiprocessing_fork.py +7 -0
- package/python3.4.2/lib/python3.4/test/test_multiprocessing_forkserver.py +7 -0
- package/python3.4.2/lib/python3.4/test/test_multiprocessing_main_handling.py +289 -0
- package/python3.4.2/lib/python3.4/test/test_multiprocessing_spawn.py +7 -0
- package/python3.4.2/lib/python3.4/test/test_netrc.py +130 -0
- package/python3.4.2/lib/python3.4/test/test_nis.py +43 -0
- package/python3.4.2/lib/python3.4/test/test_nntplib.py +1429 -0
- package/python3.4.2/lib/python3.4/test/test_normalization.py +104 -0
- package/python3.4.2/lib/python3.4/test/test_ntpath.py +385 -0
- package/python3.4.2/lib/python3.4/test/test_numeric_tower.py +206 -0
- package/python3.4.2/lib/python3.4/test/test_opcodes.py +112 -0
- package/python3.4.2/lib/python3.4/test/test_openpty.py +25 -0
- package/python3.4.2/lib/python3.4/test/test_operator.py +484 -0
- package/python3.4.2/lib/python3.4/test/test_optparse.py +1657 -0
- package/python3.4.2/lib/python3.4/test/test_os.py +2550 -0
- package/python3.4.2/lib/python3.4/test/test_ossaudiodev.py +202 -0
- package/python3.4.2/lib/python3.4/test/test_osx_env.py +34 -0
- package/python3.4.2/lib/python3.4/test/test_parser.py +745 -0
- package/python3.4.2/lib/python3.4/test/test_pathlib.py +1884 -0
- package/python3.4.2/lib/python3.4/test/test_pdb.py +1052 -0
- package/python3.4.2/lib/python3.4/test/test_peepholer.py +339 -0
- package/python3.4.2/lib/python3.4/test/test_pep247.py +70 -0
- package/python3.4.2/lib/python3.4/test/test_pep277.py +201 -0
- package/python3.4.2/lib/python3.4/test/test_pep292.py +247 -0
- package/python3.4.2/lib/python3.4/test/test_pep3120.py +47 -0
- package/python3.4.2/lib/python3.4/test/test_pep3131.py +35 -0
- package/python3.4.2/lib/python3.4/test/test_pep3151.py +209 -0
- package/python3.4.2/lib/python3.4/test/test_pep352.py +184 -0
- package/python3.4.2/lib/python3.4/test/test_pep380.py +1023 -0
- package/python3.4.2/lib/python3.4/test/test_pickle.py +156 -0
- package/python3.4.2/lib/python3.4/test/test_pickletools.py +25 -0
- package/python3.4.2/lib/python3.4/test/test_pipes.py +196 -0
- package/python3.4.2/lib/python3.4/test/test_pkg.py +299 -0
- package/python3.4.2/lib/python3.4/test/test_pkgimport.py +84 -0
- package/python3.4.2/lib/python3.4/test/test_pkgutil.py +410 -0
- package/python3.4.2/lib/python3.4/test/test_platform.py +320 -0
- package/python3.4.2/lib/python3.4/test/test_plistlib.py +526 -0
- package/python3.4.2/lib/python3.4/test/test_poll.py +215 -0
- package/python3.4.2/lib/python3.4/test/test_popen.py +64 -0
- package/python3.4.2/lib/python3.4/test/test_poplib.py +507 -0
- package/python3.4.2/lib/python3.4/test/test_posix.py +1183 -0
- package/python3.4.2/lib/python3.4/test/test_posixpath.py +544 -0
- package/python3.4.2/lib/python3.4/test/test_pow.py +129 -0
- package/python3.4.2/lib/python3.4/test/test_pprint.py +602 -0
- package/python3.4.2/lib/python3.4/test/test_print.py +132 -0
- package/python3.4.2/lib/python3.4/test/test_profile.py +187 -0
- package/python3.4.2/lib/python3.4/test/test_property.py +254 -0
- package/python3.4.2/lib/python3.4/test/test_pstats.py +45 -0
- package/python3.4.2/lib/python3.4/test/test_pty.py +302 -0
- package/python3.4.2/lib/python3.4/test/test_pulldom.py +347 -0
- package/python3.4.2/lib/python3.4/test/test_pwd.py +114 -0
- package/python3.4.2/lib/python3.4/test/test_py_compile.py +103 -0
- package/python3.4.2/lib/python3.4/test/test_pyclbr.py +181 -0
- package/python3.4.2/lib/python3.4/test/test_pydoc.py +1003 -0
- package/python3.4.2/lib/python3.4/test/test_pyexpat.py +708 -0
- package/python3.4.2/lib/python3.4/test/test_queue.py +363 -0
- package/python3.4.2/lib/python3.4/test/test_quopri.py +208 -0
- package/python3.4.2/lib/python3.4/test/test_raise.py +422 -0
- package/python3.4.2/lib/python3.4/test/test_random.py +759 -0
- package/python3.4.2/lib/python3.4/test/test_range.py +652 -0
- package/python3.4.2/lib/python3.4/test/test_re.py +1451 -0
- package/python3.4.2/lib/python3.4/test/test_readline.py +60 -0
- package/python3.4.2/lib/python3.4/test/test_regrtest.py +275 -0
- package/python3.4.2/lib/python3.4/test/test_reprlib.py +383 -0
- package/python3.4.2/lib/python3.4/test/test_resource.py +166 -0
- package/python3.4.2/lib/python3.4/test/test_richcmp.py +333 -0
- package/python3.4.2/lib/python3.4/test/test_rlcompleter.py +73 -0
- package/python3.4.2/lib/python3.4/test/test_robotparser.py +320 -0
- package/python3.4.2/lib/python3.4/test/test_runpy.py +691 -0
- package/python3.4.2/lib/python3.4/test/test_sax.py +1007 -0
- package/python3.4.2/lib/python3.4/test/test_sched.py +199 -0
- package/python3.4.2/lib/python3.4/test/test_scope.py +764 -0
- package/python3.4.2/lib/python3.4/test/test_select.py +83 -0
- package/python3.4.2/lib/python3.4/test/test_selectors.py +453 -0
- package/python3.4.2/lib/python3.4/test/test_set.py +1839 -0
- package/python3.4.2/lib/python3.4/test/test_setcomps.py +151 -0
- package/python3.4.2/lib/python3.4/test/test_shelve.py +224 -0
- package/python3.4.2/lib/python3.4/test/test_shlex.py +202 -0
- package/python3.4.2/lib/python3.4/test/test_shutil.py +1766 -0
- package/python3.4.2/lib/python3.4/test/test_signal.py +940 -0
- package/python3.4.2/lib/python3.4/test/test_site.py +468 -0
- package/python3.4.2/lib/python3.4/test/test_slice.py +247 -0
- package/python3.4.2/lib/python3.4/test/test_smtpd.py +557 -0
- package/python3.4.2/lib/python3.4/test/test_smtplib.py +950 -0
- package/python3.4.2/lib/python3.4/test/test_smtpnet.py +86 -0
- package/python3.4.2/lib/python3.4/test/test_sndhdr.py +23 -0
- package/python3.4.2/lib/python3.4/test/test_socket.py +5163 -0
- package/python3.4.2/lib/python3.4/test/test_socketserver.py +314 -0
- package/python3.4.2/lib/python3.4/test/test_sort.py +285 -0
- package/python3.4.2/lib/python3.4/test/test_source_encoding.py +145 -0
- package/python3.4.2/lib/python3.4/test/test_spwd.py +60 -0
- package/python3.4.2/lib/python3.4/test/test_sqlite.py +24 -0
- package/python3.4.2/lib/python3.4/test/test_ssl.py +2908 -0
- package/python3.4.2/lib/python3.4/test/test_startfile.py +37 -0
- package/python3.4.2/lib/python3.4/test/test_stat.py +202 -0
- package/python3.4.2/lib/python3.4/test/test_statistics.py +1574 -0
- package/python3.4.2/lib/python3.4/test/test_strftime.py +204 -0
- package/python3.4.2/lib/python3.4/test/test_string.py +174 -0
- package/python3.4.2/lib/python3.4/test/test_stringprep.py +96 -0
- package/python3.4.2/lib/python3.4/test/test_strlit.py +206 -0
- package/python3.4.2/lib/python3.4/test/test_strptime.py +577 -0
- package/python3.4.2/lib/python3.4/test/test_strtod.py +436 -0
- package/python3.4.2/lib/python3.4/test/test_struct.py +667 -0
- package/python3.4.2/lib/python3.4/test/test_structmembers.py +147 -0
- package/python3.4.2/lib/python3.4/test/test_structseq.py +130 -0
- package/python3.4.2/lib/python3.4/test/test_subprocess.py +2474 -0
- package/python3.4.2/lib/python3.4/test/test_sunau.py +122 -0
- package/python3.4.2/lib/python3.4/test/test_sundry.py +59 -0
- package/python3.4.2/lib/python3.4/test/test_super.py +181 -0
- package/python3.4.2/lib/python3.4/test/test_support.py +315 -0
- package/python3.4.2/lib/python3.4/test/test_symtable.py +176 -0
- package/python3.4.2/lib/python3.4/test/test_syntax.py +593 -0
- package/python3.4.2/lib/python3.4/test/test_sys.py +1000 -0
- package/python3.4.2/lib/python3.4/test/test_sys_setprofile.py +386 -0
- package/python3.4.2/lib/python3.4/test/test_sys_settrace.py +834 -0
- package/python3.4.2/lib/python3.4/test/test_sysconfig.py +423 -0
- package/python3.4.2/lib/python3.4/test/test_syslog.py +43 -0
- package/python3.4.2/lib/python3.4/test/test_tarfile.py +2180 -0
- package/python3.4.2/lib/python3.4/test/test_tcl.py +642 -0
- package/python3.4.2/lib/python3.4/test/test_telnetlib.py +401 -0
- package/python3.4.2/lib/python3.4/test/test_tempfile.py +1248 -0
- package/python3.4.2/lib/python3.4/test/test_textwrap.py +929 -0
- package/python3.4.2/lib/python3.4/test/test_thread.py +260 -0
- package/python3.4.2/lib/python3.4/test/test_threaded_import.py +244 -0
- package/python3.4.2/lib/python3.4/test/test_threadedtempfile.py +78 -0
- package/python3.4.2/lib/python3.4/test/test_threading.py +1021 -0
- package/python3.4.2/lib/python3.4/test/test_threading_local.py +225 -0
- package/python3.4.2/lib/python3.4/test/test_threadsignals.py +227 -0
- package/python3.4.2/lib/python3.4/test/test_time.py +763 -0
- package/python3.4.2/lib/python3.4/test/test_timeit.py +306 -0
- package/python3.4.2/lib/python3.4/test/test_timeout.py +303 -0
- package/python3.4.2/lib/python3.4/test/test_tk.py +18 -0
- package/python3.4.2/lib/python3.4/test/test_tokenize.py +1233 -0
- package/python3.4.2/lib/python3.4/test/test_trace.py +415 -0
- package/python3.4.2/lib/python3.4/test/test_traceback.py +451 -0
- package/python3.4.2/lib/python3.4/test/test_tracemalloc.py +826 -0
- package/python3.4.2/lib/python3.4/test/test_ttk_guionly.py +37 -0
- package/python3.4.2/lib/python3.4/test/test_ttk_textonly.py +17 -0
- package/python3.4.2/lib/python3.4/test/test_tuple.py +208 -0
- package/python3.4.2/lib/python3.4/test/test_typechecks.py +76 -0
- package/python3.4.2/lib/python3.4/test/test_types.py +1178 -0
- package/python3.4.2/lib/python3.4/test/test_ucn.py +240 -0
- package/python3.4.2/lib/python3.4/test/test_unary.py +58 -0
- package/python3.4.2/lib/python3.4/test/test_unicode.py +2596 -0
- package/python3.4.2/lib/python3.4/test/test_unicode_file.py +144 -0
- package/python3.4.2/lib/python3.4/test/test_unicodedata.py +323 -0
- package/python3.4.2/lib/python3.4/test/test_unittest.py +16 -0
- package/python3.4.2/lib/python3.4/test/test_univnewlines.py +123 -0
- package/python3.4.2/lib/python3.4/test/test_unpack.py +130 -0
- package/python3.4.2/lib/python3.4/test/test_unpack_ex.py +174 -0
- package/python3.4.2/lib/python3.4/test/test_urllib.py +1486 -0
- package/python3.4.2/lib/python3.4/test/test_urllib2.py +1646 -0
- package/python3.4.2/lib/python3.4/test/test_urllib2_localnet.py +690 -0
- package/python3.4.2/lib/python3.4/test/test_urllib2net.py +342 -0
- package/python3.4.2/lib/python3.4/test/test_urllib_response.py +59 -0
- package/python3.4.2/lib/python3.4/test/test_urllibnet.py +212 -0
- package/python3.4.2/lib/python3.4/test/test_urlparse.py +879 -0
- package/python3.4.2/lib/python3.4/test/test_userdict.py +199 -0
- package/python3.4.2/lib/python3.4/test/test_userlist.py +65 -0
- package/python3.4.2/lib/python3.4/test/test_userstring.py +47 -0
- package/python3.4.2/lib/python3.4/test/test_uu.py +239 -0
- package/python3.4.2/lib/python3.4/test/test_uuid.py +498 -0
- package/python3.4.2/lib/python3.4/test/test_venv.py +406 -0
- package/python3.4.2/lib/python3.4/test/test_wait3.py +38 -0
- package/python3.4.2/lib/python3.4/test/test_wait4.py +38 -0
- package/python3.4.2/lib/python3.4/test/test_warnings.py +873 -0
- package/python3.4.2/lib/python3.4/test/test_wave.py +107 -0
- package/python3.4.2/lib/python3.4/test/test_weakref.py +1801 -0
- package/python3.4.2/lib/python3.4/test/test_weakset.py +450 -0
- package/python3.4.2/lib/python3.4/test/test_webbrowser.py +192 -0
- package/python3.4.2/lib/python3.4/test/test_winreg.py +485 -0
- package/python3.4.2/lib/python3.4/test/test_winsound.py +253 -0
- package/python3.4.2/lib/python3.4/test/test_with.py +750 -0
- package/python3.4.2/lib/python3.4/test/test_wsgiref.py +640 -0
- package/python3.4.2/lib/python3.4/test/test_xdrlib.py +58 -0
- package/python3.4.2/lib/python3.4/test/test_xml_dom_minicompat.py +101 -0
- package/python3.4.2/lib/python3.4/test/test_xml_etree.py +2587 -0
- package/python3.4.2/lib/python3.4/test/test_xml_etree_c.py +94 -0
- package/python3.4.2/lib/python3.4/test/test_xmlrpc.py +1114 -0
- package/python3.4.2/lib/python3.4/test/test_xmlrpc_net.py +33 -0
- package/python3.4.2/lib/python3.4/test/test_zipfile.py +1783 -0
- package/python3.4.2/lib/python3.4/test/test_zipfile64.py +118 -0
- package/python3.4.2/lib/python3.4/test/test_zipimport.py +507 -0
- package/python3.4.2/lib/python3.4/test/test_zipimport_support.py +246 -0
- package/python3.4.2/lib/python3.4/test/test_zlib.py +725 -0
- package/python3.4.2/lib/python3.4/test/testcodec.py +48 -0
- package/python3.4.2/lib/python3.4/test/testtar.tar +0 -0
- package/python3.4.2/lib/python3.4/test/tf_inherit_check.py +25 -0
- package/python3.4.2/lib/python3.4/test/threaded_import_hangers.py +45 -0
- package/python3.4.2/lib/python3.4/test/time_hashlib.py +87 -0
- package/python3.4.2/lib/python3.4/test/tokenize_tests-latin1-coding-cookie-and-utf8-bom-sig.txt +13 -0
- package/python3.4.2/lib/python3.4/test/tokenize_tests-no-coding-cookie-and-utf8-bom-sig-only.txt +11 -0
- package/python3.4.2/lib/python3.4/test/tokenize_tests-utf8-coding-cookie-and-no-utf8-bom-sig.txt +13 -0
- package/python3.4.2/lib/python3.4/test/tokenize_tests-utf8-coding-cookie-and-utf8-bom-sig.txt +12 -0
- package/python3.4.2/lib/python3.4/test/tokenize_tests.txt +189 -0
- package/python3.4.2/lib/python3.4/test/tracedmodules/__init__.py +4 -0
- package/python3.4.2/lib/python3.4/test/tracedmodules/testmod.py +9 -0
- package/python3.4.2/lib/python3.4/test/warning_tests.py +9 -0
- package/python3.4.2/lib/python3.4/test/win_console_handler.py +49 -0
- package/python3.4.2/lib/python3.4/test/xmltestdata/simple-ns.xml +7 -0
- package/python3.4.2/lib/python3.4/test/xmltestdata/simple.xml +6 -0
- package/python3.4.2/lib/python3.4/test/xmltestdata/test.xml +115 -0
- package/python3.4.2/lib/python3.4/test/xmltestdata/test.xml.out +115 -0
- package/python3.4.2/lib/python3.4/test/xmltests.py +21 -0
- package/python3.4.2/lib/python3.4/test/zip_cp437_header.zip +0 -0
- package/python3.4.2/lib/python3.4/test/zipdir.zip +0 -0
- package/python3.4.2/lib/python3.4/textwrap.py +470 -0
- package/python3.4.2/lib/python3.4/this.py +28 -0
- package/python3.4.2/lib/python3.4/threading.py +1359 -0
- package/python3.4.2/lib/python3.4/timeit.py +322 -0
- package/python3.4.2/lib/python3.4/tkinter/__init__.py +3898 -0
- package/python3.4.2/lib/python3.4/tkinter/__main__.py +7 -0
- package/python3.4.2/lib/python3.4/tkinter/_fix.py +78 -0
- package/python3.4.2/lib/python3.4/tkinter/colorchooser.py +72 -0
- package/python3.4.2/lib/python3.4/tkinter/commondialog.py +60 -0
- package/python3.4.2/lib/python3.4/tkinter/constants.py +110 -0
- package/python3.4.2/lib/python3.4/tkinter/dialog.py +49 -0
- package/python3.4.2/lib/python3.4/tkinter/dnd.py +321 -0
- package/python3.4.2/lib/python3.4/tkinter/filedialog.py +479 -0
- package/python3.4.2/lib/python3.4/tkinter/font.py +234 -0
- package/python3.4.2/lib/python3.4/tkinter/messagebox.py +134 -0
- package/python3.4.2/lib/python3.4/tkinter/scrolledtext.py +54 -0
- package/python3.4.2/lib/python3.4/tkinter/simpledialog.py +423 -0
- package/python3.4.2/lib/python3.4/tkinter/test/README +14 -0
- package/python3.4.2/lib/python3.4/tkinter/test/__init__.py +0 -0
- package/python3.4.2/lib/python3.4/tkinter/test/runtktests.py +71 -0
- package/python3.4.2/lib/python3.4/tkinter/test/support.py +104 -0
- package/python3.4.2/lib/python3.4/tkinter/test/test_tkinter/__init__.py +0 -0
- package/python3.4.2/lib/python3.4/tkinter/test/test_tkinter/test_font.py +27 -0
- package/python3.4.2/lib/python3.4/tkinter/test/test_tkinter/test_geometry_managers.py +900 -0
- package/python3.4.2/lib/python3.4/tkinter/test/test_tkinter/test_images.py +327 -0
- package/python3.4.2/lib/python3.4/tkinter/test/test_tkinter/test_loadtk.py +46 -0
- package/python3.4.2/lib/python3.4/tkinter/test/test_tkinter/test_misc.py +42 -0
- package/python3.4.2/lib/python3.4/tkinter/test/test_tkinter/test_text.py +47 -0
- package/python3.4.2/lib/python3.4/tkinter/test/test_tkinter/test_variables.py +186 -0
- package/python3.4.2/lib/python3.4/tkinter/test/test_tkinter/test_widgets.py +1193 -0
- package/python3.4.2/lib/python3.4/tkinter/test/test_ttk/__init__.py +0 -0
- package/python3.4.2/lib/python3.4/tkinter/test/test_ttk/test_extensions.py +291 -0
- package/python3.4.2/lib/python3.4/tkinter/test/test_ttk/test_functions.py +462 -0
- package/python3.4.2/lib/python3.4/tkinter/test/test_ttk/test_style.py +92 -0
- package/python3.4.2/lib/python3.4/tkinter/test/test_ttk/test_widgets.py +1598 -0
- package/python3.4.2/lib/python3.4/tkinter/test/widget_tests.py +521 -0
- package/python3.4.2/lib/python3.4/tkinter/tix.py +1944 -0
- package/python3.4.2/lib/python3.4/tkinter/ttk.py +1616 -0
- package/python3.4.2/lib/python3.4/token.py +140 -0
- package/python3.4.2/lib/python3.4/tokenize.py +691 -0
- package/python3.4.2/lib/python3.4/trace.py +858 -0
- package/python3.4.2/lib/python3.4/traceback.py +313 -0
- package/python3.4.2/lib/python3.4/tracemalloc.py +487 -0
- package/python3.4.2/lib/python3.4/tty.py +36 -0
- package/python3.4.2/lib/python3.4/turtle.py +4140 -0
- package/python3.4.2/lib/python3.4/turtledemo/__init__.py +14 -0
- package/python3.4.2/lib/python3.4/turtledemo/__main__.py +380 -0
- package/python3.4.2/lib/python3.4/turtledemo/bytedesign.py +162 -0
- package/python3.4.2/lib/python3.4/turtledemo/chaos.py +59 -0
- package/python3.4.2/lib/python3.4/turtledemo/clock.py +132 -0
- package/python3.4.2/lib/python3.4/turtledemo/colormixer.py +58 -0
- package/python3.4.2/lib/python3.4/turtledemo/forest.py +108 -0
- package/python3.4.2/lib/python3.4/turtledemo/fractalcurves.py +138 -0
- package/python3.4.2/lib/python3.4/turtledemo/lindenmayer.py +119 -0
- package/python3.4.2/lib/python3.4/turtledemo/minimal_hanoi.py +79 -0
- package/python3.4.2/lib/python3.4/turtledemo/nim.py +226 -0
- package/python3.4.2/lib/python3.4/turtledemo/paint.py +54 -0
- package/python3.4.2/lib/python3.4/turtledemo/peace.py +61 -0
- package/python3.4.2/lib/python3.4/turtledemo/penrose.py +181 -0
- package/python3.4.2/lib/python3.4/turtledemo/planet_and_moon.py +112 -0
- package/python3.4.2/lib/python3.4/turtledemo/round_dance.py +86 -0
- package/python3.4.2/lib/python3.4/turtledemo/tree.py +63 -0
- package/python3.4.2/lib/python3.4/turtledemo/turtle.cfg +10 -0
- package/python3.4.2/lib/python3.4/turtledemo/two_canvases.py +54 -0
- package/python3.4.2/lib/python3.4/turtledemo/wikipedia.py +65 -0
- package/python3.4.2/lib/python3.4/turtledemo/yinyang.py +49 -0
- package/python3.4.2/lib/python3.4/types.py +158 -0
- package/python3.4.2/lib/python3.4/unittest/__init__.py +69 -0
- package/python3.4.2/lib/python3.4/unittest/__main__.py +18 -0
- package/python3.4.2/lib/python3.4/unittest/case.py +1400 -0
- package/python3.4.2/lib/python3.4/unittest/loader.py +379 -0
- package/python3.4.2/lib/python3.4/unittest/main.py +248 -0
- package/python3.4.2/lib/python3.4/unittest/mock.py +2330 -0
- package/python3.4.2/lib/python3.4/unittest/result.py +212 -0
- package/python3.4.2/lib/python3.4/unittest/runner.py +213 -0
- package/python3.4.2/lib/python3.4/unittest/signals.py +71 -0
- package/python3.4.2/lib/python3.4/unittest/suite.py +324 -0
- package/python3.4.2/lib/python3.4/unittest/test/__init__.py +22 -0
- package/python3.4.2/lib/python3.4/unittest/test/__main__.py +18 -0
- package/python3.4.2/lib/python3.4/unittest/test/_test_warnings.py +73 -0
- package/python3.4.2/lib/python3.4/unittest/test/dummy.py +1 -0
- package/python3.4.2/lib/python3.4/unittest/test/support.py +142 -0
- package/python3.4.2/lib/python3.4/unittest/test/test_assertions.py +398 -0
- package/python3.4.2/lib/python3.4/unittest/test/test_break.py +288 -0
- package/python3.4.2/lib/python3.4/unittest/test/test_case.py +1574 -0
- package/python3.4.2/lib/python3.4/unittest/test/test_discovery.py +527 -0
- package/python3.4.2/lib/python3.4/unittest/test/test_functiontestcase.py +148 -0
- package/python3.4.2/lib/python3.4/unittest/test/test_loader.py +1312 -0
- package/python3.4.2/lib/python3.4/unittest/test/test_program.py +396 -0
- package/python3.4.2/lib/python3.4/unittest/test/test_result.py +660 -0
- package/python3.4.2/lib/python3.4/unittest/test/test_runner.py +346 -0
- package/python3.4.2/lib/python3.4/unittest/test/test_setups.py +506 -0
- package/python3.4.2/lib/python3.4/unittest/test/test_skipping.py +227 -0
- package/python3.4.2/lib/python3.4/unittest/test/test_suite.py +447 -0
- package/python3.4.2/lib/python3.4/unittest/test/testmock/__init__.py +17 -0
- package/python3.4.2/lib/python3.4/unittest/test/testmock/__main__.py +18 -0
- package/python3.4.2/lib/python3.4/unittest/test/testmock/support.py +23 -0
- package/python3.4.2/lib/python3.4/unittest/test/testmock/testcallable.py +151 -0
- package/python3.4.2/lib/python3.4/unittest/test/testmock/testhelpers.py +908 -0
- package/python3.4.2/lib/python3.4/unittest/test/testmock/testmagicmethods.py +428 -0
- package/python3.4.2/lib/python3.4/unittest/test/testmock/testmock.py +1412 -0
- package/python3.4.2/lib/python3.4/unittest/test/testmock/testpatch.py +1801 -0
- package/python3.4.2/lib/python3.4/unittest/test/testmock/testsentinel.py +28 -0
- package/python3.4.2/lib/python3.4/unittest/test/testmock/testwith.py +259 -0
- package/python3.4.2/lib/python3.4/unittest/util.py +177 -0
- package/python3.4.2/lib/python3.4/urllib/__init__.py +0 -0
- package/python3.4.2/lib/python3.4/urllib/error.py +76 -0
- package/python3.4.2/lib/python3.4/urllib/parse.py +973 -0
- package/python3.4.2/lib/python3.4/urllib/request.py +2559 -0
- package/python3.4.2/lib/python3.4/urllib/response.py +76 -0
- package/python3.4.2/lib/python3.4/urllib/robotparser.py +212 -0
- package/python3.4.2/lib/python3.4/uu.py +199 -0
- package/python3.4.2/lib/python3.4/uuid.py +591 -0
- package/python3.4.2/lib/python3.4/venv/__init__.py +449 -0
- package/python3.4.2/lib/python3.4/venv/__main__.py +10 -0
- package/python3.4.2/lib/python3.4/venv/scripts/posix/activate +76 -0
- package/python3.4.2/lib/python3.4/venv/scripts/posix/activate.csh +37 -0
- package/python3.4.2/lib/python3.4/venv/scripts/posix/activate.fish +74 -0
- package/python3.4.2/lib/python3.4/warnings.py +407 -0
- package/python3.4.2/lib/python3.4/wave.py +503 -0
- package/python3.4.2/lib/python3.4/weakref.py +577 -0
- package/python3.4.2/lib/python3.4/webbrowser.py +651 -0
- package/python3.4.2/lib/python3.4/wsgiref/__init__.py +23 -0
- package/python3.4.2/lib/python3.4/wsgiref/handlers.py +547 -0
- package/python3.4.2/lib/python3.4/wsgiref/headers.py +184 -0
- package/python3.4.2/lib/python3.4/wsgiref/simple_server.py +165 -0
- package/python3.4.2/lib/python3.4/wsgiref/util.py +165 -0
- package/python3.4.2/lib/python3.4/wsgiref/validate.py +443 -0
- package/python3.4.2/lib/python3.4/xdrlib.py +224 -0
- package/python3.4.2/lib/python3.4/xml/__init__.py +20 -0
- package/python3.4.2/lib/python3.4/xml/dom/NodeFilter.py +27 -0
- package/python3.4.2/lib/python3.4/xml/dom/__init__.py +140 -0
- package/python3.4.2/lib/python3.4/xml/dom/domreg.py +97 -0
- package/python3.4.2/lib/python3.4/xml/dom/expatbuilder.py +965 -0
- package/python3.4.2/lib/python3.4/xml/dom/minicompat.py +109 -0
- package/python3.4.2/lib/python3.4/xml/dom/minidom.py +1983 -0
- package/python3.4.2/lib/python3.4/xml/dom/pulldom.py +342 -0
- package/python3.4.2/lib/python3.4/xml/dom/xmlbuilder.py +386 -0
- package/python3.4.2/lib/python3.4/xml/etree/ElementInclude.py +143 -0
- package/python3.4.2/lib/python3.4/xml/etree/ElementPath.py +308 -0
- package/python3.4.2/lib/python3.4/xml/etree/ElementTree.py +1667 -0
- package/python3.4.2/lib/python3.4/xml/etree/__init__.py +33 -0
- package/python3.4.2/lib/python3.4/xml/etree/cElementTree.py +3 -0
- package/python3.4.2/lib/python3.4/xml/parsers/__init__.py +8 -0
- package/python3.4.2/lib/python3.4/xml/parsers/expat.py +8 -0
- package/python3.4.2/lib/python3.4/xml/sax/__init__.py +105 -0
- package/python3.4.2/lib/python3.4/xml/sax/_exceptions.py +131 -0
- package/python3.4.2/lib/python3.4/xml/sax/expatreader.py +417 -0
- package/python3.4.2/lib/python3.4/xml/sax/handler.py +342 -0
- package/python3.4.2/lib/python3.4/xml/sax/saxutils.py +365 -0
- package/python3.4.2/lib/python3.4/xml/sax/xmlreader.py +378 -0
- package/python3.4.2/lib/python3.4/xmlrpc/__init__.py +1 -0
- package/python3.4.2/lib/python3.4/xmlrpc/client.py +1479 -0
- package/python3.4.2/lib/python3.4/xmlrpc/server.py +986 -0
- package/python3.4.2/lib/python3.4/zipfile.py +1788 -0
- package/python3.4.2/share/man/man1/python3.1 +460 -0
- package/python3.4.2/share/man/man1/python3.4.1 +460 -0
|
@@ -0,0 +1,3786 @@
|
|
|
1
|
+
"""Test date/time type.
|
|
2
|
+
|
|
3
|
+
See http://www.zope.org/Members/fdrake/DateTimeWiki/TestCases
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
import sys
|
|
7
|
+
import pickle
|
|
8
|
+
import random
|
|
9
|
+
import unittest
|
|
10
|
+
|
|
11
|
+
from operator import lt, le, gt, ge, eq, ne, truediv, floordiv, mod
|
|
12
|
+
|
|
13
|
+
from test import support
|
|
14
|
+
|
|
15
|
+
import datetime as datetime_module
|
|
16
|
+
from datetime import MINYEAR, MAXYEAR
|
|
17
|
+
from datetime import timedelta
|
|
18
|
+
from datetime import tzinfo
|
|
19
|
+
from datetime import time
|
|
20
|
+
from datetime import timezone
|
|
21
|
+
from datetime import date, datetime
|
|
22
|
+
import time as _time
|
|
23
|
+
|
|
24
|
+
# Needed by test_datetime
|
|
25
|
+
import _strptime
|
|
26
|
+
#
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
pickle_choices = [(pickle, pickle, proto)
|
|
30
|
+
for proto in range(pickle.HIGHEST_PROTOCOL + 1)]
|
|
31
|
+
assert len(pickle_choices) == pickle.HIGHEST_PROTOCOL + 1
|
|
32
|
+
|
|
33
|
+
# An arbitrary collection of objects of non-datetime types, for testing
|
|
34
|
+
# mixed-type comparisons.
|
|
35
|
+
OTHERSTUFF = (10, 34.5, "abc", {}, [], ())
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
# XXX Copied from test_float.
|
|
39
|
+
INF = float("inf")
|
|
40
|
+
NAN = float("nan")
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
#############################################################################
|
|
44
|
+
# module tests
|
|
45
|
+
|
|
46
|
+
class TestModule(unittest.TestCase):
|
|
47
|
+
|
|
48
|
+
def test_constants(self):
|
|
49
|
+
datetime = datetime_module
|
|
50
|
+
self.assertEqual(datetime.MINYEAR, 1)
|
|
51
|
+
self.assertEqual(datetime.MAXYEAR, 9999)
|
|
52
|
+
|
|
53
|
+
#############################################################################
|
|
54
|
+
# tzinfo tests
|
|
55
|
+
|
|
56
|
+
class FixedOffset(tzinfo):
|
|
57
|
+
|
|
58
|
+
def __init__(self, offset, name, dstoffset=42):
|
|
59
|
+
if isinstance(offset, int):
|
|
60
|
+
offset = timedelta(minutes=offset)
|
|
61
|
+
if isinstance(dstoffset, int):
|
|
62
|
+
dstoffset = timedelta(minutes=dstoffset)
|
|
63
|
+
self.__offset = offset
|
|
64
|
+
self.__name = name
|
|
65
|
+
self.__dstoffset = dstoffset
|
|
66
|
+
def __repr__(self):
|
|
67
|
+
return self.__name.lower()
|
|
68
|
+
def utcoffset(self, dt):
|
|
69
|
+
return self.__offset
|
|
70
|
+
def tzname(self, dt):
|
|
71
|
+
return self.__name
|
|
72
|
+
def dst(self, dt):
|
|
73
|
+
return self.__dstoffset
|
|
74
|
+
|
|
75
|
+
class PicklableFixedOffset(FixedOffset):
|
|
76
|
+
|
|
77
|
+
def __init__(self, offset=None, name=None, dstoffset=None):
|
|
78
|
+
FixedOffset.__init__(self, offset, name, dstoffset)
|
|
79
|
+
|
|
80
|
+
class _TZInfo(tzinfo):
|
|
81
|
+
def utcoffset(self, datetime_module):
|
|
82
|
+
return random.random()
|
|
83
|
+
|
|
84
|
+
class TestTZInfo(unittest.TestCase):
|
|
85
|
+
|
|
86
|
+
def test_refcnt_crash_bug_22044(self):
|
|
87
|
+
tz1 = _TZInfo()
|
|
88
|
+
dt1 = datetime(2014, 7, 21, 11, 32, 3, 0, tz1)
|
|
89
|
+
with self.assertRaises(TypeError):
|
|
90
|
+
dt1.utcoffset()
|
|
91
|
+
|
|
92
|
+
def test_non_abstractness(self):
|
|
93
|
+
# In order to allow subclasses to get pickled, the C implementation
|
|
94
|
+
# wasn't able to get away with having __init__ raise
|
|
95
|
+
# NotImplementedError.
|
|
96
|
+
useless = tzinfo()
|
|
97
|
+
dt = datetime.max
|
|
98
|
+
self.assertRaises(NotImplementedError, useless.tzname, dt)
|
|
99
|
+
self.assertRaises(NotImplementedError, useless.utcoffset, dt)
|
|
100
|
+
self.assertRaises(NotImplementedError, useless.dst, dt)
|
|
101
|
+
|
|
102
|
+
def test_subclass_must_override(self):
|
|
103
|
+
class NotEnough(tzinfo):
|
|
104
|
+
def __init__(self, offset, name):
|
|
105
|
+
self.__offset = offset
|
|
106
|
+
self.__name = name
|
|
107
|
+
self.assertTrue(issubclass(NotEnough, tzinfo))
|
|
108
|
+
ne = NotEnough(3, "NotByALongShot")
|
|
109
|
+
self.assertIsInstance(ne, tzinfo)
|
|
110
|
+
|
|
111
|
+
dt = datetime.now()
|
|
112
|
+
self.assertRaises(NotImplementedError, ne.tzname, dt)
|
|
113
|
+
self.assertRaises(NotImplementedError, ne.utcoffset, dt)
|
|
114
|
+
self.assertRaises(NotImplementedError, ne.dst, dt)
|
|
115
|
+
|
|
116
|
+
def test_normal(self):
|
|
117
|
+
fo = FixedOffset(3, "Three")
|
|
118
|
+
self.assertIsInstance(fo, tzinfo)
|
|
119
|
+
for dt in datetime.now(), None:
|
|
120
|
+
self.assertEqual(fo.utcoffset(dt), timedelta(minutes=3))
|
|
121
|
+
self.assertEqual(fo.tzname(dt), "Three")
|
|
122
|
+
self.assertEqual(fo.dst(dt), timedelta(minutes=42))
|
|
123
|
+
|
|
124
|
+
def test_pickling_base(self):
|
|
125
|
+
# There's no point to pickling tzinfo objects on their own (they
|
|
126
|
+
# carry no data), but they need to be picklable anyway else
|
|
127
|
+
# concrete subclasses can't be pickled.
|
|
128
|
+
orig = tzinfo.__new__(tzinfo)
|
|
129
|
+
self.assertIs(type(orig), tzinfo)
|
|
130
|
+
for pickler, unpickler, proto in pickle_choices:
|
|
131
|
+
green = pickler.dumps(orig, proto)
|
|
132
|
+
derived = unpickler.loads(green)
|
|
133
|
+
self.assertIs(type(derived), tzinfo)
|
|
134
|
+
|
|
135
|
+
def test_pickling_subclass(self):
|
|
136
|
+
# Make sure we can pickle/unpickle an instance of a subclass.
|
|
137
|
+
offset = timedelta(minutes=-300)
|
|
138
|
+
for otype, args in [
|
|
139
|
+
(PicklableFixedOffset, (offset, 'cookie')),
|
|
140
|
+
(timezone, (offset,)),
|
|
141
|
+
(timezone, (offset, "EST"))]:
|
|
142
|
+
orig = otype(*args)
|
|
143
|
+
oname = orig.tzname(None)
|
|
144
|
+
self.assertIsInstance(orig, tzinfo)
|
|
145
|
+
self.assertIs(type(orig), otype)
|
|
146
|
+
self.assertEqual(orig.utcoffset(None), offset)
|
|
147
|
+
self.assertEqual(orig.tzname(None), oname)
|
|
148
|
+
for pickler, unpickler, proto in pickle_choices:
|
|
149
|
+
green = pickler.dumps(orig, proto)
|
|
150
|
+
derived = unpickler.loads(green)
|
|
151
|
+
self.assertIsInstance(derived, tzinfo)
|
|
152
|
+
self.assertIs(type(derived), otype)
|
|
153
|
+
self.assertEqual(derived.utcoffset(None), offset)
|
|
154
|
+
self.assertEqual(derived.tzname(None), oname)
|
|
155
|
+
|
|
156
|
+
class TestTimeZone(unittest.TestCase):
|
|
157
|
+
|
|
158
|
+
def setUp(self):
|
|
159
|
+
self.ACDT = timezone(timedelta(hours=9.5), 'ACDT')
|
|
160
|
+
self.EST = timezone(-timedelta(hours=5), 'EST')
|
|
161
|
+
self.DT = datetime(2010, 1, 1)
|
|
162
|
+
|
|
163
|
+
def test_str(self):
|
|
164
|
+
for tz in [self.ACDT, self.EST, timezone.utc,
|
|
165
|
+
timezone.min, timezone.max]:
|
|
166
|
+
self.assertEqual(str(tz), tz.tzname(None))
|
|
167
|
+
|
|
168
|
+
def test_repr(self):
|
|
169
|
+
datetime = datetime_module
|
|
170
|
+
for tz in [self.ACDT, self.EST, timezone.utc,
|
|
171
|
+
timezone.min, timezone.max]:
|
|
172
|
+
# test round-trip
|
|
173
|
+
tzrep = repr(tz)
|
|
174
|
+
self.assertEqual(tz, eval(tzrep))
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
def test_class_members(self):
|
|
178
|
+
limit = timedelta(hours=23, minutes=59)
|
|
179
|
+
self.assertEqual(timezone.utc.utcoffset(None), ZERO)
|
|
180
|
+
self.assertEqual(timezone.min.utcoffset(None), -limit)
|
|
181
|
+
self.assertEqual(timezone.max.utcoffset(None), limit)
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
def test_constructor(self):
|
|
185
|
+
self.assertIs(timezone.utc, timezone(timedelta(0)))
|
|
186
|
+
self.assertIsNot(timezone.utc, timezone(timedelta(0), 'UTC'))
|
|
187
|
+
self.assertEqual(timezone.utc, timezone(timedelta(0), 'UTC'))
|
|
188
|
+
# invalid offsets
|
|
189
|
+
for invalid in [timedelta(microseconds=1), timedelta(1, 1),
|
|
190
|
+
timedelta(seconds=1), timedelta(1), -timedelta(1)]:
|
|
191
|
+
self.assertRaises(ValueError, timezone, invalid)
|
|
192
|
+
self.assertRaises(ValueError, timezone, -invalid)
|
|
193
|
+
|
|
194
|
+
with self.assertRaises(TypeError): timezone(None)
|
|
195
|
+
with self.assertRaises(TypeError): timezone(42)
|
|
196
|
+
with self.assertRaises(TypeError): timezone(ZERO, None)
|
|
197
|
+
with self.assertRaises(TypeError): timezone(ZERO, 42)
|
|
198
|
+
with self.assertRaises(TypeError): timezone(ZERO, 'ABC', 'extra')
|
|
199
|
+
|
|
200
|
+
def test_inheritance(self):
|
|
201
|
+
self.assertIsInstance(timezone.utc, tzinfo)
|
|
202
|
+
self.assertIsInstance(self.EST, tzinfo)
|
|
203
|
+
|
|
204
|
+
def test_utcoffset(self):
|
|
205
|
+
dummy = self.DT
|
|
206
|
+
for h in [0, 1.5, 12]:
|
|
207
|
+
offset = h * HOUR
|
|
208
|
+
self.assertEqual(offset, timezone(offset).utcoffset(dummy))
|
|
209
|
+
self.assertEqual(-offset, timezone(-offset).utcoffset(dummy))
|
|
210
|
+
|
|
211
|
+
with self.assertRaises(TypeError): self.EST.utcoffset('')
|
|
212
|
+
with self.assertRaises(TypeError): self.EST.utcoffset(5)
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
def test_dst(self):
|
|
216
|
+
self.assertIsNone(timezone.utc.dst(self.DT))
|
|
217
|
+
|
|
218
|
+
with self.assertRaises(TypeError): self.EST.dst('')
|
|
219
|
+
with self.assertRaises(TypeError): self.EST.dst(5)
|
|
220
|
+
|
|
221
|
+
def test_tzname(self):
|
|
222
|
+
self.assertEqual('UTC+00:00', timezone(ZERO).tzname(None))
|
|
223
|
+
self.assertEqual('UTC-05:00', timezone(-5 * HOUR).tzname(None))
|
|
224
|
+
self.assertEqual('UTC+09:30', timezone(9.5 * HOUR).tzname(None))
|
|
225
|
+
self.assertEqual('UTC-00:01', timezone(timedelta(minutes=-1)).tzname(None))
|
|
226
|
+
self.assertEqual('XYZ', timezone(-5 * HOUR, 'XYZ').tzname(None))
|
|
227
|
+
|
|
228
|
+
with self.assertRaises(TypeError): self.EST.tzname('')
|
|
229
|
+
with self.assertRaises(TypeError): self.EST.tzname(5)
|
|
230
|
+
|
|
231
|
+
def test_fromutc(self):
|
|
232
|
+
with self.assertRaises(ValueError):
|
|
233
|
+
timezone.utc.fromutc(self.DT)
|
|
234
|
+
with self.assertRaises(TypeError):
|
|
235
|
+
timezone.utc.fromutc('not datetime')
|
|
236
|
+
for tz in [self.EST, self.ACDT, Eastern]:
|
|
237
|
+
utctime = self.DT.replace(tzinfo=tz)
|
|
238
|
+
local = tz.fromutc(utctime)
|
|
239
|
+
self.assertEqual(local - utctime, tz.utcoffset(local))
|
|
240
|
+
self.assertEqual(local,
|
|
241
|
+
self.DT.replace(tzinfo=timezone.utc))
|
|
242
|
+
|
|
243
|
+
def test_comparison(self):
|
|
244
|
+
self.assertNotEqual(timezone(ZERO), timezone(HOUR))
|
|
245
|
+
self.assertEqual(timezone(HOUR), timezone(HOUR))
|
|
246
|
+
self.assertEqual(timezone(-5 * HOUR), timezone(-5 * HOUR, 'EST'))
|
|
247
|
+
with self.assertRaises(TypeError): timezone(ZERO) < timezone(ZERO)
|
|
248
|
+
self.assertIn(timezone(ZERO), {timezone(ZERO)})
|
|
249
|
+
self.assertTrue(timezone(ZERO) != None)
|
|
250
|
+
self.assertFalse(timezone(ZERO) == None)
|
|
251
|
+
|
|
252
|
+
def test_aware_datetime(self):
|
|
253
|
+
# test that timezone instances can be used by datetime
|
|
254
|
+
t = datetime(1, 1, 1)
|
|
255
|
+
for tz in [timezone.min, timezone.max, timezone.utc]:
|
|
256
|
+
self.assertEqual(tz.tzname(t),
|
|
257
|
+
t.replace(tzinfo=tz).tzname())
|
|
258
|
+
self.assertEqual(tz.utcoffset(t),
|
|
259
|
+
t.replace(tzinfo=tz).utcoffset())
|
|
260
|
+
self.assertEqual(tz.dst(t),
|
|
261
|
+
t.replace(tzinfo=tz).dst())
|
|
262
|
+
|
|
263
|
+
#############################################################################
|
|
264
|
+
# Base class for testing a particular aspect of timedelta, time, date and
|
|
265
|
+
# datetime comparisons.
|
|
266
|
+
|
|
267
|
+
class HarmlessMixedComparison:
|
|
268
|
+
# Test that __eq__ and __ne__ don't complain for mixed-type comparisons.
|
|
269
|
+
|
|
270
|
+
# Subclasses must define 'theclass', and theclass(1, 1, 1) must be a
|
|
271
|
+
# legit constructor.
|
|
272
|
+
|
|
273
|
+
def test_harmless_mixed_comparison(self):
|
|
274
|
+
me = self.theclass(1, 1, 1)
|
|
275
|
+
|
|
276
|
+
self.assertFalse(me == ())
|
|
277
|
+
self.assertTrue(me != ())
|
|
278
|
+
self.assertFalse(() == me)
|
|
279
|
+
self.assertTrue(() != me)
|
|
280
|
+
|
|
281
|
+
self.assertIn(me, [1, 20, [], me])
|
|
282
|
+
self.assertIn([], [me, 1, 20, []])
|
|
283
|
+
|
|
284
|
+
def test_harmful_mixed_comparison(self):
|
|
285
|
+
me = self.theclass(1, 1, 1)
|
|
286
|
+
|
|
287
|
+
self.assertRaises(TypeError, lambda: me < ())
|
|
288
|
+
self.assertRaises(TypeError, lambda: me <= ())
|
|
289
|
+
self.assertRaises(TypeError, lambda: me > ())
|
|
290
|
+
self.assertRaises(TypeError, lambda: me >= ())
|
|
291
|
+
|
|
292
|
+
self.assertRaises(TypeError, lambda: () < me)
|
|
293
|
+
self.assertRaises(TypeError, lambda: () <= me)
|
|
294
|
+
self.assertRaises(TypeError, lambda: () > me)
|
|
295
|
+
self.assertRaises(TypeError, lambda: () >= me)
|
|
296
|
+
|
|
297
|
+
#############################################################################
|
|
298
|
+
# timedelta tests
|
|
299
|
+
|
|
300
|
+
class TestTimeDelta(HarmlessMixedComparison, unittest.TestCase):
|
|
301
|
+
|
|
302
|
+
theclass = timedelta
|
|
303
|
+
|
|
304
|
+
def test_constructor(self):
|
|
305
|
+
eq = self.assertEqual
|
|
306
|
+
td = timedelta
|
|
307
|
+
|
|
308
|
+
# Check keyword args to constructor
|
|
309
|
+
eq(td(), td(weeks=0, days=0, hours=0, minutes=0, seconds=0,
|
|
310
|
+
milliseconds=0, microseconds=0))
|
|
311
|
+
eq(td(1), td(days=1))
|
|
312
|
+
eq(td(0, 1), td(seconds=1))
|
|
313
|
+
eq(td(0, 0, 1), td(microseconds=1))
|
|
314
|
+
eq(td(weeks=1), td(days=7))
|
|
315
|
+
eq(td(days=1), td(hours=24))
|
|
316
|
+
eq(td(hours=1), td(minutes=60))
|
|
317
|
+
eq(td(minutes=1), td(seconds=60))
|
|
318
|
+
eq(td(seconds=1), td(milliseconds=1000))
|
|
319
|
+
eq(td(milliseconds=1), td(microseconds=1000))
|
|
320
|
+
|
|
321
|
+
# Check float args to constructor
|
|
322
|
+
eq(td(weeks=1.0/7), td(days=1))
|
|
323
|
+
eq(td(days=1.0/24), td(hours=1))
|
|
324
|
+
eq(td(hours=1.0/60), td(minutes=1))
|
|
325
|
+
eq(td(minutes=1.0/60), td(seconds=1))
|
|
326
|
+
eq(td(seconds=0.001), td(milliseconds=1))
|
|
327
|
+
eq(td(milliseconds=0.001), td(microseconds=1))
|
|
328
|
+
|
|
329
|
+
def test_computations(self):
|
|
330
|
+
eq = self.assertEqual
|
|
331
|
+
td = timedelta
|
|
332
|
+
|
|
333
|
+
a = td(7) # One week
|
|
334
|
+
b = td(0, 60) # One minute
|
|
335
|
+
c = td(0, 0, 1000) # One millisecond
|
|
336
|
+
eq(a+b+c, td(7, 60, 1000))
|
|
337
|
+
eq(a-b, td(6, 24*3600 - 60))
|
|
338
|
+
eq(b.__rsub__(a), td(6, 24*3600 - 60))
|
|
339
|
+
eq(-a, td(-7))
|
|
340
|
+
eq(+a, td(7))
|
|
341
|
+
eq(-b, td(-1, 24*3600 - 60))
|
|
342
|
+
eq(-c, td(-1, 24*3600 - 1, 999000))
|
|
343
|
+
eq(abs(a), a)
|
|
344
|
+
eq(abs(-a), a)
|
|
345
|
+
eq(td(6, 24*3600), a)
|
|
346
|
+
eq(td(0, 0, 60*1000000), b)
|
|
347
|
+
eq(a*10, td(70))
|
|
348
|
+
eq(a*10, 10*a)
|
|
349
|
+
eq(a*10, 10*a)
|
|
350
|
+
eq(b*10, td(0, 600))
|
|
351
|
+
eq(10*b, td(0, 600))
|
|
352
|
+
eq(b*10, td(0, 600))
|
|
353
|
+
eq(c*10, td(0, 0, 10000))
|
|
354
|
+
eq(10*c, td(0, 0, 10000))
|
|
355
|
+
eq(c*10, td(0, 0, 10000))
|
|
356
|
+
eq(a*-1, -a)
|
|
357
|
+
eq(b*-2, -b-b)
|
|
358
|
+
eq(c*-2, -c+-c)
|
|
359
|
+
eq(b*(60*24), (b*60)*24)
|
|
360
|
+
eq(b*(60*24), (60*b)*24)
|
|
361
|
+
eq(c*1000, td(0, 1))
|
|
362
|
+
eq(1000*c, td(0, 1))
|
|
363
|
+
eq(a//7, td(1))
|
|
364
|
+
eq(b//10, td(0, 6))
|
|
365
|
+
eq(c//1000, td(0, 0, 1))
|
|
366
|
+
eq(a//10, td(0, 7*24*360))
|
|
367
|
+
eq(a//3600000, td(0, 0, 7*24*1000))
|
|
368
|
+
eq(a/0.5, td(14))
|
|
369
|
+
eq(b/0.5, td(0, 120))
|
|
370
|
+
eq(a/7, td(1))
|
|
371
|
+
eq(b/10, td(0, 6))
|
|
372
|
+
eq(c/1000, td(0, 0, 1))
|
|
373
|
+
eq(a/10, td(0, 7*24*360))
|
|
374
|
+
eq(a/3600000, td(0, 0, 7*24*1000))
|
|
375
|
+
|
|
376
|
+
# Multiplication by float
|
|
377
|
+
us = td(microseconds=1)
|
|
378
|
+
eq((3*us) * 0.5, 2*us)
|
|
379
|
+
eq((5*us) * 0.5, 2*us)
|
|
380
|
+
eq(0.5 * (3*us), 2*us)
|
|
381
|
+
eq(0.5 * (5*us), 2*us)
|
|
382
|
+
eq((-3*us) * 0.5, -2*us)
|
|
383
|
+
eq((-5*us) * 0.5, -2*us)
|
|
384
|
+
|
|
385
|
+
# Division by int and float
|
|
386
|
+
eq((3*us) / 2, 2*us)
|
|
387
|
+
eq((5*us) / 2, 2*us)
|
|
388
|
+
eq((-3*us) / 2.0, -2*us)
|
|
389
|
+
eq((-5*us) / 2.0, -2*us)
|
|
390
|
+
eq((3*us) / -2, -2*us)
|
|
391
|
+
eq((5*us) / -2, -2*us)
|
|
392
|
+
eq((3*us) / -2.0, -2*us)
|
|
393
|
+
eq((5*us) / -2.0, -2*us)
|
|
394
|
+
for i in range(-10, 10):
|
|
395
|
+
eq((i*us/3)//us, round(i/3))
|
|
396
|
+
for i in range(-10, 10):
|
|
397
|
+
eq((i*us/-3)//us, round(i/-3))
|
|
398
|
+
|
|
399
|
+
# Issue #11576
|
|
400
|
+
eq(td(999999999, 86399, 999999) - td(999999999, 86399, 999998),
|
|
401
|
+
td(0, 0, 1))
|
|
402
|
+
eq(td(999999999, 1, 1) - td(999999999, 1, 0),
|
|
403
|
+
td(0, 0, 1))
|
|
404
|
+
|
|
405
|
+
def test_disallowed_computations(self):
|
|
406
|
+
a = timedelta(42)
|
|
407
|
+
|
|
408
|
+
# Add/sub ints or floats should be illegal
|
|
409
|
+
for i in 1, 1.0:
|
|
410
|
+
self.assertRaises(TypeError, lambda: a+i)
|
|
411
|
+
self.assertRaises(TypeError, lambda: a-i)
|
|
412
|
+
self.assertRaises(TypeError, lambda: i+a)
|
|
413
|
+
self.assertRaises(TypeError, lambda: i-a)
|
|
414
|
+
|
|
415
|
+
# Division of int by timedelta doesn't make sense.
|
|
416
|
+
# Division by zero doesn't make sense.
|
|
417
|
+
zero = 0
|
|
418
|
+
self.assertRaises(TypeError, lambda: zero // a)
|
|
419
|
+
self.assertRaises(ZeroDivisionError, lambda: a // zero)
|
|
420
|
+
self.assertRaises(ZeroDivisionError, lambda: a / zero)
|
|
421
|
+
self.assertRaises(ZeroDivisionError, lambda: a / 0.0)
|
|
422
|
+
self.assertRaises(TypeError, lambda: a / '')
|
|
423
|
+
|
|
424
|
+
@support.requires_IEEE_754
|
|
425
|
+
def test_disallowed_special(self):
|
|
426
|
+
a = timedelta(42)
|
|
427
|
+
self.assertRaises(ValueError, a.__mul__, NAN)
|
|
428
|
+
self.assertRaises(ValueError, a.__truediv__, NAN)
|
|
429
|
+
|
|
430
|
+
def test_basic_attributes(self):
|
|
431
|
+
days, seconds, us = 1, 7, 31
|
|
432
|
+
td = timedelta(days, seconds, us)
|
|
433
|
+
self.assertEqual(td.days, days)
|
|
434
|
+
self.assertEqual(td.seconds, seconds)
|
|
435
|
+
self.assertEqual(td.microseconds, us)
|
|
436
|
+
|
|
437
|
+
def test_total_seconds(self):
|
|
438
|
+
td = timedelta(days=365)
|
|
439
|
+
self.assertEqual(td.total_seconds(), 31536000.0)
|
|
440
|
+
for total_seconds in [123456.789012, -123456.789012, 0.123456, 0, 1e6]:
|
|
441
|
+
td = timedelta(seconds=total_seconds)
|
|
442
|
+
self.assertEqual(td.total_seconds(), total_seconds)
|
|
443
|
+
# Issue8644: Test that td.total_seconds() has the same
|
|
444
|
+
# accuracy as td / timedelta(seconds=1).
|
|
445
|
+
for ms in [-1, -2, -123]:
|
|
446
|
+
td = timedelta(microseconds=ms)
|
|
447
|
+
self.assertEqual(td.total_seconds(), td / timedelta(seconds=1))
|
|
448
|
+
|
|
449
|
+
def test_carries(self):
|
|
450
|
+
t1 = timedelta(days=100,
|
|
451
|
+
weeks=-7,
|
|
452
|
+
hours=-24*(100-49),
|
|
453
|
+
minutes=-3,
|
|
454
|
+
seconds=12,
|
|
455
|
+
microseconds=(3*60 - 12) * 1e6 + 1)
|
|
456
|
+
t2 = timedelta(microseconds=1)
|
|
457
|
+
self.assertEqual(t1, t2)
|
|
458
|
+
|
|
459
|
+
def test_hash_equality(self):
|
|
460
|
+
t1 = timedelta(days=100,
|
|
461
|
+
weeks=-7,
|
|
462
|
+
hours=-24*(100-49),
|
|
463
|
+
minutes=-3,
|
|
464
|
+
seconds=12,
|
|
465
|
+
microseconds=(3*60 - 12) * 1000000)
|
|
466
|
+
t2 = timedelta()
|
|
467
|
+
self.assertEqual(hash(t1), hash(t2))
|
|
468
|
+
|
|
469
|
+
t1 += timedelta(weeks=7)
|
|
470
|
+
t2 += timedelta(days=7*7)
|
|
471
|
+
self.assertEqual(t1, t2)
|
|
472
|
+
self.assertEqual(hash(t1), hash(t2))
|
|
473
|
+
|
|
474
|
+
d = {t1: 1}
|
|
475
|
+
d[t2] = 2
|
|
476
|
+
self.assertEqual(len(d), 1)
|
|
477
|
+
self.assertEqual(d[t1], 2)
|
|
478
|
+
|
|
479
|
+
def test_pickling(self):
|
|
480
|
+
args = 12, 34, 56
|
|
481
|
+
orig = timedelta(*args)
|
|
482
|
+
for pickler, unpickler, proto in pickle_choices:
|
|
483
|
+
green = pickler.dumps(orig, proto)
|
|
484
|
+
derived = unpickler.loads(green)
|
|
485
|
+
self.assertEqual(orig, derived)
|
|
486
|
+
|
|
487
|
+
def test_compare(self):
|
|
488
|
+
t1 = timedelta(2, 3, 4)
|
|
489
|
+
t2 = timedelta(2, 3, 4)
|
|
490
|
+
self.assertEqual(t1, t2)
|
|
491
|
+
self.assertTrue(t1 <= t2)
|
|
492
|
+
self.assertTrue(t1 >= t2)
|
|
493
|
+
self.assertFalse(t1 != t2)
|
|
494
|
+
self.assertFalse(t1 < t2)
|
|
495
|
+
self.assertFalse(t1 > t2)
|
|
496
|
+
|
|
497
|
+
for args in (3, 3, 3), (2, 4, 4), (2, 3, 5):
|
|
498
|
+
t2 = timedelta(*args) # this is larger than t1
|
|
499
|
+
self.assertTrue(t1 < t2)
|
|
500
|
+
self.assertTrue(t2 > t1)
|
|
501
|
+
self.assertTrue(t1 <= t2)
|
|
502
|
+
self.assertTrue(t2 >= t1)
|
|
503
|
+
self.assertTrue(t1 != t2)
|
|
504
|
+
self.assertTrue(t2 != t1)
|
|
505
|
+
self.assertFalse(t1 == t2)
|
|
506
|
+
self.assertFalse(t2 == t1)
|
|
507
|
+
self.assertFalse(t1 > t2)
|
|
508
|
+
self.assertFalse(t2 < t1)
|
|
509
|
+
self.assertFalse(t1 >= t2)
|
|
510
|
+
self.assertFalse(t2 <= t1)
|
|
511
|
+
|
|
512
|
+
for badarg in OTHERSTUFF:
|
|
513
|
+
self.assertEqual(t1 == badarg, False)
|
|
514
|
+
self.assertEqual(t1 != badarg, True)
|
|
515
|
+
self.assertEqual(badarg == t1, False)
|
|
516
|
+
self.assertEqual(badarg != t1, True)
|
|
517
|
+
|
|
518
|
+
self.assertRaises(TypeError, lambda: t1 <= badarg)
|
|
519
|
+
self.assertRaises(TypeError, lambda: t1 < badarg)
|
|
520
|
+
self.assertRaises(TypeError, lambda: t1 > badarg)
|
|
521
|
+
self.assertRaises(TypeError, lambda: t1 >= badarg)
|
|
522
|
+
self.assertRaises(TypeError, lambda: badarg <= t1)
|
|
523
|
+
self.assertRaises(TypeError, lambda: badarg < t1)
|
|
524
|
+
self.assertRaises(TypeError, lambda: badarg > t1)
|
|
525
|
+
self.assertRaises(TypeError, lambda: badarg >= t1)
|
|
526
|
+
|
|
527
|
+
def test_str(self):
|
|
528
|
+
td = timedelta
|
|
529
|
+
eq = self.assertEqual
|
|
530
|
+
|
|
531
|
+
eq(str(td(1)), "1 day, 0:00:00")
|
|
532
|
+
eq(str(td(-1)), "-1 day, 0:00:00")
|
|
533
|
+
eq(str(td(2)), "2 days, 0:00:00")
|
|
534
|
+
eq(str(td(-2)), "-2 days, 0:00:00")
|
|
535
|
+
|
|
536
|
+
eq(str(td(hours=12, minutes=58, seconds=59)), "12:58:59")
|
|
537
|
+
eq(str(td(hours=2, minutes=3, seconds=4)), "2:03:04")
|
|
538
|
+
eq(str(td(weeks=-30, hours=23, minutes=12, seconds=34)),
|
|
539
|
+
"-210 days, 23:12:34")
|
|
540
|
+
|
|
541
|
+
eq(str(td(milliseconds=1)), "0:00:00.001000")
|
|
542
|
+
eq(str(td(microseconds=3)), "0:00:00.000003")
|
|
543
|
+
|
|
544
|
+
eq(str(td(days=999999999, hours=23, minutes=59, seconds=59,
|
|
545
|
+
microseconds=999999)),
|
|
546
|
+
"999999999 days, 23:59:59.999999")
|
|
547
|
+
|
|
548
|
+
def test_repr(self):
|
|
549
|
+
name = 'datetime.' + self.theclass.__name__
|
|
550
|
+
self.assertEqual(repr(self.theclass(1)),
|
|
551
|
+
"%s(1)" % name)
|
|
552
|
+
self.assertEqual(repr(self.theclass(10, 2)),
|
|
553
|
+
"%s(10, 2)" % name)
|
|
554
|
+
self.assertEqual(repr(self.theclass(-10, 2, 400000)),
|
|
555
|
+
"%s(-10, 2, 400000)" % name)
|
|
556
|
+
|
|
557
|
+
def test_roundtrip(self):
|
|
558
|
+
for td in (timedelta(days=999999999, hours=23, minutes=59,
|
|
559
|
+
seconds=59, microseconds=999999),
|
|
560
|
+
timedelta(days=-999999999),
|
|
561
|
+
timedelta(days=-999999999, seconds=1),
|
|
562
|
+
timedelta(days=1, seconds=2, microseconds=3)):
|
|
563
|
+
|
|
564
|
+
# Verify td -> string -> td identity.
|
|
565
|
+
s = repr(td)
|
|
566
|
+
self.assertTrue(s.startswith('datetime.'))
|
|
567
|
+
s = s[9:]
|
|
568
|
+
td2 = eval(s)
|
|
569
|
+
self.assertEqual(td, td2)
|
|
570
|
+
|
|
571
|
+
# Verify identity via reconstructing from pieces.
|
|
572
|
+
td2 = timedelta(td.days, td.seconds, td.microseconds)
|
|
573
|
+
self.assertEqual(td, td2)
|
|
574
|
+
|
|
575
|
+
def test_resolution_info(self):
|
|
576
|
+
self.assertIsInstance(timedelta.min, timedelta)
|
|
577
|
+
self.assertIsInstance(timedelta.max, timedelta)
|
|
578
|
+
self.assertIsInstance(timedelta.resolution, timedelta)
|
|
579
|
+
self.assertTrue(timedelta.max > timedelta.min)
|
|
580
|
+
self.assertEqual(timedelta.min, timedelta(-999999999))
|
|
581
|
+
self.assertEqual(timedelta.max, timedelta(999999999, 24*3600-1, 1e6-1))
|
|
582
|
+
self.assertEqual(timedelta.resolution, timedelta(0, 0, 1))
|
|
583
|
+
|
|
584
|
+
def test_overflow(self):
|
|
585
|
+
tiny = timedelta.resolution
|
|
586
|
+
|
|
587
|
+
td = timedelta.min + tiny
|
|
588
|
+
td -= tiny # no problem
|
|
589
|
+
self.assertRaises(OverflowError, td.__sub__, tiny)
|
|
590
|
+
self.assertRaises(OverflowError, td.__add__, -tiny)
|
|
591
|
+
|
|
592
|
+
td = timedelta.max - tiny
|
|
593
|
+
td += tiny # no problem
|
|
594
|
+
self.assertRaises(OverflowError, td.__add__, tiny)
|
|
595
|
+
self.assertRaises(OverflowError, td.__sub__, -tiny)
|
|
596
|
+
|
|
597
|
+
self.assertRaises(OverflowError, lambda: -timedelta.max)
|
|
598
|
+
|
|
599
|
+
day = timedelta(1)
|
|
600
|
+
self.assertRaises(OverflowError, day.__mul__, 10**9)
|
|
601
|
+
self.assertRaises(OverflowError, day.__mul__, 1e9)
|
|
602
|
+
self.assertRaises(OverflowError, day.__truediv__, 1e-20)
|
|
603
|
+
self.assertRaises(OverflowError, day.__truediv__, 1e-10)
|
|
604
|
+
self.assertRaises(OverflowError, day.__truediv__, 9e-10)
|
|
605
|
+
|
|
606
|
+
@support.requires_IEEE_754
|
|
607
|
+
def _test_overflow_special(self):
|
|
608
|
+
day = timedelta(1)
|
|
609
|
+
self.assertRaises(OverflowError, day.__mul__, INF)
|
|
610
|
+
self.assertRaises(OverflowError, day.__mul__, -INF)
|
|
611
|
+
|
|
612
|
+
def test_microsecond_rounding(self):
|
|
613
|
+
td = timedelta
|
|
614
|
+
eq = self.assertEqual
|
|
615
|
+
|
|
616
|
+
# Single-field rounding.
|
|
617
|
+
eq(td(milliseconds=0.4/1000), td(0)) # rounds to 0
|
|
618
|
+
eq(td(milliseconds=-0.4/1000), td(0)) # rounds to 0
|
|
619
|
+
eq(td(milliseconds=0.6/1000), td(microseconds=1))
|
|
620
|
+
eq(td(milliseconds=-0.6/1000), td(microseconds=-1))
|
|
621
|
+
|
|
622
|
+
# Rounding due to contributions from more than one field.
|
|
623
|
+
us_per_hour = 3600e6
|
|
624
|
+
us_per_day = us_per_hour * 24
|
|
625
|
+
eq(td(days=.4/us_per_day), td(0))
|
|
626
|
+
eq(td(hours=.2/us_per_hour), td(0))
|
|
627
|
+
eq(td(days=.4/us_per_day, hours=.2/us_per_hour), td(microseconds=1))
|
|
628
|
+
|
|
629
|
+
eq(td(days=-.4/us_per_day), td(0))
|
|
630
|
+
eq(td(hours=-.2/us_per_hour), td(0))
|
|
631
|
+
eq(td(days=-.4/us_per_day, hours=-.2/us_per_hour), td(microseconds=-1))
|
|
632
|
+
|
|
633
|
+
# Test for a patch in Issue 8860
|
|
634
|
+
eq(td(microseconds=0.5), 0.5*td(microseconds=1.0))
|
|
635
|
+
eq(td(microseconds=0.5)//td.resolution, 0.5*td.resolution//td.resolution)
|
|
636
|
+
|
|
637
|
+
def test_massive_normalization(self):
|
|
638
|
+
td = timedelta(microseconds=-1)
|
|
639
|
+
self.assertEqual((td.days, td.seconds, td.microseconds),
|
|
640
|
+
(-1, 24*3600-1, 999999))
|
|
641
|
+
|
|
642
|
+
def test_bool(self):
|
|
643
|
+
self.assertTrue(timedelta(1))
|
|
644
|
+
self.assertTrue(timedelta(0, 1))
|
|
645
|
+
self.assertTrue(timedelta(0, 0, 1))
|
|
646
|
+
self.assertTrue(timedelta(microseconds=1))
|
|
647
|
+
self.assertFalse(timedelta(0))
|
|
648
|
+
|
|
649
|
+
def test_subclass_timedelta(self):
|
|
650
|
+
|
|
651
|
+
class T(timedelta):
|
|
652
|
+
@staticmethod
|
|
653
|
+
def from_td(td):
|
|
654
|
+
return T(td.days, td.seconds, td.microseconds)
|
|
655
|
+
|
|
656
|
+
def as_hours(self):
|
|
657
|
+
sum = (self.days * 24 +
|
|
658
|
+
self.seconds / 3600.0 +
|
|
659
|
+
self.microseconds / 3600e6)
|
|
660
|
+
return round(sum)
|
|
661
|
+
|
|
662
|
+
t1 = T(days=1)
|
|
663
|
+
self.assertIs(type(t1), T)
|
|
664
|
+
self.assertEqual(t1.as_hours(), 24)
|
|
665
|
+
|
|
666
|
+
t2 = T(days=-1, seconds=-3600)
|
|
667
|
+
self.assertIs(type(t2), T)
|
|
668
|
+
self.assertEqual(t2.as_hours(), -25)
|
|
669
|
+
|
|
670
|
+
t3 = t1 + t2
|
|
671
|
+
self.assertIs(type(t3), timedelta)
|
|
672
|
+
t4 = T.from_td(t3)
|
|
673
|
+
self.assertIs(type(t4), T)
|
|
674
|
+
self.assertEqual(t3.days, t4.days)
|
|
675
|
+
self.assertEqual(t3.seconds, t4.seconds)
|
|
676
|
+
self.assertEqual(t3.microseconds, t4.microseconds)
|
|
677
|
+
self.assertEqual(str(t3), str(t4))
|
|
678
|
+
self.assertEqual(t4.as_hours(), -1)
|
|
679
|
+
|
|
680
|
+
def test_division(self):
|
|
681
|
+
t = timedelta(hours=1, minutes=24, seconds=19)
|
|
682
|
+
second = timedelta(seconds=1)
|
|
683
|
+
self.assertEqual(t / second, 5059.0)
|
|
684
|
+
self.assertEqual(t // second, 5059)
|
|
685
|
+
|
|
686
|
+
t = timedelta(minutes=2, seconds=30)
|
|
687
|
+
minute = timedelta(minutes=1)
|
|
688
|
+
self.assertEqual(t / minute, 2.5)
|
|
689
|
+
self.assertEqual(t // minute, 2)
|
|
690
|
+
|
|
691
|
+
zerotd = timedelta(0)
|
|
692
|
+
self.assertRaises(ZeroDivisionError, truediv, t, zerotd)
|
|
693
|
+
self.assertRaises(ZeroDivisionError, floordiv, t, zerotd)
|
|
694
|
+
|
|
695
|
+
# self.assertRaises(TypeError, truediv, t, 2)
|
|
696
|
+
# note: floor division of a timedelta by an integer *is*
|
|
697
|
+
# currently permitted.
|
|
698
|
+
|
|
699
|
+
def test_remainder(self):
|
|
700
|
+
t = timedelta(minutes=2, seconds=30)
|
|
701
|
+
minute = timedelta(minutes=1)
|
|
702
|
+
r = t % minute
|
|
703
|
+
self.assertEqual(r, timedelta(seconds=30))
|
|
704
|
+
|
|
705
|
+
t = timedelta(minutes=-2, seconds=30)
|
|
706
|
+
r = t % minute
|
|
707
|
+
self.assertEqual(r, timedelta(seconds=30))
|
|
708
|
+
|
|
709
|
+
zerotd = timedelta(0)
|
|
710
|
+
self.assertRaises(ZeroDivisionError, mod, t, zerotd)
|
|
711
|
+
|
|
712
|
+
self.assertRaises(TypeError, mod, t, 10)
|
|
713
|
+
|
|
714
|
+
def test_divmod(self):
|
|
715
|
+
t = timedelta(minutes=2, seconds=30)
|
|
716
|
+
minute = timedelta(minutes=1)
|
|
717
|
+
q, r = divmod(t, minute)
|
|
718
|
+
self.assertEqual(q, 2)
|
|
719
|
+
self.assertEqual(r, timedelta(seconds=30))
|
|
720
|
+
|
|
721
|
+
t = timedelta(minutes=-2, seconds=30)
|
|
722
|
+
q, r = divmod(t, minute)
|
|
723
|
+
self.assertEqual(q, -2)
|
|
724
|
+
self.assertEqual(r, timedelta(seconds=30))
|
|
725
|
+
|
|
726
|
+
zerotd = timedelta(0)
|
|
727
|
+
self.assertRaises(ZeroDivisionError, divmod, t, zerotd)
|
|
728
|
+
|
|
729
|
+
self.assertRaises(TypeError, divmod, t, 10)
|
|
730
|
+
|
|
731
|
+
|
|
732
|
+
#############################################################################
|
|
733
|
+
# date tests
|
|
734
|
+
|
|
735
|
+
class TestDateOnly(unittest.TestCase):
|
|
736
|
+
# Tests here won't pass if also run on datetime objects, so don't
|
|
737
|
+
# subclass this to test datetimes too.
|
|
738
|
+
|
|
739
|
+
def test_delta_non_days_ignored(self):
|
|
740
|
+
dt = date(2000, 1, 2)
|
|
741
|
+
delta = timedelta(days=1, hours=2, minutes=3, seconds=4,
|
|
742
|
+
microseconds=5)
|
|
743
|
+
days = timedelta(delta.days)
|
|
744
|
+
self.assertEqual(days, timedelta(1))
|
|
745
|
+
|
|
746
|
+
dt2 = dt + delta
|
|
747
|
+
self.assertEqual(dt2, dt + days)
|
|
748
|
+
|
|
749
|
+
dt2 = delta + dt
|
|
750
|
+
self.assertEqual(dt2, dt + days)
|
|
751
|
+
|
|
752
|
+
dt2 = dt - delta
|
|
753
|
+
self.assertEqual(dt2, dt - days)
|
|
754
|
+
|
|
755
|
+
delta = -delta
|
|
756
|
+
days = timedelta(delta.days)
|
|
757
|
+
self.assertEqual(days, timedelta(-2))
|
|
758
|
+
|
|
759
|
+
dt2 = dt + delta
|
|
760
|
+
self.assertEqual(dt2, dt + days)
|
|
761
|
+
|
|
762
|
+
dt2 = delta + dt
|
|
763
|
+
self.assertEqual(dt2, dt + days)
|
|
764
|
+
|
|
765
|
+
dt2 = dt - delta
|
|
766
|
+
self.assertEqual(dt2, dt - days)
|
|
767
|
+
|
|
768
|
+
class SubclassDate(date):
|
|
769
|
+
sub_var = 1
|
|
770
|
+
|
|
771
|
+
class TestDate(HarmlessMixedComparison, unittest.TestCase):
|
|
772
|
+
# Tests here should pass for both dates and datetimes, except for a
|
|
773
|
+
# few tests that TestDateTime overrides.
|
|
774
|
+
|
|
775
|
+
theclass = date
|
|
776
|
+
|
|
777
|
+
def test_basic_attributes(self):
|
|
778
|
+
dt = self.theclass(2002, 3, 1)
|
|
779
|
+
self.assertEqual(dt.year, 2002)
|
|
780
|
+
self.assertEqual(dt.month, 3)
|
|
781
|
+
self.assertEqual(dt.day, 1)
|
|
782
|
+
|
|
783
|
+
def test_roundtrip(self):
|
|
784
|
+
for dt in (self.theclass(1, 2, 3),
|
|
785
|
+
self.theclass.today()):
|
|
786
|
+
# Verify dt -> string -> date identity.
|
|
787
|
+
s = repr(dt)
|
|
788
|
+
self.assertTrue(s.startswith('datetime.'))
|
|
789
|
+
s = s[9:]
|
|
790
|
+
dt2 = eval(s)
|
|
791
|
+
self.assertEqual(dt, dt2)
|
|
792
|
+
|
|
793
|
+
# Verify identity via reconstructing from pieces.
|
|
794
|
+
dt2 = self.theclass(dt.year, dt.month, dt.day)
|
|
795
|
+
self.assertEqual(dt, dt2)
|
|
796
|
+
|
|
797
|
+
def test_ordinal_conversions(self):
|
|
798
|
+
# Check some fixed values.
|
|
799
|
+
for y, m, d, n in [(1, 1, 1, 1), # calendar origin
|
|
800
|
+
(1, 12, 31, 365),
|
|
801
|
+
(2, 1, 1, 366),
|
|
802
|
+
# first example from "Calendrical Calculations"
|
|
803
|
+
(1945, 11, 12, 710347)]:
|
|
804
|
+
d = self.theclass(y, m, d)
|
|
805
|
+
self.assertEqual(n, d.toordinal())
|
|
806
|
+
fromord = self.theclass.fromordinal(n)
|
|
807
|
+
self.assertEqual(d, fromord)
|
|
808
|
+
if hasattr(fromord, "hour"):
|
|
809
|
+
# if we're checking something fancier than a date, verify
|
|
810
|
+
# the extra fields have been zeroed out
|
|
811
|
+
self.assertEqual(fromord.hour, 0)
|
|
812
|
+
self.assertEqual(fromord.minute, 0)
|
|
813
|
+
self.assertEqual(fromord.second, 0)
|
|
814
|
+
self.assertEqual(fromord.microsecond, 0)
|
|
815
|
+
|
|
816
|
+
# Check first and last days of year spottily across the whole
|
|
817
|
+
# range of years supported.
|
|
818
|
+
for year in range(MINYEAR, MAXYEAR+1, 7):
|
|
819
|
+
# Verify (year, 1, 1) -> ordinal -> y, m, d is identity.
|
|
820
|
+
d = self.theclass(year, 1, 1)
|
|
821
|
+
n = d.toordinal()
|
|
822
|
+
d2 = self.theclass.fromordinal(n)
|
|
823
|
+
self.assertEqual(d, d2)
|
|
824
|
+
# Verify that moving back a day gets to the end of year-1.
|
|
825
|
+
if year > 1:
|
|
826
|
+
d = self.theclass.fromordinal(n-1)
|
|
827
|
+
d2 = self.theclass(year-1, 12, 31)
|
|
828
|
+
self.assertEqual(d, d2)
|
|
829
|
+
self.assertEqual(d2.toordinal(), n-1)
|
|
830
|
+
|
|
831
|
+
# Test every day in a leap-year and a non-leap year.
|
|
832
|
+
dim = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
|
|
833
|
+
for year, isleap in (2000, True), (2002, False):
|
|
834
|
+
n = self.theclass(year, 1, 1).toordinal()
|
|
835
|
+
for month, maxday in zip(range(1, 13), dim):
|
|
836
|
+
if month == 2 and isleap:
|
|
837
|
+
maxday += 1
|
|
838
|
+
for day in range(1, maxday+1):
|
|
839
|
+
d = self.theclass(year, month, day)
|
|
840
|
+
self.assertEqual(d.toordinal(), n)
|
|
841
|
+
self.assertEqual(d, self.theclass.fromordinal(n))
|
|
842
|
+
n += 1
|
|
843
|
+
|
|
844
|
+
def test_extreme_ordinals(self):
|
|
845
|
+
a = self.theclass.min
|
|
846
|
+
a = self.theclass(a.year, a.month, a.day) # get rid of time parts
|
|
847
|
+
aord = a.toordinal()
|
|
848
|
+
b = a.fromordinal(aord)
|
|
849
|
+
self.assertEqual(a, b)
|
|
850
|
+
|
|
851
|
+
self.assertRaises(ValueError, lambda: a.fromordinal(aord - 1))
|
|
852
|
+
|
|
853
|
+
b = a + timedelta(days=1)
|
|
854
|
+
self.assertEqual(b.toordinal(), aord + 1)
|
|
855
|
+
self.assertEqual(b, self.theclass.fromordinal(aord + 1))
|
|
856
|
+
|
|
857
|
+
a = self.theclass.max
|
|
858
|
+
a = self.theclass(a.year, a.month, a.day) # get rid of time parts
|
|
859
|
+
aord = a.toordinal()
|
|
860
|
+
b = a.fromordinal(aord)
|
|
861
|
+
self.assertEqual(a, b)
|
|
862
|
+
|
|
863
|
+
self.assertRaises(ValueError, lambda: a.fromordinal(aord + 1))
|
|
864
|
+
|
|
865
|
+
b = a - timedelta(days=1)
|
|
866
|
+
self.assertEqual(b.toordinal(), aord - 1)
|
|
867
|
+
self.assertEqual(b, self.theclass.fromordinal(aord - 1))
|
|
868
|
+
|
|
869
|
+
def test_bad_constructor_arguments(self):
|
|
870
|
+
# bad years
|
|
871
|
+
self.theclass(MINYEAR, 1, 1) # no exception
|
|
872
|
+
self.theclass(MAXYEAR, 1, 1) # no exception
|
|
873
|
+
self.assertRaises(ValueError, self.theclass, MINYEAR-1, 1, 1)
|
|
874
|
+
self.assertRaises(ValueError, self.theclass, MAXYEAR+1, 1, 1)
|
|
875
|
+
# bad months
|
|
876
|
+
self.theclass(2000, 1, 1) # no exception
|
|
877
|
+
self.theclass(2000, 12, 1) # no exception
|
|
878
|
+
self.assertRaises(ValueError, self.theclass, 2000, 0, 1)
|
|
879
|
+
self.assertRaises(ValueError, self.theclass, 2000, 13, 1)
|
|
880
|
+
# bad days
|
|
881
|
+
self.theclass(2000, 2, 29) # no exception
|
|
882
|
+
self.theclass(2004, 2, 29) # no exception
|
|
883
|
+
self.theclass(2400, 2, 29) # no exception
|
|
884
|
+
self.assertRaises(ValueError, self.theclass, 2000, 2, 30)
|
|
885
|
+
self.assertRaises(ValueError, self.theclass, 2001, 2, 29)
|
|
886
|
+
self.assertRaises(ValueError, self.theclass, 2100, 2, 29)
|
|
887
|
+
self.assertRaises(ValueError, self.theclass, 1900, 2, 29)
|
|
888
|
+
self.assertRaises(ValueError, self.theclass, 2000, 1, 0)
|
|
889
|
+
self.assertRaises(ValueError, self.theclass, 2000, 1, 32)
|
|
890
|
+
|
|
891
|
+
def test_hash_equality(self):
|
|
892
|
+
d = self.theclass(2000, 12, 31)
|
|
893
|
+
# same thing
|
|
894
|
+
e = self.theclass(2000, 12, 31)
|
|
895
|
+
self.assertEqual(d, e)
|
|
896
|
+
self.assertEqual(hash(d), hash(e))
|
|
897
|
+
|
|
898
|
+
dic = {d: 1}
|
|
899
|
+
dic[e] = 2
|
|
900
|
+
self.assertEqual(len(dic), 1)
|
|
901
|
+
self.assertEqual(dic[d], 2)
|
|
902
|
+
self.assertEqual(dic[e], 2)
|
|
903
|
+
|
|
904
|
+
d = self.theclass(2001, 1, 1)
|
|
905
|
+
# same thing
|
|
906
|
+
e = self.theclass(2001, 1, 1)
|
|
907
|
+
self.assertEqual(d, e)
|
|
908
|
+
self.assertEqual(hash(d), hash(e))
|
|
909
|
+
|
|
910
|
+
dic = {d: 1}
|
|
911
|
+
dic[e] = 2
|
|
912
|
+
self.assertEqual(len(dic), 1)
|
|
913
|
+
self.assertEqual(dic[d], 2)
|
|
914
|
+
self.assertEqual(dic[e], 2)
|
|
915
|
+
|
|
916
|
+
def test_computations(self):
|
|
917
|
+
a = self.theclass(2002, 1, 31)
|
|
918
|
+
b = self.theclass(1956, 1, 31)
|
|
919
|
+
c = self.theclass(2001,2,1)
|
|
920
|
+
|
|
921
|
+
diff = a-b
|
|
922
|
+
self.assertEqual(diff.days, 46*365 + len(range(1956, 2002, 4)))
|
|
923
|
+
self.assertEqual(diff.seconds, 0)
|
|
924
|
+
self.assertEqual(diff.microseconds, 0)
|
|
925
|
+
|
|
926
|
+
day = timedelta(1)
|
|
927
|
+
week = timedelta(7)
|
|
928
|
+
a = self.theclass(2002, 3, 2)
|
|
929
|
+
self.assertEqual(a + day, self.theclass(2002, 3, 3))
|
|
930
|
+
self.assertEqual(day + a, self.theclass(2002, 3, 3))
|
|
931
|
+
self.assertEqual(a - day, self.theclass(2002, 3, 1))
|
|
932
|
+
self.assertEqual(-day + a, self.theclass(2002, 3, 1))
|
|
933
|
+
self.assertEqual(a + week, self.theclass(2002, 3, 9))
|
|
934
|
+
self.assertEqual(a - week, self.theclass(2002, 2, 23))
|
|
935
|
+
self.assertEqual(a + 52*week, self.theclass(2003, 3, 1))
|
|
936
|
+
self.assertEqual(a - 52*week, self.theclass(2001, 3, 3))
|
|
937
|
+
self.assertEqual((a + week) - a, week)
|
|
938
|
+
self.assertEqual((a + day) - a, day)
|
|
939
|
+
self.assertEqual((a - week) - a, -week)
|
|
940
|
+
self.assertEqual((a - day) - a, -day)
|
|
941
|
+
self.assertEqual(a - (a + week), -week)
|
|
942
|
+
self.assertEqual(a - (a + day), -day)
|
|
943
|
+
self.assertEqual(a - (a - week), week)
|
|
944
|
+
self.assertEqual(a - (a - day), day)
|
|
945
|
+
self.assertEqual(c - (c - day), day)
|
|
946
|
+
|
|
947
|
+
# Add/sub ints or floats should be illegal
|
|
948
|
+
for i in 1, 1.0:
|
|
949
|
+
self.assertRaises(TypeError, lambda: a+i)
|
|
950
|
+
self.assertRaises(TypeError, lambda: a-i)
|
|
951
|
+
self.assertRaises(TypeError, lambda: i+a)
|
|
952
|
+
self.assertRaises(TypeError, lambda: i-a)
|
|
953
|
+
|
|
954
|
+
# delta - date is senseless.
|
|
955
|
+
self.assertRaises(TypeError, lambda: day - a)
|
|
956
|
+
# mixing date and (delta or date) via * or // is senseless
|
|
957
|
+
self.assertRaises(TypeError, lambda: day * a)
|
|
958
|
+
self.assertRaises(TypeError, lambda: a * day)
|
|
959
|
+
self.assertRaises(TypeError, lambda: day // a)
|
|
960
|
+
self.assertRaises(TypeError, lambda: a // day)
|
|
961
|
+
self.assertRaises(TypeError, lambda: a * a)
|
|
962
|
+
self.assertRaises(TypeError, lambda: a // a)
|
|
963
|
+
# date + date is senseless
|
|
964
|
+
self.assertRaises(TypeError, lambda: a + a)
|
|
965
|
+
|
|
966
|
+
def test_overflow(self):
|
|
967
|
+
tiny = self.theclass.resolution
|
|
968
|
+
|
|
969
|
+
for delta in [tiny, timedelta(1), timedelta(2)]:
|
|
970
|
+
dt = self.theclass.min + delta
|
|
971
|
+
dt -= delta # no problem
|
|
972
|
+
self.assertRaises(OverflowError, dt.__sub__, delta)
|
|
973
|
+
self.assertRaises(OverflowError, dt.__add__, -delta)
|
|
974
|
+
|
|
975
|
+
dt = self.theclass.max - delta
|
|
976
|
+
dt += delta # no problem
|
|
977
|
+
self.assertRaises(OverflowError, dt.__add__, delta)
|
|
978
|
+
self.assertRaises(OverflowError, dt.__sub__, -delta)
|
|
979
|
+
|
|
980
|
+
def test_fromtimestamp(self):
|
|
981
|
+
import time
|
|
982
|
+
|
|
983
|
+
# Try an arbitrary fixed value.
|
|
984
|
+
year, month, day = 1999, 9, 19
|
|
985
|
+
ts = time.mktime((year, month, day, 0, 0, 0, 0, 0, -1))
|
|
986
|
+
d = self.theclass.fromtimestamp(ts)
|
|
987
|
+
self.assertEqual(d.year, year)
|
|
988
|
+
self.assertEqual(d.month, month)
|
|
989
|
+
self.assertEqual(d.day, day)
|
|
990
|
+
|
|
991
|
+
def test_insane_fromtimestamp(self):
|
|
992
|
+
# It's possible that some platform maps time_t to double,
|
|
993
|
+
# and that this test will fail there. This test should
|
|
994
|
+
# exempt such platforms (provided they return reasonable
|
|
995
|
+
# results!).
|
|
996
|
+
for insane in -1e200, 1e200:
|
|
997
|
+
self.assertRaises(OverflowError, self.theclass.fromtimestamp,
|
|
998
|
+
insane)
|
|
999
|
+
|
|
1000
|
+
def test_today(self):
|
|
1001
|
+
import time
|
|
1002
|
+
|
|
1003
|
+
# We claim that today() is like fromtimestamp(time.time()), so
|
|
1004
|
+
# prove it.
|
|
1005
|
+
for dummy in range(3):
|
|
1006
|
+
today = self.theclass.today()
|
|
1007
|
+
ts = time.time()
|
|
1008
|
+
todayagain = self.theclass.fromtimestamp(ts)
|
|
1009
|
+
if today == todayagain:
|
|
1010
|
+
break
|
|
1011
|
+
# There are several legit reasons that could fail:
|
|
1012
|
+
# 1. It recently became midnight, between the today() and the
|
|
1013
|
+
# time() calls.
|
|
1014
|
+
# 2. The platform time() has such fine resolution that we'll
|
|
1015
|
+
# never get the same value twice.
|
|
1016
|
+
# 3. The platform time() has poor resolution, and we just
|
|
1017
|
+
# happened to call today() right before a resolution quantum
|
|
1018
|
+
# boundary.
|
|
1019
|
+
# 4. The system clock got fiddled between calls.
|
|
1020
|
+
# In any case, wait a little while and try again.
|
|
1021
|
+
time.sleep(0.1)
|
|
1022
|
+
|
|
1023
|
+
# It worked or it didn't. If it didn't, assume it's reason #2, and
|
|
1024
|
+
# let the test pass if they're within half a second of each other.
|
|
1025
|
+
if today != todayagain:
|
|
1026
|
+
self.assertAlmostEqual(todayagain, today,
|
|
1027
|
+
delta=timedelta(seconds=0.5))
|
|
1028
|
+
|
|
1029
|
+
def test_weekday(self):
|
|
1030
|
+
for i in range(7):
|
|
1031
|
+
# March 4, 2002 is a Monday
|
|
1032
|
+
self.assertEqual(self.theclass(2002, 3, 4+i).weekday(), i)
|
|
1033
|
+
self.assertEqual(self.theclass(2002, 3, 4+i).isoweekday(), i+1)
|
|
1034
|
+
# January 2, 1956 is a Monday
|
|
1035
|
+
self.assertEqual(self.theclass(1956, 1, 2+i).weekday(), i)
|
|
1036
|
+
self.assertEqual(self.theclass(1956, 1, 2+i).isoweekday(), i+1)
|
|
1037
|
+
|
|
1038
|
+
def test_isocalendar(self):
|
|
1039
|
+
# Check examples from
|
|
1040
|
+
# http://www.phys.uu.nl/~vgent/calendar/isocalendar.htm
|
|
1041
|
+
for i in range(7):
|
|
1042
|
+
d = self.theclass(2003, 12, 22+i)
|
|
1043
|
+
self.assertEqual(d.isocalendar(), (2003, 52, i+1))
|
|
1044
|
+
d = self.theclass(2003, 12, 29) + timedelta(i)
|
|
1045
|
+
self.assertEqual(d.isocalendar(), (2004, 1, i+1))
|
|
1046
|
+
d = self.theclass(2004, 1, 5+i)
|
|
1047
|
+
self.assertEqual(d.isocalendar(), (2004, 2, i+1))
|
|
1048
|
+
d = self.theclass(2009, 12, 21+i)
|
|
1049
|
+
self.assertEqual(d.isocalendar(), (2009, 52, i+1))
|
|
1050
|
+
d = self.theclass(2009, 12, 28) + timedelta(i)
|
|
1051
|
+
self.assertEqual(d.isocalendar(), (2009, 53, i+1))
|
|
1052
|
+
d = self.theclass(2010, 1, 4+i)
|
|
1053
|
+
self.assertEqual(d.isocalendar(), (2010, 1, i+1))
|
|
1054
|
+
|
|
1055
|
+
def test_iso_long_years(self):
|
|
1056
|
+
# Calculate long ISO years and compare to table from
|
|
1057
|
+
# http://www.phys.uu.nl/~vgent/calendar/isocalendar.htm
|
|
1058
|
+
ISO_LONG_YEARS_TABLE = """
|
|
1059
|
+
4 32 60 88
|
|
1060
|
+
9 37 65 93
|
|
1061
|
+
15 43 71 99
|
|
1062
|
+
20 48 76
|
|
1063
|
+
26 54 82
|
|
1064
|
+
|
|
1065
|
+
105 133 161 189
|
|
1066
|
+
111 139 167 195
|
|
1067
|
+
116 144 172
|
|
1068
|
+
122 150 178
|
|
1069
|
+
128 156 184
|
|
1070
|
+
|
|
1071
|
+
201 229 257 285
|
|
1072
|
+
207 235 263 291
|
|
1073
|
+
212 240 268 296
|
|
1074
|
+
218 246 274
|
|
1075
|
+
224 252 280
|
|
1076
|
+
|
|
1077
|
+
303 331 359 387
|
|
1078
|
+
308 336 364 392
|
|
1079
|
+
314 342 370 398
|
|
1080
|
+
320 348 376
|
|
1081
|
+
325 353 381
|
|
1082
|
+
"""
|
|
1083
|
+
iso_long_years = sorted(map(int, ISO_LONG_YEARS_TABLE.split()))
|
|
1084
|
+
L = []
|
|
1085
|
+
for i in range(400):
|
|
1086
|
+
d = self.theclass(2000+i, 12, 31)
|
|
1087
|
+
d1 = self.theclass(1600+i, 12, 31)
|
|
1088
|
+
self.assertEqual(d.isocalendar()[1:], d1.isocalendar()[1:])
|
|
1089
|
+
if d.isocalendar()[1] == 53:
|
|
1090
|
+
L.append(i)
|
|
1091
|
+
self.assertEqual(L, iso_long_years)
|
|
1092
|
+
|
|
1093
|
+
def test_isoformat(self):
|
|
1094
|
+
t = self.theclass(2, 3, 2)
|
|
1095
|
+
self.assertEqual(t.isoformat(), "0002-03-02")
|
|
1096
|
+
|
|
1097
|
+
def test_ctime(self):
|
|
1098
|
+
t = self.theclass(2002, 3, 2)
|
|
1099
|
+
self.assertEqual(t.ctime(), "Sat Mar 2 00:00:00 2002")
|
|
1100
|
+
|
|
1101
|
+
def test_strftime(self):
|
|
1102
|
+
t = self.theclass(2005, 3, 2)
|
|
1103
|
+
self.assertEqual(t.strftime("m:%m d:%d y:%y"), "m:03 d:02 y:05")
|
|
1104
|
+
self.assertEqual(t.strftime(""), "") # SF bug #761337
|
|
1105
|
+
self.assertEqual(t.strftime('x'*1000), 'x'*1000) # SF bug #1556784
|
|
1106
|
+
|
|
1107
|
+
self.assertRaises(TypeError, t.strftime) # needs an arg
|
|
1108
|
+
self.assertRaises(TypeError, t.strftime, "one", "two") # too many args
|
|
1109
|
+
self.assertRaises(TypeError, t.strftime, 42) # arg wrong type
|
|
1110
|
+
|
|
1111
|
+
# test that unicode input is allowed (issue 2782)
|
|
1112
|
+
self.assertEqual(t.strftime("%m"), "03")
|
|
1113
|
+
|
|
1114
|
+
# A naive object replaces %z and %Z w/ empty strings.
|
|
1115
|
+
self.assertEqual(t.strftime("'%z' '%Z'"), "'' ''")
|
|
1116
|
+
|
|
1117
|
+
#make sure that invalid format specifiers are handled correctly
|
|
1118
|
+
#self.assertRaises(ValueError, t.strftime, "%e")
|
|
1119
|
+
#self.assertRaises(ValueError, t.strftime, "%")
|
|
1120
|
+
#self.assertRaises(ValueError, t.strftime, "%#")
|
|
1121
|
+
|
|
1122
|
+
#oh well, some systems just ignore those invalid ones.
|
|
1123
|
+
#at least, excercise them to make sure that no crashes
|
|
1124
|
+
#are generated
|
|
1125
|
+
for f in ["%e", "%", "%#"]:
|
|
1126
|
+
try:
|
|
1127
|
+
t.strftime(f)
|
|
1128
|
+
except ValueError:
|
|
1129
|
+
pass
|
|
1130
|
+
|
|
1131
|
+
#check that this standard extension works
|
|
1132
|
+
t.strftime("%f")
|
|
1133
|
+
|
|
1134
|
+
|
|
1135
|
+
def test_format(self):
|
|
1136
|
+
dt = self.theclass(2007, 9, 10)
|
|
1137
|
+
self.assertEqual(dt.__format__(''), str(dt))
|
|
1138
|
+
|
|
1139
|
+
# check that a derived class's __str__() gets called
|
|
1140
|
+
class A(self.theclass):
|
|
1141
|
+
def __str__(self):
|
|
1142
|
+
return 'A'
|
|
1143
|
+
a = A(2007, 9, 10)
|
|
1144
|
+
self.assertEqual(a.__format__(''), 'A')
|
|
1145
|
+
|
|
1146
|
+
# check that a derived class's strftime gets called
|
|
1147
|
+
class B(self.theclass):
|
|
1148
|
+
def strftime(self, format_spec):
|
|
1149
|
+
return 'B'
|
|
1150
|
+
b = B(2007, 9, 10)
|
|
1151
|
+
self.assertEqual(b.__format__(''), str(dt))
|
|
1152
|
+
|
|
1153
|
+
for fmt in ["m:%m d:%d y:%y",
|
|
1154
|
+
"m:%m d:%d y:%y H:%H M:%M S:%S",
|
|
1155
|
+
"%z %Z",
|
|
1156
|
+
]:
|
|
1157
|
+
self.assertEqual(dt.__format__(fmt), dt.strftime(fmt))
|
|
1158
|
+
self.assertEqual(a.__format__(fmt), dt.strftime(fmt))
|
|
1159
|
+
self.assertEqual(b.__format__(fmt), 'B')
|
|
1160
|
+
|
|
1161
|
+
def test_resolution_info(self):
|
|
1162
|
+
# XXX: Should min and max respect subclassing?
|
|
1163
|
+
if issubclass(self.theclass, datetime):
|
|
1164
|
+
expected_class = datetime
|
|
1165
|
+
else:
|
|
1166
|
+
expected_class = date
|
|
1167
|
+
self.assertIsInstance(self.theclass.min, expected_class)
|
|
1168
|
+
self.assertIsInstance(self.theclass.max, expected_class)
|
|
1169
|
+
self.assertIsInstance(self.theclass.resolution, timedelta)
|
|
1170
|
+
self.assertTrue(self.theclass.max > self.theclass.min)
|
|
1171
|
+
|
|
1172
|
+
def test_extreme_timedelta(self):
|
|
1173
|
+
big = self.theclass.max - self.theclass.min
|
|
1174
|
+
# 3652058 days, 23 hours, 59 minutes, 59 seconds, 999999 microseconds
|
|
1175
|
+
n = (big.days*24*3600 + big.seconds)*1000000 + big.microseconds
|
|
1176
|
+
# n == 315537897599999999 ~= 2**58.13
|
|
1177
|
+
justasbig = timedelta(0, 0, n)
|
|
1178
|
+
self.assertEqual(big, justasbig)
|
|
1179
|
+
self.assertEqual(self.theclass.min + big, self.theclass.max)
|
|
1180
|
+
self.assertEqual(self.theclass.max - big, self.theclass.min)
|
|
1181
|
+
|
|
1182
|
+
def test_timetuple(self):
|
|
1183
|
+
for i in range(7):
|
|
1184
|
+
# January 2, 1956 is a Monday (0)
|
|
1185
|
+
d = self.theclass(1956, 1, 2+i)
|
|
1186
|
+
t = d.timetuple()
|
|
1187
|
+
self.assertEqual(t, (1956, 1, 2+i, 0, 0, 0, i, 2+i, -1))
|
|
1188
|
+
# February 1, 1956 is a Wednesday (2)
|
|
1189
|
+
d = self.theclass(1956, 2, 1+i)
|
|
1190
|
+
t = d.timetuple()
|
|
1191
|
+
self.assertEqual(t, (1956, 2, 1+i, 0, 0, 0, (2+i)%7, 32+i, -1))
|
|
1192
|
+
# March 1, 1956 is a Thursday (3), and is the 31+29+1 = 61st day
|
|
1193
|
+
# of the year.
|
|
1194
|
+
d = self.theclass(1956, 3, 1+i)
|
|
1195
|
+
t = d.timetuple()
|
|
1196
|
+
self.assertEqual(t, (1956, 3, 1+i, 0, 0, 0, (3+i)%7, 61+i, -1))
|
|
1197
|
+
self.assertEqual(t.tm_year, 1956)
|
|
1198
|
+
self.assertEqual(t.tm_mon, 3)
|
|
1199
|
+
self.assertEqual(t.tm_mday, 1+i)
|
|
1200
|
+
self.assertEqual(t.tm_hour, 0)
|
|
1201
|
+
self.assertEqual(t.tm_min, 0)
|
|
1202
|
+
self.assertEqual(t.tm_sec, 0)
|
|
1203
|
+
self.assertEqual(t.tm_wday, (3+i)%7)
|
|
1204
|
+
self.assertEqual(t.tm_yday, 61+i)
|
|
1205
|
+
self.assertEqual(t.tm_isdst, -1)
|
|
1206
|
+
|
|
1207
|
+
def test_pickling(self):
|
|
1208
|
+
args = 6, 7, 23
|
|
1209
|
+
orig = self.theclass(*args)
|
|
1210
|
+
for pickler, unpickler, proto in pickle_choices:
|
|
1211
|
+
green = pickler.dumps(orig, proto)
|
|
1212
|
+
derived = unpickler.loads(green)
|
|
1213
|
+
self.assertEqual(orig, derived)
|
|
1214
|
+
|
|
1215
|
+
def test_compare(self):
|
|
1216
|
+
t1 = self.theclass(2, 3, 4)
|
|
1217
|
+
t2 = self.theclass(2, 3, 4)
|
|
1218
|
+
self.assertEqual(t1, t2)
|
|
1219
|
+
self.assertTrue(t1 <= t2)
|
|
1220
|
+
self.assertTrue(t1 >= t2)
|
|
1221
|
+
self.assertFalse(t1 != t2)
|
|
1222
|
+
self.assertFalse(t1 < t2)
|
|
1223
|
+
self.assertFalse(t1 > t2)
|
|
1224
|
+
|
|
1225
|
+
for args in (3, 3, 3), (2, 4, 4), (2, 3, 5):
|
|
1226
|
+
t2 = self.theclass(*args) # this is larger than t1
|
|
1227
|
+
self.assertTrue(t1 < t2)
|
|
1228
|
+
self.assertTrue(t2 > t1)
|
|
1229
|
+
self.assertTrue(t1 <= t2)
|
|
1230
|
+
self.assertTrue(t2 >= t1)
|
|
1231
|
+
self.assertTrue(t1 != t2)
|
|
1232
|
+
self.assertTrue(t2 != t1)
|
|
1233
|
+
self.assertFalse(t1 == t2)
|
|
1234
|
+
self.assertFalse(t2 == t1)
|
|
1235
|
+
self.assertFalse(t1 > t2)
|
|
1236
|
+
self.assertFalse(t2 < t1)
|
|
1237
|
+
self.assertFalse(t1 >= t2)
|
|
1238
|
+
self.assertFalse(t2 <= t1)
|
|
1239
|
+
|
|
1240
|
+
for badarg in OTHERSTUFF:
|
|
1241
|
+
self.assertEqual(t1 == badarg, False)
|
|
1242
|
+
self.assertEqual(t1 != badarg, True)
|
|
1243
|
+
self.assertEqual(badarg == t1, False)
|
|
1244
|
+
self.assertEqual(badarg != t1, True)
|
|
1245
|
+
|
|
1246
|
+
self.assertRaises(TypeError, lambda: t1 < badarg)
|
|
1247
|
+
self.assertRaises(TypeError, lambda: t1 > badarg)
|
|
1248
|
+
self.assertRaises(TypeError, lambda: t1 >= badarg)
|
|
1249
|
+
self.assertRaises(TypeError, lambda: badarg <= t1)
|
|
1250
|
+
self.assertRaises(TypeError, lambda: badarg < t1)
|
|
1251
|
+
self.assertRaises(TypeError, lambda: badarg > t1)
|
|
1252
|
+
self.assertRaises(TypeError, lambda: badarg >= t1)
|
|
1253
|
+
|
|
1254
|
+
def test_mixed_compare(self):
|
|
1255
|
+
our = self.theclass(2000, 4, 5)
|
|
1256
|
+
|
|
1257
|
+
# Our class can be compared for equality to other classes
|
|
1258
|
+
self.assertEqual(our == 1, False)
|
|
1259
|
+
self.assertEqual(1 == our, False)
|
|
1260
|
+
self.assertEqual(our != 1, True)
|
|
1261
|
+
self.assertEqual(1 != our, True)
|
|
1262
|
+
|
|
1263
|
+
# But the ordering is undefined
|
|
1264
|
+
self.assertRaises(TypeError, lambda: our < 1)
|
|
1265
|
+
self.assertRaises(TypeError, lambda: 1 < our)
|
|
1266
|
+
|
|
1267
|
+
# Repeat those tests with a different class
|
|
1268
|
+
|
|
1269
|
+
class SomeClass:
|
|
1270
|
+
pass
|
|
1271
|
+
|
|
1272
|
+
their = SomeClass()
|
|
1273
|
+
self.assertEqual(our == their, False)
|
|
1274
|
+
self.assertEqual(their == our, False)
|
|
1275
|
+
self.assertEqual(our != their, True)
|
|
1276
|
+
self.assertEqual(their != our, True)
|
|
1277
|
+
self.assertRaises(TypeError, lambda: our < their)
|
|
1278
|
+
self.assertRaises(TypeError, lambda: their < our)
|
|
1279
|
+
|
|
1280
|
+
# However, if the other class explicitly defines ordering
|
|
1281
|
+
# relative to our class, it is allowed to do so
|
|
1282
|
+
|
|
1283
|
+
class LargerThanAnything:
|
|
1284
|
+
def __lt__(self, other):
|
|
1285
|
+
return False
|
|
1286
|
+
def __le__(self, other):
|
|
1287
|
+
return isinstance(other, LargerThanAnything)
|
|
1288
|
+
def __eq__(self, other):
|
|
1289
|
+
return isinstance(other, LargerThanAnything)
|
|
1290
|
+
def __ne__(self, other):
|
|
1291
|
+
return not isinstance(other, LargerThanAnything)
|
|
1292
|
+
def __gt__(self, other):
|
|
1293
|
+
return not isinstance(other, LargerThanAnything)
|
|
1294
|
+
def __ge__(self, other):
|
|
1295
|
+
return True
|
|
1296
|
+
|
|
1297
|
+
their = LargerThanAnything()
|
|
1298
|
+
self.assertEqual(our == their, False)
|
|
1299
|
+
self.assertEqual(their == our, False)
|
|
1300
|
+
self.assertEqual(our != their, True)
|
|
1301
|
+
self.assertEqual(their != our, True)
|
|
1302
|
+
self.assertEqual(our < their, True)
|
|
1303
|
+
self.assertEqual(their < our, False)
|
|
1304
|
+
|
|
1305
|
+
def test_bool(self):
|
|
1306
|
+
# All dates are considered true.
|
|
1307
|
+
self.assertTrue(self.theclass.min)
|
|
1308
|
+
self.assertTrue(self.theclass.max)
|
|
1309
|
+
|
|
1310
|
+
def test_strftime_y2k(self):
|
|
1311
|
+
for y in (1, 49, 70, 99, 100, 999, 1000, 1970):
|
|
1312
|
+
d = self.theclass(y, 1, 1)
|
|
1313
|
+
# Issue 13305: For years < 1000, the value is not always
|
|
1314
|
+
# padded to 4 digits across platforms. The C standard
|
|
1315
|
+
# assumes year >= 1900, so it does not specify the number
|
|
1316
|
+
# of digits.
|
|
1317
|
+
if d.strftime("%Y") != '%04d' % y:
|
|
1318
|
+
# Year 42 returns '42', not padded
|
|
1319
|
+
self.assertEqual(d.strftime("%Y"), '%d' % y)
|
|
1320
|
+
# '0042' is obtained anyway
|
|
1321
|
+
self.assertEqual(d.strftime("%4Y"), '%04d' % y)
|
|
1322
|
+
|
|
1323
|
+
def test_replace(self):
|
|
1324
|
+
cls = self.theclass
|
|
1325
|
+
args = [1, 2, 3]
|
|
1326
|
+
base = cls(*args)
|
|
1327
|
+
self.assertEqual(base, base.replace())
|
|
1328
|
+
|
|
1329
|
+
i = 0
|
|
1330
|
+
for name, newval in (("year", 2),
|
|
1331
|
+
("month", 3),
|
|
1332
|
+
("day", 4)):
|
|
1333
|
+
newargs = args[:]
|
|
1334
|
+
newargs[i] = newval
|
|
1335
|
+
expected = cls(*newargs)
|
|
1336
|
+
got = base.replace(**{name: newval})
|
|
1337
|
+
self.assertEqual(expected, got)
|
|
1338
|
+
i += 1
|
|
1339
|
+
|
|
1340
|
+
# Out of bounds.
|
|
1341
|
+
base = cls(2000, 2, 29)
|
|
1342
|
+
self.assertRaises(ValueError, base.replace, year=2001)
|
|
1343
|
+
|
|
1344
|
+
def test_subclass_date(self):
|
|
1345
|
+
|
|
1346
|
+
class C(self.theclass):
|
|
1347
|
+
theAnswer = 42
|
|
1348
|
+
|
|
1349
|
+
def __new__(cls, *args, **kws):
|
|
1350
|
+
temp = kws.copy()
|
|
1351
|
+
extra = temp.pop('extra')
|
|
1352
|
+
result = self.theclass.__new__(cls, *args, **temp)
|
|
1353
|
+
result.extra = extra
|
|
1354
|
+
return result
|
|
1355
|
+
|
|
1356
|
+
def newmeth(self, start):
|
|
1357
|
+
return start + self.year + self.month
|
|
1358
|
+
|
|
1359
|
+
args = 2003, 4, 14
|
|
1360
|
+
|
|
1361
|
+
dt1 = self.theclass(*args)
|
|
1362
|
+
dt2 = C(*args, **{'extra': 7})
|
|
1363
|
+
|
|
1364
|
+
self.assertEqual(dt2.__class__, C)
|
|
1365
|
+
self.assertEqual(dt2.theAnswer, 42)
|
|
1366
|
+
self.assertEqual(dt2.extra, 7)
|
|
1367
|
+
self.assertEqual(dt1.toordinal(), dt2.toordinal())
|
|
1368
|
+
self.assertEqual(dt2.newmeth(-7), dt1.year + dt1.month - 7)
|
|
1369
|
+
|
|
1370
|
+
def test_pickling_subclass_date(self):
|
|
1371
|
+
|
|
1372
|
+
args = 6, 7, 23
|
|
1373
|
+
orig = SubclassDate(*args)
|
|
1374
|
+
for pickler, unpickler, proto in pickle_choices:
|
|
1375
|
+
green = pickler.dumps(orig, proto)
|
|
1376
|
+
derived = unpickler.loads(green)
|
|
1377
|
+
self.assertEqual(orig, derived)
|
|
1378
|
+
|
|
1379
|
+
def test_backdoor_resistance(self):
|
|
1380
|
+
# For fast unpickling, the constructor accepts a pickle byte string.
|
|
1381
|
+
# This is a low-overhead backdoor. A user can (by intent or
|
|
1382
|
+
# mistake) pass a string directly, which (if it's the right length)
|
|
1383
|
+
# will get treated like a pickle, and bypass the normal sanity
|
|
1384
|
+
# checks in the constructor. This can create insane objects.
|
|
1385
|
+
# The constructor doesn't want to burn the time to validate all
|
|
1386
|
+
# fields, but does check the month field. This stops, e.g.,
|
|
1387
|
+
# datetime.datetime('1995-03-25') from yielding an insane object.
|
|
1388
|
+
base = b'1995-03-25'
|
|
1389
|
+
if not issubclass(self.theclass, datetime):
|
|
1390
|
+
base = base[:4]
|
|
1391
|
+
for month_byte in b'9', b'\0', b'\r', b'\xff':
|
|
1392
|
+
self.assertRaises(TypeError, self.theclass,
|
|
1393
|
+
base[:2] + month_byte + base[3:])
|
|
1394
|
+
# Good bytes, but bad tzinfo:
|
|
1395
|
+
self.assertRaises(TypeError, self.theclass,
|
|
1396
|
+
bytes([1] * len(base)), 'EST')
|
|
1397
|
+
|
|
1398
|
+
for ord_byte in range(1, 13):
|
|
1399
|
+
# This shouldn't blow up because of the month byte alone. If
|
|
1400
|
+
# the implementation changes to do more-careful checking, it may
|
|
1401
|
+
# blow up because other fields are insane.
|
|
1402
|
+
self.theclass(base[:2] + bytes([ord_byte]) + base[3:])
|
|
1403
|
+
|
|
1404
|
+
#############################################################################
|
|
1405
|
+
# datetime tests
|
|
1406
|
+
|
|
1407
|
+
class SubclassDatetime(datetime):
|
|
1408
|
+
sub_var = 1
|
|
1409
|
+
|
|
1410
|
+
class TestDateTime(TestDate):
|
|
1411
|
+
|
|
1412
|
+
theclass = datetime
|
|
1413
|
+
|
|
1414
|
+
def test_basic_attributes(self):
|
|
1415
|
+
dt = self.theclass(2002, 3, 1, 12, 0)
|
|
1416
|
+
self.assertEqual(dt.year, 2002)
|
|
1417
|
+
self.assertEqual(dt.month, 3)
|
|
1418
|
+
self.assertEqual(dt.day, 1)
|
|
1419
|
+
self.assertEqual(dt.hour, 12)
|
|
1420
|
+
self.assertEqual(dt.minute, 0)
|
|
1421
|
+
self.assertEqual(dt.second, 0)
|
|
1422
|
+
self.assertEqual(dt.microsecond, 0)
|
|
1423
|
+
|
|
1424
|
+
def test_basic_attributes_nonzero(self):
|
|
1425
|
+
# Make sure all attributes are non-zero so bugs in
|
|
1426
|
+
# bit-shifting access show up.
|
|
1427
|
+
dt = self.theclass(2002, 3, 1, 12, 59, 59, 8000)
|
|
1428
|
+
self.assertEqual(dt.year, 2002)
|
|
1429
|
+
self.assertEqual(dt.month, 3)
|
|
1430
|
+
self.assertEqual(dt.day, 1)
|
|
1431
|
+
self.assertEqual(dt.hour, 12)
|
|
1432
|
+
self.assertEqual(dt.minute, 59)
|
|
1433
|
+
self.assertEqual(dt.second, 59)
|
|
1434
|
+
self.assertEqual(dt.microsecond, 8000)
|
|
1435
|
+
|
|
1436
|
+
def test_roundtrip(self):
|
|
1437
|
+
for dt in (self.theclass(1, 2, 3, 4, 5, 6, 7),
|
|
1438
|
+
self.theclass.now()):
|
|
1439
|
+
# Verify dt -> string -> datetime identity.
|
|
1440
|
+
s = repr(dt)
|
|
1441
|
+
self.assertTrue(s.startswith('datetime.'))
|
|
1442
|
+
s = s[9:]
|
|
1443
|
+
dt2 = eval(s)
|
|
1444
|
+
self.assertEqual(dt, dt2)
|
|
1445
|
+
|
|
1446
|
+
# Verify identity via reconstructing from pieces.
|
|
1447
|
+
dt2 = self.theclass(dt.year, dt.month, dt.day,
|
|
1448
|
+
dt.hour, dt.minute, dt.second,
|
|
1449
|
+
dt.microsecond)
|
|
1450
|
+
self.assertEqual(dt, dt2)
|
|
1451
|
+
|
|
1452
|
+
def test_isoformat(self):
|
|
1453
|
+
t = self.theclass(2, 3, 2, 4, 5, 1, 123)
|
|
1454
|
+
self.assertEqual(t.isoformat(), "0002-03-02T04:05:01.000123")
|
|
1455
|
+
self.assertEqual(t.isoformat('T'), "0002-03-02T04:05:01.000123")
|
|
1456
|
+
self.assertEqual(t.isoformat(' '), "0002-03-02 04:05:01.000123")
|
|
1457
|
+
self.assertEqual(t.isoformat('\x00'), "0002-03-02\x0004:05:01.000123")
|
|
1458
|
+
# str is ISO format with the separator forced to a blank.
|
|
1459
|
+
self.assertEqual(str(t), "0002-03-02 04:05:01.000123")
|
|
1460
|
+
|
|
1461
|
+
t = self.theclass(2, 3, 2)
|
|
1462
|
+
self.assertEqual(t.isoformat(), "0002-03-02T00:00:00")
|
|
1463
|
+
self.assertEqual(t.isoformat('T'), "0002-03-02T00:00:00")
|
|
1464
|
+
self.assertEqual(t.isoformat(' '), "0002-03-02 00:00:00")
|
|
1465
|
+
# str is ISO format with the separator forced to a blank.
|
|
1466
|
+
self.assertEqual(str(t), "0002-03-02 00:00:00")
|
|
1467
|
+
|
|
1468
|
+
def test_format(self):
|
|
1469
|
+
dt = self.theclass(2007, 9, 10, 4, 5, 1, 123)
|
|
1470
|
+
self.assertEqual(dt.__format__(''), str(dt))
|
|
1471
|
+
|
|
1472
|
+
# check that a derived class's __str__() gets called
|
|
1473
|
+
class A(self.theclass):
|
|
1474
|
+
def __str__(self):
|
|
1475
|
+
return 'A'
|
|
1476
|
+
a = A(2007, 9, 10, 4, 5, 1, 123)
|
|
1477
|
+
self.assertEqual(a.__format__(''), 'A')
|
|
1478
|
+
|
|
1479
|
+
# check that a derived class's strftime gets called
|
|
1480
|
+
class B(self.theclass):
|
|
1481
|
+
def strftime(self, format_spec):
|
|
1482
|
+
return 'B'
|
|
1483
|
+
b = B(2007, 9, 10, 4, 5, 1, 123)
|
|
1484
|
+
self.assertEqual(b.__format__(''), str(dt))
|
|
1485
|
+
|
|
1486
|
+
for fmt in ["m:%m d:%d y:%y",
|
|
1487
|
+
"m:%m d:%d y:%y H:%H M:%M S:%S",
|
|
1488
|
+
"%z %Z",
|
|
1489
|
+
]:
|
|
1490
|
+
self.assertEqual(dt.__format__(fmt), dt.strftime(fmt))
|
|
1491
|
+
self.assertEqual(a.__format__(fmt), dt.strftime(fmt))
|
|
1492
|
+
self.assertEqual(b.__format__(fmt), 'B')
|
|
1493
|
+
|
|
1494
|
+
def test_more_ctime(self):
|
|
1495
|
+
# Test fields that TestDate doesn't touch.
|
|
1496
|
+
import time
|
|
1497
|
+
|
|
1498
|
+
t = self.theclass(2002, 3, 2, 18, 3, 5, 123)
|
|
1499
|
+
self.assertEqual(t.ctime(), "Sat Mar 2 18:03:05 2002")
|
|
1500
|
+
# Oops! The next line fails on Win2K under MSVC 6, so it's commented
|
|
1501
|
+
# out. The difference is that t.ctime() produces " 2" for the day,
|
|
1502
|
+
# but platform ctime() produces "02" for the day. According to
|
|
1503
|
+
# C99, t.ctime() is correct here.
|
|
1504
|
+
# self.assertEqual(t.ctime(), time.ctime(time.mktime(t.timetuple())))
|
|
1505
|
+
|
|
1506
|
+
# So test a case where that difference doesn't matter.
|
|
1507
|
+
t = self.theclass(2002, 3, 22, 18, 3, 5, 123)
|
|
1508
|
+
self.assertEqual(t.ctime(), time.ctime(time.mktime(t.timetuple())))
|
|
1509
|
+
|
|
1510
|
+
def test_tz_independent_comparing(self):
|
|
1511
|
+
dt1 = self.theclass(2002, 3, 1, 9, 0, 0)
|
|
1512
|
+
dt2 = self.theclass(2002, 3, 1, 10, 0, 0)
|
|
1513
|
+
dt3 = self.theclass(2002, 3, 1, 9, 0, 0)
|
|
1514
|
+
self.assertEqual(dt1, dt3)
|
|
1515
|
+
self.assertTrue(dt2 > dt3)
|
|
1516
|
+
|
|
1517
|
+
# Make sure comparison doesn't forget microseconds, and isn't done
|
|
1518
|
+
# via comparing a float timestamp (an IEEE double doesn't have enough
|
|
1519
|
+
# precision to span microsecond resolution across years 1 thru 9999,
|
|
1520
|
+
# so comparing via timestamp necessarily calls some distinct values
|
|
1521
|
+
# equal).
|
|
1522
|
+
dt1 = self.theclass(MAXYEAR, 12, 31, 23, 59, 59, 999998)
|
|
1523
|
+
us = timedelta(microseconds=1)
|
|
1524
|
+
dt2 = dt1 + us
|
|
1525
|
+
self.assertEqual(dt2 - dt1, us)
|
|
1526
|
+
self.assertTrue(dt1 < dt2)
|
|
1527
|
+
|
|
1528
|
+
def test_strftime_with_bad_tzname_replace(self):
|
|
1529
|
+
# verify ok if tzinfo.tzname().replace() returns a non-string
|
|
1530
|
+
class MyTzInfo(FixedOffset):
|
|
1531
|
+
def tzname(self, dt):
|
|
1532
|
+
class MyStr(str):
|
|
1533
|
+
def replace(self, *args):
|
|
1534
|
+
return None
|
|
1535
|
+
return MyStr('name')
|
|
1536
|
+
t = self.theclass(2005, 3, 2, 0, 0, 0, 0, MyTzInfo(3, 'name'))
|
|
1537
|
+
self.assertRaises(TypeError, t.strftime, '%Z')
|
|
1538
|
+
|
|
1539
|
+
def test_bad_constructor_arguments(self):
|
|
1540
|
+
# bad years
|
|
1541
|
+
self.theclass(MINYEAR, 1, 1) # no exception
|
|
1542
|
+
self.theclass(MAXYEAR, 1, 1) # no exception
|
|
1543
|
+
self.assertRaises(ValueError, self.theclass, MINYEAR-1, 1, 1)
|
|
1544
|
+
self.assertRaises(ValueError, self.theclass, MAXYEAR+1, 1, 1)
|
|
1545
|
+
# bad months
|
|
1546
|
+
self.theclass(2000, 1, 1) # no exception
|
|
1547
|
+
self.theclass(2000, 12, 1) # no exception
|
|
1548
|
+
self.assertRaises(ValueError, self.theclass, 2000, 0, 1)
|
|
1549
|
+
self.assertRaises(ValueError, self.theclass, 2000, 13, 1)
|
|
1550
|
+
# bad days
|
|
1551
|
+
self.theclass(2000, 2, 29) # no exception
|
|
1552
|
+
self.theclass(2004, 2, 29) # no exception
|
|
1553
|
+
self.theclass(2400, 2, 29) # no exception
|
|
1554
|
+
self.assertRaises(ValueError, self.theclass, 2000, 2, 30)
|
|
1555
|
+
self.assertRaises(ValueError, self.theclass, 2001, 2, 29)
|
|
1556
|
+
self.assertRaises(ValueError, self.theclass, 2100, 2, 29)
|
|
1557
|
+
self.assertRaises(ValueError, self.theclass, 1900, 2, 29)
|
|
1558
|
+
self.assertRaises(ValueError, self.theclass, 2000, 1, 0)
|
|
1559
|
+
self.assertRaises(ValueError, self.theclass, 2000, 1, 32)
|
|
1560
|
+
# bad hours
|
|
1561
|
+
self.theclass(2000, 1, 31, 0) # no exception
|
|
1562
|
+
self.theclass(2000, 1, 31, 23) # no exception
|
|
1563
|
+
self.assertRaises(ValueError, self.theclass, 2000, 1, 31, -1)
|
|
1564
|
+
self.assertRaises(ValueError, self.theclass, 2000, 1, 31, 24)
|
|
1565
|
+
# bad minutes
|
|
1566
|
+
self.theclass(2000, 1, 31, 23, 0) # no exception
|
|
1567
|
+
self.theclass(2000, 1, 31, 23, 59) # no exception
|
|
1568
|
+
self.assertRaises(ValueError, self.theclass, 2000, 1, 31, 23, -1)
|
|
1569
|
+
self.assertRaises(ValueError, self.theclass, 2000, 1, 31, 23, 60)
|
|
1570
|
+
# bad seconds
|
|
1571
|
+
self.theclass(2000, 1, 31, 23, 59, 0) # no exception
|
|
1572
|
+
self.theclass(2000, 1, 31, 23, 59, 59) # no exception
|
|
1573
|
+
self.assertRaises(ValueError, self.theclass, 2000, 1, 31, 23, 59, -1)
|
|
1574
|
+
self.assertRaises(ValueError, self.theclass, 2000, 1, 31, 23, 59, 60)
|
|
1575
|
+
# bad microseconds
|
|
1576
|
+
self.theclass(2000, 1, 31, 23, 59, 59, 0) # no exception
|
|
1577
|
+
self.theclass(2000, 1, 31, 23, 59, 59, 999999) # no exception
|
|
1578
|
+
self.assertRaises(ValueError, self.theclass,
|
|
1579
|
+
2000, 1, 31, 23, 59, 59, -1)
|
|
1580
|
+
self.assertRaises(ValueError, self.theclass,
|
|
1581
|
+
2000, 1, 31, 23, 59, 59,
|
|
1582
|
+
1000000)
|
|
1583
|
+
|
|
1584
|
+
def test_hash_equality(self):
|
|
1585
|
+
d = self.theclass(2000, 12, 31, 23, 30, 17)
|
|
1586
|
+
e = self.theclass(2000, 12, 31, 23, 30, 17)
|
|
1587
|
+
self.assertEqual(d, e)
|
|
1588
|
+
self.assertEqual(hash(d), hash(e))
|
|
1589
|
+
|
|
1590
|
+
dic = {d: 1}
|
|
1591
|
+
dic[e] = 2
|
|
1592
|
+
self.assertEqual(len(dic), 1)
|
|
1593
|
+
self.assertEqual(dic[d], 2)
|
|
1594
|
+
self.assertEqual(dic[e], 2)
|
|
1595
|
+
|
|
1596
|
+
d = self.theclass(2001, 1, 1, 0, 5, 17)
|
|
1597
|
+
e = self.theclass(2001, 1, 1, 0, 5, 17)
|
|
1598
|
+
self.assertEqual(d, e)
|
|
1599
|
+
self.assertEqual(hash(d), hash(e))
|
|
1600
|
+
|
|
1601
|
+
dic = {d: 1}
|
|
1602
|
+
dic[e] = 2
|
|
1603
|
+
self.assertEqual(len(dic), 1)
|
|
1604
|
+
self.assertEqual(dic[d], 2)
|
|
1605
|
+
self.assertEqual(dic[e], 2)
|
|
1606
|
+
|
|
1607
|
+
def test_computations(self):
|
|
1608
|
+
a = self.theclass(2002, 1, 31)
|
|
1609
|
+
b = self.theclass(1956, 1, 31)
|
|
1610
|
+
diff = a-b
|
|
1611
|
+
self.assertEqual(diff.days, 46*365 + len(range(1956, 2002, 4)))
|
|
1612
|
+
self.assertEqual(diff.seconds, 0)
|
|
1613
|
+
self.assertEqual(diff.microseconds, 0)
|
|
1614
|
+
a = self.theclass(2002, 3, 2, 17, 6)
|
|
1615
|
+
millisec = timedelta(0, 0, 1000)
|
|
1616
|
+
hour = timedelta(0, 3600)
|
|
1617
|
+
day = timedelta(1)
|
|
1618
|
+
week = timedelta(7)
|
|
1619
|
+
self.assertEqual(a + hour, self.theclass(2002, 3, 2, 18, 6))
|
|
1620
|
+
self.assertEqual(hour + a, self.theclass(2002, 3, 2, 18, 6))
|
|
1621
|
+
self.assertEqual(a + 10*hour, self.theclass(2002, 3, 3, 3, 6))
|
|
1622
|
+
self.assertEqual(a - hour, self.theclass(2002, 3, 2, 16, 6))
|
|
1623
|
+
self.assertEqual(-hour + a, self.theclass(2002, 3, 2, 16, 6))
|
|
1624
|
+
self.assertEqual(a - hour, a + -hour)
|
|
1625
|
+
self.assertEqual(a - 20*hour, self.theclass(2002, 3, 1, 21, 6))
|
|
1626
|
+
self.assertEqual(a + day, self.theclass(2002, 3, 3, 17, 6))
|
|
1627
|
+
self.assertEqual(a - day, self.theclass(2002, 3, 1, 17, 6))
|
|
1628
|
+
self.assertEqual(a + week, self.theclass(2002, 3, 9, 17, 6))
|
|
1629
|
+
self.assertEqual(a - week, self.theclass(2002, 2, 23, 17, 6))
|
|
1630
|
+
self.assertEqual(a + 52*week, self.theclass(2003, 3, 1, 17, 6))
|
|
1631
|
+
self.assertEqual(a - 52*week, self.theclass(2001, 3, 3, 17, 6))
|
|
1632
|
+
self.assertEqual((a + week) - a, week)
|
|
1633
|
+
self.assertEqual((a + day) - a, day)
|
|
1634
|
+
self.assertEqual((a + hour) - a, hour)
|
|
1635
|
+
self.assertEqual((a + millisec) - a, millisec)
|
|
1636
|
+
self.assertEqual((a - week) - a, -week)
|
|
1637
|
+
self.assertEqual((a - day) - a, -day)
|
|
1638
|
+
self.assertEqual((a - hour) - a, -hour)
|
|
1639
|
+
self.assertEqual((a - millisec) - a, -millisec)
|
|
1640
|
+
self.assertEqual(a - (a + week), -week)
|
|
1641
|
+
self.assertEqual(a - (a + day), -day)
|
|
1642
|
+
self.assertEqual(a - (a + hour), -hour)
|
|
1643
|
+
self.assertEqual(a - (a + millisec), -millisec)
|
|
1644
|
+
self.assertEqual(a - (a - week), week)
|
|
1645
|
+
self.assertEqual(a - (a - day), day)
|
|
1646
|
+
self.assertEqual(a - (a - hour), hour)
|
|
1647
|
+
self.assertEqual(a - (a - millisec), millisec)
|
|
1648
|
+
self.assertEqual(a + (week + day + hour + millisec),
|
|
1649
|
+
self.theclass(2002, 3, 10, 18, 6, 0, 1000))
|
|
1650
|
+
self.assertEqual(a + (week + day + hour + millisec),
|
|
1651
|
+
(((a + week) + day) + hour) + millisec)
|
|
1652
|
+
self.assertEqual(a - (week + day + hour + millisec),
|
|
1653
|
+
self.theclass(2002, 2, 22, 16, 5, 59, 999000))
|
|
1654
|
+
self.assertEqual(a - (week + day + hour + millisec),
|
|
1655
|
+
(((a - week) - day) - hour) - millisec)
|
|
1656
|
+
# Add/sub ints or floats should be illegal
|
|
1657
|
+
for i in 1, 1.0:
|
|
1658
|
+
self.assertRaises(TypeError, lambda: a+i)
|
|
1659
|
+
self.assertRaises(TypeError, lambda: a-i)
|
|
1660
|
+
self.assertRaises(TypeError, lambda: i+a)
|
|
1661
|
+
self.assertRaises(TypeError, lambda: i-a)
|
|
1662
|
+
|
|
1663
|
+
# delta - datetime is senseless.
|
|
1664
|
+
self.assertRaises(TypeError, lambda: day - a)
|
|
1665
|
+
# mixing datetime and (delta or datetime) via * or // is senseless
|
|
1666
|
+
self.assertRaises(TypeError, lambda: day * a)
|
|
1667
|
+
self.assertRaises(TypeError, lambda: a * day)
|
|
1668
|
+
self.assertRaises(TypeError, lambda: day // a)
|
|
1669
|
+
self.assertRaises(TypeError, lambda: a // day)
|
|
1670
|
+
self.assertRaises(TypeError, lambda: a * a)
|
|
1671
|
+
self.assertRaises(TypeError, lambda: a // a)
|
|
1672
|
+
# datetime + datetime is senseless
|
|
1673
|
+
self.assertRaises(TypeError, lambda: a + a)
|
|
1674
|
+
|
|
1675
|
+
def test_pickling(self):
|
|
1676
|
+
args = 6, 7, 23, 20, 59, 1, 64**2
|
|
1677
|
+
orig = self.theclass(*args)
|
|
1678
|
+
for pickler, unpickler, proto in pickle_choices:
|
|
1679
|
+
green = pickler.dumps(orig, proto)
|
|
1680
|
+
derived = unpickler.loads(green)
|
|
1681
|
+
self.assertEqual(orig, derived)
|
|
1682
|
+
|
|
1683
|
+
def test_more_pickling(self):
|
|
1684
|
+
a = self.theclass(2003, 2, 7, 16, 48, 37, 444116)
|
|
1685
|
+
s = pickle.dumps(a)
|
|
1686
|
+
b = pickle.loads(s)
|
|
1687
|
+
self.assertEqual(b.year, 2003)
|
|
1688
|
+
self.assertEqual(b.month, 2)
|
|
1689
|
+
self.assertEqual(b.day, 7)
|
|
1690
|
+
|
|
1691
|
+
def test_pickling_subclass_datetime(self):
|
|
1692
|
+
args = 6, 7, 23, 20, 59, 1, 64**2
|
|
1693
|
+
orig = SubclassDatetime(*args)
|
|
1694
|
+
for pickler, unpickler, proto in pickle_choices:
|
|
1695
|
+
green = pickler.dumps(orig, proto)
|
|
1696
|
+
derived = unpickler.loads(green)
|
|
1697
|
+
self.assertEqual(orig, derived)
|
|
1698
|
+
|
|
1699
|
+
def test_more_compare(self):
|
|
1700
|
+
# The test_compare() inherited from TestDate covers the error cases.
|
|
1701
|
+
# We just want to test lexicographic ordering on the members datetime
|
|
1702
|
+
# has that date lacks.
|
|
1703
|
+
args = [2000, 11, 29, 20, 58, 16, 999998]
|
|
1704
|
+
t1 = self.theclass(*args)
|
|
1705
|
+
t2 = self.theclass(*args)
|
|
1706
|
+
self.assertEqual(t1, t2)
|
|
1707
|
+
self.assertTrue(t1 <= t2)
|
|
1708
|
+
self.assertTrue(t1 >= t2)
|
|
1709
|
+
self.assertFalse(t1 != t2)
|
|
1710
|
+
self.assertFalse(t1 < t2)
|
|
1711
|
+
self.assertFalse(t1 > t2)
|
|
1712
|
+
|
|
1713
|
+
for i in range(len(args)):
|
|
1714
|
+
newargs = args[:]
|
|
1715
|
+
newargs[i] = args[i] + 1
|
|
1716
|
+
t2 = self.theclass(*newargs) # this is larger than t1
|
|
1717
|
+
self.assertTrue(t1 < t2)
|
|
1718
|
+
self.assertTrue(t2 > t1)
|
|
1719
|
+
self.assertTrue(t1 <= t2)
|
|
1720
|
+
self.assertTrue(t2 >= t1)
|
|
1721
|
+
self.assertTrue(t1 != t2)
|
|
1722
|
+
self.assertTrue(t2 != t1)
|
|
1723
|
+
self.assertFalse(t1 == t2)
|
|
1724
|
+
self.assertFalse(t2 == t1)
|
|
1725
|
+
self.assertFalse(t1 > t2)
|
|
1726
|
+
self.assertFalse(t2 < t1)
|
|
1727
|
+
self.assertFalse(t1 >= t2)
|
|
1728
|
+
self.assertFalse(t2 <= t1)
|
|
1729
|
+
|
|
1730
|
+
|
|
1731
|
+
# A helper for timestamp constructor tests.
|
|
1732
|
+
def verify_field_equality(self, expected, got):
|
|
1733
|
+
self.assertEqual(expected.tm_year, got.year)
|
|
1734
|
+
self.assertEqual(expected.tm_mon, got.month)
|
|
1735
|
+
self.assertEqual(expected.tm_mday, got.day)
|
|
1736
|
+
self.assertEqual(expected.tm_hour, got.hour)
|
|
1737
|
+
self.assertEqual(expected.tm_min, got.minute)
|
|
1738
|
+
self.assertEqual(expected.tm_sec, got.second)
|
|
1739
|
+
|
|
1740
|
+
def test_fromtimestamp(self):
|
|
1741
|
+
import time
|
|
1742
|
+
|
|
1743
|
+
ts = time.time()
|
|
1744
|
+
expected = time.localtime(ts)
|
|
1745
|
+
got = self.theclass.fromtimestamp(ts)
|
|
1746
|
+
self.verify_field_equality(expected, got)
|
|
1747
|
+
|
|
1748
|
+
def test_utcfromtimestamp(self):
|
|
1749
|
+
import time
|
|
1750
|
+
|
|
1751
|
+
ts = time.time()
|
|
1752
|
+
expected = time.gmtime(ts)
|
|
1753
|
+
got = self.theclass.utcfromtimestamp(ts)
|
|
1754
|
+
self.verify_field_equality(expected, got)
|
|
1755
|
+
|
|
1756
|
+
# Run with US-style DST rules: DST begins 2 a.m. on second Sunday in
|
|
1757
|
+
# March (M3.2.0) and ends 2 a.m. on first Sunday in November (M11.1.0).
|
|
1758
|
+
@support.run_with_tz('EST+05EDT,M3.2.0,M11.1.0')
|
|
1759
|
+
def test_timestamp_naive(self):
|
|
1760
|
+
t = self.theclass(1970, 1, 1)
|
|
1761
|
+
self.assertEqual(t.timestamp(), 18000.0)
|
|
1762
|
+
t = self.theclass(1970, 1, 1, 1, 2, 3, 4)
|
|
1763
|
+
self.assertEqual(t.timestamp(),
|
|
1764
|
+
18000.0 + 3600 + 2*60 + 3 + 4*1e-6)
|
|
1765
|
+
# Missing hour may produce platform-dependent result
|
|
1766
|
+
t = self.theclass(2012, 3, 11, 2, 30)
|
|
1767
|
+
self.assertIn(self.theclass.fromtimestamp(t.timestamp()),
|
|
1768
|
+
[t - timedelta(hours=1), t + timedelta(hours=1)])
|
|
1769
|
+
# Ambiguous hour defaults to DST
|
|
1770
|
+
t = self.theclass(2012, 11, 4, 1, 30)
|
|
1771
|
+
self.assertEqual(self.theclass.fromtimestamp(t.timestamp()), t)
|
|
1772
|
+
|
|
1773
|
+
# Timestamp may raise an overflow error on some platforms
|
|
1774
|
+
for t in [self.theclass(1,1,1), self.theclass(9999,12,12)]:
|
|
1775
|
+
try:
|
|
1776
|
+
s = t.timestamp()
|
|
1777
|
+
except OverflowError:
|
|
1778
|
+
pass
|
|
1779
|
+
else:
|
|
1780
|
+
self.assertEqual(self.theclass.fromtimestamp(s), t)
|
|
1781
|
+
|
|
1782
|
+
def test_timestamp_aware(self):
|
|
1783
|
+
t = self.theclass(1970, 1, 1, tzinfo=timezone.utc)
|
|
1784
|
+
self.assertEqual(t.timestamp(), 0.0)
|
|
1785
|
+
t = self.theclass(1970, 1, 1, 1, 2, 3, 4, tzinfo=timezone.utc)
|
|
1786
|
+
self.assertEqual(t.timestamp(),
|
|
1787
|
+
3600 + 2*60 + 3 + 4*1e-6)
|
|
1788
|
+
t = self.theclass(1970, 1, 1, 1, 2, 3, 4,
|
|
1789
|
+
tzinfo=timezone(timedelta(hours=-5), 'EST'))
|
|
1790
|
+
self.assertEqual(t.timestamp(),
|
|
1791
|
+
18000 + 3600 + 2*60 + 3 + 4*1e-6)
|
|
1792
|
+
def test_microsecond_rounding(self):
|
|
1793
|
+
for fts in [self.theclass.fromtimestamp,
|
|
1794
|
+
self.theclass.utcfromtimestamp]:
|
|
1795
|
+
zero = fts(0)
|
|
1796
|
+
self.assertEqual(zero.second, 0)
|
|
1797
|
+
self.assertEqual(zero.microsecond, 0)
|
|
1798
|
+
try:
|
|
1799
|
+
minus_one = fts(-1e-6)
|
|
1800
|
+
except OSError:
|
|
1801
|
+
# localtime(-1) and gmtime(-1) is not supported on Windows
|
|
1802
|
+
pass
|
|
1803
|
+
else:
|
|
1804
|
+
self.assertEqual(minus_one.second, 59)
|
|
1805
|
+
self.assertEqual(minus_one.microsecond, 999999)
|
|
1806
|
+
|
|
1807
|
+
t = fts(-1e-8)
|
|
1808
|
+
self.assertEqual(t, minus_one)
|
|
1809
|
+
t = fts(-9e-7)
|
|
1810
|
+
self.assertEqual(t, minus_one)
|
|
1811
|
+
t = fts(-1e-7)
|
|
1812
|
+
self.assertEqual(t, minus_one)
|
|
1813
|
+
|
|
1814
|
+
t = fts(1e-7)
|
|
1815
|
+
self.assertEqual(t, zero)
|
|
1816
|
+
t = fts(9e-7)
|
|
1817
|
+
self.assertEqual(t, zero)
|
|
1818
|
+
t = fts(0.99999949)
|
|
1819
|
+
self.assertEqual(t.second, 0)
|
|
1820
|
+
self.assertEqual(t.microsecond, 999999)
|
|
1821
|
+
t = fts(0.9999999)
|
|
1822
|
+
self.assertEqual(t.second, 0)
|
|
1823
|
+
self.assertEqual(t.microsecond, 999999)
|
|
1824
|
+
|
|
1825
|
+
def test_insane_fromtimestamp(self):
|
|
1826
|
+
# It's possible that some platform maps time_t to double,
|
|
1827
|
+
# and that this test will fail there. This test should
|
|
1828
|
+
# exempt such platforms (provided they return reasonable
|
|
1829
|
+
# results!).
|
|
1830
|
+
for insane in -1e200, 1e200:
|
|
1831
|
+
self.assertRaises(OverflowError, self.theclass.fromtimestamp,
|
|
1832
|
+
insane)
|
|
1833
|
+
|
|
1834
|
+
def test_insane_utcfromtimestamp(self):
|
|
1835
|
+
# It's possible that some platform maps time_t to double,
|
|
1836
|
+
# and that this test will fail there. This test should
|
|
1837
|
+
# exempt such platforms (provided they return reasonable
|
|
1838
|
+
# results!).
|
|
1839
|
+
for insane in -1e200, 1e200:
|
|
1840
|
+
self.assertRaises(OverflowError, self.theclass.utcfromtimestamp,
|
|
1841
|
+
insane)
|
|
1842
|
+
@unittest.skipIf(sys.platform == "win32", "Windows doesn't accept negative timestamps")
|
|
1843
|
+
def test_negative_float_fromtimestamp(self):
|
|
1844
|
+
# The result is tz-dependent; at least test that this doesn't
|
|
1845
|
+
# fail (like it did before bug 1646728 was fixed).
|
|
1846
|
+
self.theclass.fromtimestamp(-1.05)
|
|
1847
|
+
|
|
1848
|
+
@unittest.skipIf(sys.platform == "win32", "Windows doesn't accept negative timestamps")
|
|
1849
|
+
def test_negative_float_utcfromtimestamp(self):
|
|
1850
|
+
d = self.theclass.utcfromtimestamp(-1.05)
|
|
1851
|
+
self.assertEqual(d, self.theclass(1969, 12, 31, 23, 59, 58, 950000))
|
|
1852
|
+
|
|
1853
|
+
def test_utcnow(self):
|
|
1854
|
+
import time
|
|
1855
|
+
|
|
1856
|
+
# Call it a success if utcnow() and utcfromtimestamp() are within
|
|
1857
|
+
# a second of each other.
|
|
1858
|
+
tolerance = timedelta(seconds=1)
|
|
1859
|
+
for dummy in range(3):
|
|
1860
|
+
from_now = self.theclass.utcnow()
|
|
1861
|
+
from_timestamp = self.theclass.utcfromtimestamp(time.time())
|
|
1862
|
+
if abs(from_timestamp - from_now) <= tolerance:
|
|
1863
|
+
break
|
|
1864
|
+
# Else try again a few times.
|
|
1865
|
+
self.assertLessEqual(abs(from_timestamp - from_now), tolerance)
|
|
1866
|
+
|
|
1867
|
+
def test_strptime(self):
|
|
1868
|
+
string = '2004-12-01 13:02:47.197'
|
|
1869
|
+
format = '%Y-%m-%d %H:%M:%S.%f'
|
|
1870
|
+
expected = _strptime._strptime_datetime(self.theclass, string, format)
|
|
1871
|
+
got = self.theclass.strptime(string, format)
|
|
1872
|
+
self.assertEqual(expected, got)
|
|
1873
|
+
self.assertIs(type(expected), self.theclass)
|
|
1874
|
+
self.assertIs(type(got), self.theclass)
|
|
1875
|
+
|
|
1876
|
+
strptime = self.theclass.strptime
|
|
1877
|
+
self.assertEqual(strptime("+0002", "%z").utcoffset(), 2 * MINUTE)
|
|
1878
|
+
self.assertEqual(strptime("-0002", "%z").utcoffset(), -2 * MINUTE)
|
|
1879
|
+
# Only local timezone and UTC are supported
|
|
1880
|
+
for tzseconds, tzname in ((0, 'UTC'), (0, 'GMT'),
|
|
1881
|
+
(-_time.timezone, _time.tzname[0])):
|
|
1882
|
+
if tzseconds < 0:
|
|
1883
|
+
sign = '-'
|
|
1884
|
+
seconds = -tzseconds
|
|
1885
|
+
else:
|
|
1886
|
+
sign ='+'
|
|
1887
|
+
seconds = tzseconds
|
|
1888
|
+
hours, minutes = divmod(seconds//60, 60)
|
|
1889
|
+
dtstr = "{}{:02d}{:02d} {}".format(sign, hours, minutes, tzname)
|
|
1890
|
+
dt = strptime(dtstr, "%z %Z")
|
|
1891
|
+
self.assertEqual(dt.utcoffset(), timedelta(seconds=tzseconds))
|
|
1892
|
+
self.assertEqual(dt.tzname(), tzname)
|
|
1893
|
+
# Can produce inconsistent datetime
|
|
1894
|
+
dtstr, fmt = "+1234 UTC", "%z %Z"
|
|
1895
|
+
dt = strptime(dtstr, fmt)
|
|
1896
|
+
self.assertEqual(dt.utcoffset(), 12 * HOUR + 34 * MINUTE)
|
|
1897
|
+
self.assertEqual(dt.tzname(), 'UTC')
|
|
1898
|
+
# yet will roundtrip
|
|
1899
|
+
self.assertEqual(dt.strftime(fmt), dtstr)
|
|
1900
|
+
|
|
1901
|
+
# Produce naive datetime if no %z is provided
|
|
1902
|
+
self.assertEqual(strptime("UTC", "%Z").tzinfo, None)
|
|
1903
|
+
|
|
1904
|
+
with self.assertRaises(ValueError): strptime("-2400", "%z")
|
|
1905
|
+
with self.assertRaises(ValueError): strptime("-000", "%z")
|
|
1906
|
+
|
|
1907
|
+
def test_more_timetuple(self):
|
|
1908
|
+
# This tests fields beyond those tested by the TestDate.test_timetuple.
|
|
1909
|
+
t = self.theclass(2004, 12, 31, 6, 22, 33)
|
|
1910
|
+
self.assertEqual(t.timetuple(), (2004, 12, 31, 6, 22, 33, 4, 366, -1))
|
|
1911
|
+
self.assertEqual(t.timetuple(),
|
|
1912
|
+
(t.year, t.month, t.day,
|
|
1913
|
+
t.hour, t.minute, t.second,
|
|
1914
|
+
t.weekday(),
|
|
1915
|
+
t.toordinal() - date(t.year, 1, 1).toordinal() + 1,
|
|
1916
|
+
-1))
|
|
1917
|
+
tt = t.timetuple()
|
|
1918
|
+
self.assertEqual(tt.tm_year, t.year)
|
|
1919
|
+
self.assertEqual(tt.tm_mon, t.month)
|
|
1920
|
+
self.assertEqual(tt.tm_mday, t.day)
|
|
1921
|
+
self.assertEqual(tt.tm_hour, t.hour)
|
|
1922
|
+
self.assertEqual(tt.tm_min, t.minute)
|
|
1923
|
+
self.assertEqual(tt.tm_sec, t.second)
|
|
1924
|
+
self.assertEqual(tt.tm_wday, t.weekday())
|
|
1925
|
+
self.assertEqual(tt.tm_yday, t.toordinal() -
|
|
1926
|
+
date(t.year, 1, 1).toordinal() + 1)
|
|
1927
|
+
self.assertEqual(tt.tm_isdst, -1)
|
|
1928
|
+
|
|
1929
|
+
def test_more_strftime(self):
|
|
1930
|
+
# This tests fields beyond those tested by the TestDate.test_strftime.
|
|
1931
|
+
t = self.theclass(2004, 12, 31, 6, 22, 33, 47)
|
|
1932
|
+
self.assertEqual(t.strftime("%m %d %y %f %S %M %H %j"),
|
|
1933
|
+
"12 31 04 000047 33 22 06 366")
|
|
1934
|
+
|
|
1935
|
+
def test_extract(self):
|
|
1936
|
+
dt = self.theclass(2002, 3, 4, 18, 45, 3, 1234)
|
|
1937
|
+
self.assertEqual(dt.date(), date(2002, 3, 4))
|
|
1938
|
+
self.assertEqual(dt.time(), time(18, 45, 3, 1234))
|
|
1939
|
+
|
|
1940
|
+
def test_combine(self):
|
|
1941
|
+
d = date(2002, 3, 4)
|
|
1942
|
+
t = time(18, 45, 3, 1234)
|
|
1943
|
+
expected = self.theclass(2002, 3, 4, 18, 45, 3, 1234)
|
|
1944
|
+
combine = self.theclass.combine
|
|
1945
|
+
dt = combine(d, t)
|
|
1946
|
+
self.assertEqual(dt, expected)
|
|
1947
|
+
|
|
1948
|
+
dt = combine(time=t, date=d)
|
|
1949
|
+
self.assertEqual(dt, expected)
|
|
1950
|
+
|
|
1951
|
+
self.assertEqual(d, dt.date())
|
|
1952
|
+
self.assertEqual(t, dt.time())
|
|
1953
|
+
self.assertEqual(dt, combine(dt.date(), dt.time()))
|
|
1954
|
+
|
|
1955
|
+
self.assertRaises(TypeError, combine) # need an arg
|
|
1956
|
+
self.assertRaises(TypeError, combine, d) # need two args
|
|
1957
|
+
self.assertRaises(TypeError, combine, t, d) # args reversed
|
|
1958
|
+
self.assertRaises(TypeError, combine, d, t, 1) # too many args
|
|
1959
|
+
self.assertRaises(TypeError, combine, "date", "time") # wrong types
|
|
1960
|
+
self.assertRaises(TypeError, combine, d, "time") # wrong type
|
|
1961
|
+
self.assertRaises(TypeError, combine, "date", t) # wrong type
|
|
1962
|
+
|
|
1963
|
+
def test_replace(self):
|
|
1964
|
+
cls = self.theclass
|
|
1965
|
+
args = [1, 2, 3, 4, 5, 6, 7]
|
|
1966
|
+
base = cls(*args)
|
|
1967
|
+
self.assertEqual(base, base.replace())
|
|
1968
|
+
|
|
1969
|
+
i = 0
|
|
1970
|
+
for name, newval in (("year", 2),
|
|
1971
|
+
("month", 3),
|
|
1972
|
+
("day", 4),
|
|
1973
|
+
("hour", 5),
|
|
1974
|
+
("minute", 6),
|
|
1975
|
+
("second", 7),
|
|
1976
|
+
("microsecond", 8)):
|
|
1977
|
+
newargs = args[:]
|
|
1978
|
+
newargs[i] = newval
|
|
1979
|
+
expected = cls(*newargs)
|
|
1980
|
+
got = base.replace(**{name: newval})
|
|
1981
|
+
self.assertEqual(expected, got)
|
|
1982
|
+
i += 1
|
|
1983
|
+
|
|
1984
|
+
# Out of bounds.
|
|
1985
|
+
base = cls(2000, 2, 29)
|
|
1986
|
+
self.assertRaises(ValueError, base.replace, year=2001)
|
|
1987
|
+
|
|
1988
|
+
def test_astimezone(self):
|
|
1989
|
+
# Pretty boring! The TZ test is more interesting here. astimezone()
|
|
1990
|
+
# simply can't be applied to a naive object.
|
|
1991
|
+
dt = self.theclass.now()
|
|
1992
|
+
f = FixedOffset(44, "")
|
|
1993
|
+
self.assertRaises(ValueError, dt.astimezone) # naive
|
|
1994
|
+
self.assertRaises(TypeError, dt.astimezone, f, f) # too many args
|
|
1995
|
+
self.assertRaises(TypeError, dt.astimezone, dt) # arg wrong type
|
|
1996
|
+
self.assertRaises(ValueError, dt.astimezone, f) # naive
|
|
1997
|
+
self.assertRaises(ValueError, dt.astimezone, tz=f) # naive
|
|
1998
|
+
|
|
1999
|
+
class Bogus(tzinfo):
|
|
2000
|
+
def utcoffset(self, dt): return None
|
|
2001
|
+
def dst(self, dt): return timedelta(0)
|
|
2002
|
+
bog = Bogus()
|
|
2003
|
+
self.assertRaises(ValueError, dt.astimezone, bog) # naive
|
|
2004
|
+
self.assertRaises(ValueError,
|
|
2005
|
+
dt.replace(tzinfo=bog).astimezone, f)
|
|
2006
|
+
|
|
2007
|
+
class AlsoBogus(tzinfo):
|
|
2008
|
+
def utcoffset(self, dt): return timedelta(0)
|
|
2009
|
+
def dst(self, dt): return None
|
|
2010
|
+
alsobog = AlsoBogus()
|
|
2011
|
+
self.assertRaises(ValueError, dt.astimezone, alsobog) # also naive
|
|
2012
|
+
|
|
2013
|
+
def test_subclass_datetime(self):
|
|
2014
|
+
|
|
2015
|
+
class C(self.theclass):
|
|
2016
|
+
theAnswer = 42
|
|
2017
|
+
|
|
2018
|
+
def __new__(cls, *args, **kws):
|
|
2019
|
+
temp = kws.copy()
|
|
2020
|
+
extra = temp.pop('extra')
|
|
2021
|
+
result = self.theclass.__new__(cls, *args, **temp)
|
|
2022
|
+
result.extra = extra
|
|
2023
|
+
return result
|
|
2024
|
+
|
|
2025
|
+
def newmeth(self, start):
|
|
2026
|
+
return start + self.year + self.month + self.second
|
|
2027
|
+
|
|
2028
|
+
args = 2003, 4, 14, 12, 13, 41
|
|
2029
|
+
|
|
2030
|
+
dt1 = self.theclass(*args)
|
|
2031
|
+
dt2 = C(*args, **{'extra': 7})
|
|
2032
|
+
|
|
2033
|
+
self.assertEqual(dt2.__class__, C)
|
|
2034
|
+
self.assertEqual(dt2.theAnswer, 42)
|
|
2035
|
+
self.assertEqual(dt2.extra, 7)
|
|
2036
|
+
self.assertEqual(dt1.toordinal(), dt2.toordinal())
|
|
2037
|
+
self.assertEqual(dt2.newmeth(-7), dt1.year + dt1.month +
|
|
2038
|
+
dt1.second - 7)
|
|
2039
|
+
|
|
2040
|
+
class TestSubclassDateTime(TestDateTime):
|
|
2041
|
+
theclass = SubclassDatetime
|
|
2042
|
+
# Override tests not designed for subclass
|
|
2043
|
+
@unittest.skip('not appropriate for subclasses')
|
|
2044
|
+
def test_roundtrip(self):
|
|
2045
|
+
pass
|
|
2046
|
+
|
|
2047
|
+
class SubclassTime(time):
|
|
2048
|
+
sub_var = 1
|
|
2049
|
+
|
|
2050
|
+
class TestTime(HarmlessMixedComparison, unittest.TestCase):
|
|
2051
|
+
|
|
2052
|
+
theclass = time
|
|
2053
|
+
|
|
2054
|
+
def test_basic_attributes(self):
|
|
2055
|
+
t = self.theclass(12, 0)
|
|
2056
|
+
self.assertEqual(t.hour, 12)
|
|
2057
|
+
self.assertEqual(t.minute, 0)
|
|
2058
|
+
self.assertEqual(t.second, 0)
|
|
2059
|
+
self.assertEqual(t.microsecond, 0)
|
|
2060
|
+
|
|
2061
|
+
def test_basic_attributes_nonzero(self):
|
|
2062
|
+
# Make sure all attributes are non-zero so bugs in
|
|
2063
|
+
# bit-shifting access show up.
|
|
2064
|
+
t = self.theclass(12, 59, 59, 8000)
|
|
2065
|
+
self.assertEqual(t.hour, 12)
|
|
2066
|
+
self.assertEqual(t.minute, 59)
|
|
2067
|
+
self.assertEqual(t.second, 59)
|
|
2068
|
+
self.assertEqual(t.microsecond, 8000)
|
|
2069
|
+
|
|
2070
|
+
def test_roundtrip(self):
|
|
2071
|
+
t = self.theclass(1, 2, 3, 4)
|
|
2072
|
+
|
|
2073
|
+
# Verify t -> string -> time identity.
|
|
2074
|
+
s = repr(t)
|
|
2075
|
+
self.assertTrue(s.startswith('datetime.'))
|
|
2076
|
+
s = s[9:]
|
|
2077
|
+
t2 = eval(s)
|
|
2078
|
+
self.assertEqual(t, t2)
|
|
2079
|
+
|
|
2080
|
+
# Verify identity via reconstructing from pieces.
|
|
2081
|
+
t2 = self.theclass(t.hour, t.minute, t.second,
|
|
2082
|
+
t.microsecond)
|
|
2083
|
+
self.assertEqual(t, t2)
|
|
2084
|
+
|
|
2085
|
+
def test_comparing(self):
|
|
2086
|
+
args = [1, 2, 3, 4]
|
|
2087
|
+
t1 = self.theclass(*args)
|
|
2088
|
+
t2 = self.theclass(*args)
|
|
2089
|
+
self.assertEqual(t1, t2)
|
|
2090
|
+
self.assertTrue(t1 <= t2)
|
|
2091
|
+
self.assertTrue(t1 >= t2)
|
|
2092
|
+
self.assertFalse(t1 != t2)
|
|
2093
|
+
self.assertFalse(t1 < t2)
|
|
2094
|
+
self.assertFalse(t1 > t2)
|
|
2095
|
+
|
|
2096
|
+
for i in range(len(args)):
|
|
2097
|
+
newargs = args[:]
|
|
2098
|
+
newargs[i] = args[i] + 1
|
|
2099
|
+
t2 = self.theclass(*newargs) # this is larger than t1
|
|
2100
|
+
self.assertTrue(t1 < t2)
|
|
2101
|
+
self.assertTrue(t2 > t1)
|
|
2102
|
+
self.assertTrue(t1 <= t2)
|
|
2103
|
+
self.assertTrue(t2 >= t1)
|
|
2104
|
+
self.assertTrue(t1 != t2)
|
|
2105
|
+
self.assertTrue(t2 != t1)
|
|
2106
|
+
self.assertFalse(t1 == t2)
|
|
2107
|
+
self.assertFalse(t2 == t1)
|
|
2108
|
+
self.assertFalse(t1 > t2)
|
|
2109
|
+
self.assertFalse(t2 < t1)
|
|
2110
|
+
self.assertFalse(t1 >= t2)
|
|
2111
|
+
self.assertFalse(t2 <= t1)
|
|
2112
|
+
|
|
2113
|
+
for badarg in OTHERSTUFF:
|
|
2114
|
+
self.assertEqual(t1 == badarg, False)
|
|
2115
|
+
self.assertEqual(t1 != badarg, True)
|
|
2116
|
+
self.assertEqual(badarg == t1, False)
|
|
2117
|
+
self.assertEqual(badarg != t1, True)
|
|
2118
|
+
|
|
2119
|
+
self.assertRaises(TypeError, lambda: t1 <= badarg)
|
|
2120
|
+
self.assertRaises(TypeError, lambda: t1 < badarg)
|
|
2121
|
+
self.assertRaises(TypeError, lambda: t1 > badarg)
|
|
2122
|
+
self.assertRaises(TypeError, lambda: t1 >= badarg)
|
|
2123
|
+
self.assertRaises(TypeError, lambda: badarg <= t1)
|
|
2124
|
+
self.assertRaises(TypeError, lambda: badarg < t1)
|
|
2125
|
+
self.assertRaises(TypeError, lambda: badarg > t1)
|
|
2126
|
+
self.assertRaises(TypeError, lambda: badarg >= t1)
|
|
2127
|
+
|
|
2128
|
+
def test_bad_constructor_arguments(self):
|
|
2129
|
+
# bad hours
|
|
2130
|
+
self.theclass(0, 0) # no exception
|
|
2131
|
+
self.theclass(23, 0) # no exception
|
|
2132
|
+
self.assertRaises(ValueError, self.theclass, -1, 0)
|
|
2133
|
+
self.assertRaises(ValueError, self.theclass, 24, 0)
|
|
2134
|
+
# bad minutes
|
|
2135
|
+
self.theclass(23, 0) # no exception
|
|
2136
|
+
self.theclass(23, 59) # no exception
|
|
2137
|
+
self.assertRaises(ValueError, self.theclass, 23, -1)
|
|
2138
|
+
self.assertRaises(ValueError, self.theclass, 23, 60)
|
|
2139
|
+
# bad seconds
|
|
2140
|
+
self.theclass(23, 59, 0) # no exception
|
|
2141
|
+
self.theclass(23, 59, 59) # no exception
|
|
2142
|
+
self.assertRaises(ValueError, self.theclass, 23, 59, -1)
|
|
2143
|
+
self.assertRaises(ValueError, self.theclass, 23, 59, 60)
|
|
2144
|
+
# bad microseconds
|
|
2145
|
+
self.theclass(23, 59, 59, 0) # no exception
|
|
2146
|
+
self.theclass(23, 59, 59, 999999) # no exception
|
|
2147
|
+
self.assertRaises(ValueError, self.theclass, 23, 59, 59, -1)
|
|
2148
|
+
self.assertRaises(ValueError, self.theclass, 23, 59, 59, 1000000)
|
|
2149
|
+
|
|
2150
|
+
def test_hash_equality(self):
|
|
2151
|
+
d = self.theclass(23, 30, 17)
|
|
2152
|
+
e = self.theclass(23, 30, 17)
|
|
2153
|
+
self.assertEqual(d, e)
|
|
2154
|
+
self.assertEqual(hash(d), hash(e))
|
|
2155
|
+
|
|
2156
|
+
dic = {d: 1}
|
|
2157
|
+
dic[e] = 2
|
|
2158
|
+
self.assertEqual(len(dic), 1)
|
|
2159
|
+
self.assertEqual(dic[d], 2)
|
|
2160
|
+
self.assertEqual(dic[e], 2)
|
|
2161
|
+
|
|
2162
|
+
d = self.theclass(0, 5, 17)
|
|
2163
|
+
e = self.theclass(0, 5, 17)
|
|
2164
|
+
self.assertEqual(d, e)
|
|
2165
|
+
self.assertEqual(hash(d), hash(e))
|
|
2166
|
+
|
|
2167
|
+
dic = {d: 1}
|
|
2168
|
+
dic[e] = 2
|
|
2169
|
+
self.assertEqual(len(dic), 1)
|
|
2170
|
+
self.assertEqual(dic[d], 2)
|
|
2171
|
+
self.assertEqual(dic[e], 2)
|
|
2172
|
+
|
|
2173
|
+
def test_isoformat(self):
|
|
2174
|
+
t = self.theclass(4, 5, 1, 123)
|
|
2175
|
+
self.assertEqual(t.isoformat(), "04:05:01.000123")
|
|
2176
|
+
self.assertEqual(t.isoformat(), str(t))
|
|
2177
|
+
|
|
2178
|
+
t = self.theclass()
|
|
2179
|
+
self.assertEqual(t.isoformat(), "00:00:00")
|
|
2180
|
+
self.assertEqual(t.isoformat(), str(t))
|
|
2181
|
+
|
|
2182
|
+
t = self.theclass(microsecond=1)
|
|
2183
|
+
self.assertEqual(t.isoformat(), "00:00:00.000001")
|
|
2184
|
+
self.assertEqual(t.isoformat(), str(t))
|
|
2185
|
+
|
|
2186
|
+
t = self.theclass(microsecond=10)
|
|
2187
|
+
self.assertEqual(t.isoformat(), "00:00:00.000010")
|
|
2188
|
+
self.assertEqual(t.isoformat(), str(t))
|
|
2189
|
+
|
|
2190
|
+
t = self.theclass(microsecond=100)
|
|
2191
|
+
self.assertEqual(t.isoformat(), "00:00:00.000100")
|
|
2192
|
+
self.assertEqual(t.isoformat(), str(t))
|
|
2193
|
+
|
|
2194
|
+
t = self.theclass(microsecond=1000)
|
|
2195
|
+
self.assertEqual(t.isoformat(), "00:00:00.001000")
|
|
2196
|
+
self.assertEqual(t.isoformat(), str(t))
|
|
2197
|
+
|
|
2198
|
+
t = self.theclass(microsecond=10000)
|
|
2199
|
+
self.assertEqual(t.isoformat(), "00:00:00.010000")
|
|
2200
|
+
self.assertEqual(t.isoformat(), str(t))
|
|
2201
|
+
|
|
2202
|
+
t = self.theclass(microsecond=100000)
|
|
2203
|
+
self.assertEqual(t.isoformat(), "00:00:00.100000")
|
|
2204
|
+
self.assertEqual(t.isoformat(), str(t))
|
|
2205
|
+
|
|
2206
|
+
def test_1653736(self):
|
|
2207
|
+
# verify it doesn't accept extra keyword arguments
|
|
2208
|
+
t = self.theclass(second=1)
|
|
2209
|
+
self.assertRaises(TypeError, t.isoformat, foo=3)
|
|
2210
|
+
|
|
2211
|
+
def test_strftime(self):
|
|
2212
|
+
t = self.theclass(1, 2, 3, 4)
|
|
2213
|
+
self.assertEqual(t.strftime('%H %M %S %f'), "01 02 03 000004")
|
|
2214
|
+
# A naive object replaces %z and %Z with empty strings.
|
|
2215
|
+
self.assertEqual(t.strftime("'%z' '%Z'"), "'' ''")
|
|
2216
|
+
|
|
2217
|
+
def test_format(self):
|
|
2218
|
+
t = self.theclass(1, 2, 3, 4)
|
|
2219
|
+
self.assertEqual(t.__format__(''), str(t))
|
|
2220
|
+
|
|
2221
|
+
# check that a derived class's __str__() gets called
|
|
2222
|
+
class A(self.theclass):
|
|
2223
|
+
def __str__(self):
|
|
2224
|
+
return 'A'
|
|
2225
|
+
a = A(1, 2, 3, 4)
|
|
2226
|
+
self.assertEqual(a.__format__(''), 'A')
|
|
2227
|
+
|
|
2228
|
+
# check that a derived class's strftime gets called
|
|
2229
|
+
class B(self.theclass):
|
|
2230
|
+
def strftime(self, format_spec):
|
|
2231
|
+
return 'B'
|
|
2232
|
+
b = B(1, 2, 3, 4)
|
|
2233
|
+
self.assertEqual(b.__format__(''), str(t))
|
|
2234
|
+
|
|
2235
|
+
for fmt in ['%H %M %S',
|
|
2236
|
+
]:
|
|
2237
|
+
self.assertEqual(t.__format__(fmt), t.strftime(fmt))
|
|
2238
|
+
self.assertEqual(a.__format__(fmt), t.strftime(fmt))
|
|
2239
|
+
self.assertEqual(b.__format__(fmt), 'B')
|
|
2240
|
+
|
|
2241
|
+
def test_str(self):
|
|
2242
|
+
self.assertEqual(str(self.theclass(1, 2, 3, 4)), "01:02:03.000004")
|
|
2243
|
+
self.assertEqual(str(self.theclass(10, 2, 3, 4000)), "10:02:03.004000")
|
|
2244
|
+
self.assertEqual(str(self.theclass(0, 2, 3, 400000)), "00:02:03.400000")
|
|
2245
|
+
self.assertEqual(str(self.theclass(12, 2, 3, 0)), "12:02:03")
|
|
2246
|
+
self.assertEqual(str(self.theclass(23, 15, 0, 0)), "23:15:00")
|
|
2247
|
+
|
|
2248
|
+
def test_repr(self):
|
|
2249
|
+
name = 'datetime.' + self.theclass.__name__
|
|
2250
|
+
self.assertEqual(repr(self.theclass(1, 2, 3, 4)),
|
|
2251
|
+
"%s(1, 2, 3, 4)" % name)
|
|
2252
|
+
self.assertEqual(repr(self.theclass(10, 2, 3, 4000)),
|
|
2253
|
+
"%s(10, 2, 3, 4000)" % name)
|
|
2254
|
+
self.assertEqual(repr(self.theclass(0, 2, 3, 400000)),
|
|
2255
|
+
"%s(0, 2, 3, 400000)" % name)
|
|
2256
|
+
self.assertEqual(repr(self.theclass(12, 2, 3, 0)),
|
|
2257
|
+
"%s(12, 2, 3)" % name)
|
|
2258
|
+
self.assertEqual(repr(self.theclass(23, 15, 0, 0)),
|
|
2259
|
+
"%s(23, 15)" % name)
|
|
2260
|
+
|
|
2261
|
+
def test_resolution_info(self):
|
|
2262
|
+
self.assertIsInstance(self.theclass.min, self.theclass)
|
|
2263
|
+
self.assertIsInstance(self.theclass.max, self.theclass)
|
|
2264
|
+
self.assertIsInstance(self.theclass.resolution, timedelta)
|
|
2265
|
+
self.assertTrue(self.theclass.max > self.theclass.min)
|
|
2266
|
+
|
|
2267
|
+
def test_pickling(self):
|
|
2268
|
+
args = 20, 59, 16, 64**2
|
|
2269
|
+
orig = self.theclass(*args)
|
|
2270
|
+
for pickler, unpickler, proto in pickle_choices:
|
|
2271
|
+
green = pickler.dumps(orig, proto)
|
|
2272
|
+
derived = unpickler.loads(green)
|
|
2273
|
+
self.assertEqual(orig, derived)
|
|
2274
|
+
|
|
2275
|
+
def test_pickling_subclass_time(self):
|
|
2276
|
+
args = 20, 59, 16, 64**2
|
|
2277
|
+
orig = SubclassTime(*args)
|
|
2278
|
+
for pickler, unpickler, proto in pickle_choices:
|
|
2279
|
+
green = pickler.dumps(orig, proto)
|
|
2280
|
+
derived = unpickler.loads(green)
|
|
2281
|
+
self.assertEqual(orig, derived)
|
|
2282
|
+
|
|
2283
|
+
def test_bool(self):
|
|
2284
|
+
cls = self.theclass
|
|
2285
|
+
self.assertTrue(cls(1))
|
|
2286
|
+
self.assertTrue(cls(0, 1))
|
|
2287
|
+
self.assertTrue(cls(0, 0, 1))
|
|
2288
|
+
self.assertTrue(cls(0, 0, 0, 1))
|
|
2289
|
+
self.assertFalse(cls(0))
|
|
2290
|
+
self.assertFalse(cls())
|
|
2291
|
+
|
|
2292
|
+
def test_replace(self):
|
|
2293
|
+
cls = self.theclass
|
|
2294
|
+
args = [1, 2, 3, 4]
|
|
2295
|
+
base = cls(*args)
|
|
2296
|
+
self.assertEqual(base, base.replace())
|
|
2297
|
+
|
|
2298
|
+
i = 0
|
|
2299
|
+
for name, newval in (("hour", 5),
|
|
2300
|
+
("minute", 6),
|
|
2301
|
+
("second", 7),
|
|
2302
|
+
("microsecond", 8)):
|
|
2303
|
+
newargs = args[:]
|
|
2304
|
+
newargs[i] = newval
|
|
2305
|
+
expected = cls(*newargs)
|
|
2306
|
+
got = base.replace(**{name: newval})
|
|
2307
|
+
self.assertEqual(expected, got)
|
|
2308
|
+
i += 1
|
|
2309
|
+
|
|
2310
|
+
# Out of bounds.
|
|
2311
|
+
base = cls(1)
|
|
2312
|
+
self.assertRaises(ValueError, base.replace, hour=24)
|
|
2313
|
+
self.assertRaises(ValueError, base.replace, minute=-1)
|
|
2314
|
+
self.assertRaises(ValueError, base.replace, second=100)
|
|
2315
|
+
self.assertRaises(ValueError, base.replace, microsecond=1000000)
|
|
2316
|
+
|
|
2317
|
+
def test_subclass_time(self):
|
|
2318
|
+
|
|
2319
|
+
class C(self.theclass):
|
|
2320
|
+
theAnswer = 42
|
|
2321
|
+
|
|
2322
|
+
def __new__(cls, *args, **kws):
|
|
2323
|
+
temp = kws.copy()
|
|
2324
|
+
extra = temp.pop('extra')
|
|
2325
|
+
result = self.theclass.__new__(cls, *args, **temp)
|
|
2326
|
+
result.extra = extra
|
|
2327
|
+
return result
|
|
2328
|
+
|
|
2329
|
+
def newmeth(self, start):
|
|
2330
|
+
return start + self.hour + self.second
|
|
2331
|
+
|
|
2332
|
+
args = 4, 5, 6
|
|
2333
|
+
|
|
2334
|
+
dt1 = self.theclass(*args)
|
|
2335
|
+
dt2 = C(*args, **{'extra': 7})
|
|
2336
|
+
|
|
2337
|
+
self.assertEqual(dt2.__class__, C)
|
|
2338
|
+
self.assertEqual(dt2.theAnswer, 42)
|
|
2339
|
+
self.assertEqual(dt2.extra, 7)
|
|
2340
|
+
self.assertEqual(dt1.isoformat(), dt2.isoformat())
|
|
2341
|
+
self.assertEqual(dt2.newmeth(-7), dt1.hour + dt1.second - 7)
|
|
2342
|
+
|
|
2343
|
+
def test_backdoor_resistance(self):
|
|
2344
|
+
# see TestDate.test_backdoor_resistance().
|
|
2345
|
+
base = '2:59.0'
|
|
2346
|
+
for hour_byte in ' ', '9', chr(24), '\xff':
|
|
2347
|
+
self.assertRaises(TypeError, self.theclass,
|
|
2348
|
+
hour_byte + base[1:])
|
|
2349
|
+
|
|
2350
|
+
# A mixin for classes with a tzinfo= argument. Subclasses must define
|
|
2351
|
+
# theclass as a class atribute, and theclass(1, 1, 1, tzinfo=whatever)
|
|
2352
|
+
# must be legit (which is true for time and datetime).
|
|
2353
|
+
class TZInfoBase:
|
|
2354
|
+
|
|
2355
|
+
def test_argument_passing(self):
|
|
2356
|
+
cls = self.theclass
|
|
2357
|
+
# A datetime passes itself on, a time passes None.
|
|
2358
|
+
class introspective(tzinfo):
|
|
2359
|
+
def tzname(self, dt): return dt and "real" or "none"
|
|
2360
|
+
def utcoffset(self, dt):
|
|
2361
|
+
return timedelta(minutes = dt and 42 or -42)
|
|
2362
|
+
dst = utcoffset
|
|
2363
|
+
|
|
2364
|
+
obj = cls(1, 2, 3, tzinfo=introspective())
|
|
2365
|
+
|
|
2366
|
+
expected = cls is time and "none" or "real"
|
|
2367
|
+
self.assertEqual(obj.tzname(), expected)
|
|
2368
|
+
|
|
2369
|
+
expected = timedelta(minutes=(cls is time and -42 or 42))
|
|
2370
|
+
self.assertEqual(obj.utcoffset(), expected)
|
|
2371
|
+
self.assertEqual(obj.dst(), expected)
|
|
2372
|
+
|
|
2373
|
+
def test_bad_tzinfo_classes(self):
|
|
2374
|
+
cls = self.theclass
|
|
2375
|
+
self.assertRaises(TypeError, cls, 1, 1, 1, tzinfo=12)
|
|
2376
|
+
|
|
2377
|
+
class NiceTry(object):
|
|
2378
|
+
def __init__(self): pass
|
|
2379
|
+
def utcoffset(self, dt): pass
|
|
2380
|
+
self.assertRaises(TypeError, cls, 1, 1, 1, tzinfo=NiceTry)
|
|
2381
|
+
|
|
2382
|
+
class BetterTry(tzinfo):
|
|
2383
|
+
def __init__(self): pass
|
|
2384
|
+
def utcoffset(self, dt): pass
|
|
2385
|
+
b = BetterTry()
|
|
2386
|
+
t = cls(1, 1, 1, tzinfo=b)
|
|
2387
|
+
self.assertIs(t.tzinfo, b)
|
|
2388
|
+
|
|
2389
|
+
def test_utc_offset_out_of_bounds(self):
|
|
2390
|
+
class Edgy(tzinfo):
|
|
2391
|
+
def __init__(self, offset):
|
|
2392
|
+
self.offset = timedelta(minutes=offset)
|
|
2393
|
+
def utcoffset(self, dt):
|
|
2394
|
+
return self.offset
|
|
2395
|
+
|
|
2396
|
+
cls = self.theclass
|
|
2397
|
+
for offset, legit in ((-1440, False),
|
|
2398
|
+
(-1439, True),
|
|
2399
|
+
(1439, True),
|
|
2400
|
+
(1440, False)):
|
|
2401
|
+
if cls is time:
|
|
2402
|
+
t = cls(1, 2, 3, tzinfo=Edgy(offset))
|
|
2403
|
+
elif cls is datetime:
|
|
2404
|
+
t = cls(6, 6, 6, 1, 2, 3, tzinfo=Edgy(offset))
|
|
2405
|
+
else:
|
|
2406
|
+
assert 0, "impossible"
|
|
2407
|
+
if legit:
|
|
2408
|
+
aofs = abs(offset)
|
|
2409
|
+
h, m = divmod(aofs, 60)
|
|
2410
|
+
tag = "%c%02d:%02d" % (offset < 0 and '-' or '+', h, m)
|
|
2411
|
+
if isinstance(t, datetime):
|
|
2412
|
+
t = t.timetz()
|
|
2413
|
+
self.assertEqual(str(t), "01:02:03" + tag)
|
|
2414
|
+
else:
|
|
2415
|
+
self.assertRaises(ValueError, str, t)
|
|
2416
|
+
|
|
2417
|
+
def test_tzinfo_classes(self):
|
|
2418
|
+
cls = self.theclass
|
|
2419
|
+
class C1(tzinfo):
|
|
2420
|
+
def utcoffset(self, dt): return None
|
|
2421
|
+
def dst(self, dt): return None
|
|
2422
|
+
def tzname(self, dt): return None
|
|
2423
|
+
for t in (cls(1, 1, 1),
|
|
2424
|
+
cls(1, 1, 1, tzinfo=None),
|
|
2425
|
+
cls(1, 1, 1, tzinfo=C1())):
|
|
2426
|
+
self.assertIsNone(t.utcoffset())
|
|
2427
|
+
self.assertIsNone(t.dst())
|
|
2428
|
+
self.assertIsNone(t.tzname())
|
|
2429
|
+
|
|
2430
|
+
class C3(tzinfo):
|
|
2431
|
+
def utcoffset(self, dt): return timedelta(minutes=-1439)
|
|
2432
|
+
def dst(self, dt): return timedelta(minutes=1439)
|
|
2433
|
+
def tzname(self, dt): return "aname"
|
|
2434
|
+
t = cls(1, 1, 1, tzinfo=C3())
|
|
2435
|
+
self.assertEqual(t.utcoffset(), timedelta(minutes=-1439))
|
|
2436
|
+
self.assertEqual(t.dst(), timedelta(minutes=1439))
|
|
2437
|
+
self.assertEqual(t.tzname(), "aname")
|
|
2438
|
+
|
|
2439
|
+
# Wrong types.
|
|
2440
|
+
class C4(tzinfo):
|
|
2441
|
+
def utcoffset(self, dt): return "aname"
|
|
2442
|
+
def dst(self, dt): return 7
|
|
2443
|
+
def tzname(self, dt): return 0
|
|
2444
|
+
t = cls(1, 1, 1, tzinfo=C4())
|
|
2445
|
+
self.assertRaises(TypeError, t.utcoffset)
|
|
2446
|
+
self.assertRaises(TypeError, t.dst)
|
|
2447
|
+
self.assertRaises(TypeError, t.tzname)
|
|
2448
|
+
|
|
2449
|
+
# Offset out of range.
|
|
2450
|
+
class C6(tzinfo):
|
|
2451
|
+
def utcoffset(self, dt): return timedelta(hours=-24)
|
|
2452
|
+
def dst(self, dt): return timedelta(hours=24)
|
|
2453
|
+
t = cls(1, 1, 1, tzinfo=C6())
|
|
2454
|
+
self.assertRaises(ValueError, t.utcoffset)
|
|
2455
|
+
self.assertRaises(ValueError, t.dst)
|
|
2456
|
+
|
|
2457
|
+
# Not a whole number of minutes.
|
|
2458
|
+
class C7(tzinfo):
|
|
2459
|
+
def utcoffset(self, dt): return timedelta(seconds=61)
|
|
2460
|
+
def dst(self, dt): return timedelta(microseconds=-81)
|
|
2461
|
+
t = cls(1, 1, 1, tzinfo=C7())
|
|
2462
|
+
self.assertRaises(ValueError, t.utcoffset)
|
|
2463
|
+
self.assertRaises(ValueError, t.dst)
|
|
2464
|
+
|
|
2465
|
+
def test_aware_compare(self):
|
|
2466
|
+
cls = self.theclass
|
|
2467
|
+
|
|
2468
|
+
# Ensure that utcoffset() gets ignored if the comparands have
|
|
2469
|
+
# the same tzinfo member.
|
|
2470
|
+
class OperandDependentOffset(tzinfo):
|
|
2471
|
+
def utcoffset(self, t):
|
|
2472
|
+
if t.minute < 10:
|
|
2473
|
+
# d0 and d1 equal after adjustment
|
|
2474
|
+
return timedelta(minutes=t.minute)
|
|
2475
|
+
else:
|
|
2476
|
+
# d2 off in the weeds
|
|
2477
|
+
return timedelta(minutes=59)
|
|
2478
|
+
|
|
2479
|
+
base = cls(8, 9, 10, tzinfo=OperandDependentOffset())
|
|
2480
|
+
d0 = base.replace(minute=3)
|
|
2481
|
+
d1 = base.replace(minute=9)
|
|
2482
|
+
d2 = base.replace(minute=11)
|
|
2483
|
+
for x in d0, d1, d2:
|
|
2484
|
+
for y in d0, d1, d2:
|
|
2485
|
+
for op in lt, le, gt, ge, eq, ne:
|
|
2486
|
+
got = op(x, y)
|
|
2487
|
+
expected = op(x.minute, y.minute)
|
|
2488
|
+
self.assertEqual(got, expected)
|
|
2489
|
+
|
|
2490
|
+
# However, if they're different members, uctoffset is not ignored.
|
|
2491
|
+
# Note that a time can't actually have an operand-depedent offset,
|
|
2492
|
+
# though (and time.utcoffset() passes None to tzinfo.utcoffset()),
|
|
2493
|
+
# so skip this test for time.
|
|
2494
|
+
if cls is not time:
|
|
2495
|
+
d0 = base.replace(minute=3, tzinfo=OperandDependentOffset())
|
|
2496
|
+
d1 = base.replace(minute=9, tzinfo=OperandDependentOffset())
|
|
2497
|
+
d2 = base.replace(minute=11, tzinfo=OperandDependentOffset())
|
|
2498
|
+
for x in d0, d1, d2:
|
|
2499
|
+
for y in d0, d1, d2:
|
|
2500
|
+
got = (x > y) - (x < y)
|
|
2501
|
+
if (x is d0 or x is d1) and (y is d0 or y is d1):
|
|
2502
|
+
expected = 0
|
|
2503
|
+
elif x is y is d2:
|
|
2504
|
+
expected = 0
|
|
2505
|
+
elif x is d2:
|
|
2506
|
+
expected = -1
|
|
2507
|
+
else:
|
|
2508
|
+
assert y is d2
|
|
2509
|
+
expected = 1
|
|
2510
|
+
self.assertEqual(got, expected)
|
|
2511
|
+
|
|
2512
|
+
|
|
2513
|
+
# Testing time objects with a non-None tzinfo.
|
|
2514
|
+
class TestTimeTZ(TestTime, TZInfoBase, unittest.TestCase):
|
|
2515
|
+
theclass = time
|
|
2516
|
+
|
|
2517
|
+
def test_empty(self):
|
|
2518
|
+
t = self.theclass()
|
|
2519
|
+
self.assertEqual(t.hour, 0)
|
|
2520
|
+
self.assertEqual(t.minute, 0)
|
|
2521
|
+
self.assertEqual(t.second, 0)
|
|
2522
|
+
self.assertEqual(t.microsecond, 0)
|
|
2523
|
+
self.assertIsNone(t.tzinfo)
|
|
2524
|
+
|
|
2525
|
+
def test_zones(self):
|
|
2526
|
+
est = FixedOffset(-300, "EST", 1)
|
|
2527
|
+
utc = FixedOffset(0, "UTC", -2)
|
|
2528
|
+
met = FixedOffset(60, "MET", 3)
|
|
2529
|
+
t1 = time( 7, 47, tzinfo=est)
|
|
2530
|
+
t2 = time(12, 47, tzinfo=utc)
|
|
2531
|
+
t3 = time(13, 47, tzinfo=met)
|
|
2532
|
+
t4 = time(microsecond=40)
|
|
2533
|
+
t5 = time(microsecond=40, tzinfo=utc)
|
|
2534
|
+
|
|
2535
|
+
self.assertEqual(t1.tzinfo, est)
|
|
2536
|
+
self.assertEqual(t2.tzinfo, utc)
|
|
2537
|
+
self.assertEqual(t3.tzinfo, met)
|
|
2538
|
+
self.assertIsNone(t4.tzinfo)
|
|
2539
|
+
self.assertEqual(t5.tzinfo, utc)
|
|
2540
|
+
|
|
2541
|
+
self.assertEqual(t1.utcoffset(), timedelta(minutes=-300))
|
|
2542
|
+
self.assertEqual(t2.utcoffset(), timedelta(minutes=0))
|
|
2543
|
+
self.assertEqual(t3.utcoffset(), timedelta(minutes=60))
|
|
2544
|
+
self.assertIsNone(t4.utcoffset())
|
|
2545
|
+
self.assertRaises(TypeError, t1.utcoffset, "no args")
|
|
2546
|
+
|
|
2547
|
+
self.assertEqual(t1.tzname(), "EST")
|
|
2548
|
+
self.assertEqual(t2.tzname(), "UTC")
|
|
2549
|
+
self.assertEqual(t3.tzname(), "MET")
|
|
2550
|
+
self.assertIsNone(t4.tzname())
|
|
2551
|
+
self.assertRaises(TypeError, t1.tzname, "no args")
|
|
2552
|
+
|
|
2553
|
+
self.assertEqual(t1.dst(), timedelta(minutes=1))
|
|
2554
|
+
self.assertEqual(t2.dst(), timedelta(minutes=-2))
|
|
2555
|
+
self.assertEqual(t3.dst(), timedelta(minutes=3))
|
|
2556
|
+
self.assertIsNone(t4.dst())
|
|
2557
|
+
self.assertRaises(TypeError, t1.dst, "no args")
|
|
2558
|
+
|
|
2559
|
+
self.assertEqual(hash(t1), hash(t2))
|
|
2560
|
+
self.assertEqual(hash(t1), hash(t3))
|
|
2561
|
+
self.assertEqual(hash(t2), hash(t3))
|
|
2562
|
+
|
|
2563
|
+
self.assertEqual(t1, t2)
|
|
2564
|
+
self.assertEqual(t1, t3)
|
|
2565
|
+
self.assertEqual(t2, t3)
|
|
2566
|
+
self.assertNotEqual(t4, t5) # mixed tz-aware & naive
|
|
2567
|
+
self.assertRaises(TypeError, lambda: t4 < t5) # mixed tz-aware & naive
|
|
2568
|
+
self.assertRaises(TypeError, lambda: t5 < t4) # mixed tz-aware & naive
|
|
2569
|
+
|
|
2570
|
+
self.assertEqual(str(t1), "07:47:00-05:00")
|
|
2571
|
+
self.assertEqual(str(t2), "12:47:00+00:00")
|
|
2572
|
+
self.assertEqual(str(t3), "13:47:00+01:00")
|
|
2573
|
+
self.assertEqual(str(t4), "00:00:00.000040")
|
|
2574
|
+
self.assertEqual(str(t5), "00:00:00.000040+00:00")
|
|
2575
|
+
|
|
2576
|
+
self.assertEqual(t1.isoformat(), "07:47:00-05:00")
|
|
2577
|
+
self.assertEqual(t2.isoformat(), "12:47:00+00:00")
|
|
2578
|
+
self.assertEqual(t3.isoformat(), "13:47:00+01:00")
|
|
2579
|
+
self.assertEqual(t4.isoformat(), "00:00:00.000040")
|
|
2580
|
+
self.assertEqual(t5.isoformat(), "00:00:00.000040+00:00")
|
|
2581
|
+
|
|
2582
|
+
d = 'datetime.time'
|
|
2583
|
+
self.assertEqual(repr(t1), d + "(7, 47, tzinfo=est)")
|
|
2584
|
+
self.assertEqual(repr(t2), d + "(12, 47, tzinfo=utc)")
|
|
2585
|
+
self.assertEqual(repr(t3), d + "(13, 47, tzinfo=met)")
|
|
2586
|
+
self.assertEqual(repr(t4), d + "(0, 0, 0, 40)")
|
|
2587
|
+
self.assertEqual(repr(t5), d + "(0, 0, 0, 40, tzinfo=utc)")
|
|
2588
|
+
|
|
2589
|
+
self.assertEqual(t1.strftime("%H:%M:%S %%Z=%Z %%z=%z"),
|
|
2590
|
+
"07:47:00 %Z=EST %z=-0500")
|
|
2591
|
+
self.assertEqual(t2.strftime("%H:%M:%S %Z %z"), "12:47:00 UTC +0000")
|
|
2592
|
+
self.assertEqual(t3.strftime("%H:%M:%S %Z %z"), "13:47:00 MET +0100")
|
|
2593
|
+
|
|
2594
|
+
yuck = FixedOffset(-1439, "%z %Z %%z%%Z")
|
|
2595
|
+
t1 = time(23, 59, tzinfo=yuck)
|
|
2596
|
+
self.assertEqual(t1.strftime("%H:%M %%Z='%Z' %%z='%z'"),
|
|
2597
|
+
"23:59 %Z='%z %Z %%z%%Z' %z='-2359'")
|
|
2598
|
+
|
|
2599
|
+
# Check that an invalid tzname result raises an exception.
|
|
2600
|
+
class Badtzname(tzinfo):
|
|
2601
|
+
tz = 42
|
|
2602
|
+
def tzname(self, dt): return self.tz
|
|
2603
|
+
t = time(2, 3, 4, tzinfo=Badtzname())
|
|
2604
|
+
self.assertEqual(t.strftime("%H:%M:%S"), "02:03:04")
|
|
2605
|
+
self.assertRaises(TypeError, t.strftime, "%Z")
|
|
2606
|
+
|
|
2607
|
+
# Issue #6697:
|
|
2608
|
+
if '_Fast' in str(type(self)):
|
|
2609
|
+
Badtzname.tz = '\ud800'
|
|
2610
|
+
self.assertRaises(ValueError, t.strftime, "%Z")
|
|
2611
|
+
|
|
2612
|
+
def test_hash_edge_cases(self):
|
|
2613
|
+
# Offsets that overflow a basic time.
|
|
2614
|
+
t1 = self.theclass(0, 1, 2, 3, tzinfo=FixedOffset(1439, ""))
|
|
2615
|
+
t2 = self.theclass(0, 0, 2, 3, tzinfo=FixedOffset(1438, ""))
|
|
2616
|
+
self.assertEqual(hash(t1), hash(t2))
|
|
2617
|
+
|
|
2618
|
+
t1 = self.theclass(23, 58, 6, 100, tzinfo=FixedOffset(-1000, ""))
|
|
2619
|
+
t2 = self.theclass(23, 48, 6, 100, tzinfo=FixedOffset(-1010, ""))
|
|
2620
|
+
self.assertEqual(hash(t1), hash(t2))
|
|
2621
|
+
|
|
2622
|
+
def test_pickling(self):
|
|
2623
|
+
# Try one without a tzinfo.
|
|
2624
|
+
args = 20, 59, 16, 64**2
|
|
2625
|
+
orig = self.theclass(*args)
|
|
2626
|
+
for pickler, unpickler, proto in pickle_choices:
|
|
2627
|
+
green = pickler.dumps(orig, proto)
|
|
2628
|
+
derived = unpickler.loads(green)
|
|
2629
|
+
self.assertEqual(orig, derived)
|
|
2630
|
+
|
|
2631
|
+
# Try one with a tzinfo.
|
|
2632
|
+
tinfo = PicklableFixedOffset(-300, 'cookie')
|
|
2633
|
+
orig = self.theclass(5, 6, 7, tzinfo=tinfo)
|
|
2634
|
+
for pickler, unpickler, proto in pickle_choices:
|
|
2635
|
+
green = pickler.dumps(orig, proto)
|
|
2636
|
+
derived = unpickler.loads(green)
|
|
2637
|
+
self.assertEqual(orig, derived)
|
|
2638
|
+
self.assertIsInstance(derived.tzinfo, PicklableFixedOffset)
|
|
2639
|
+
self.assertEqual(derived.utcoffset(), timedelta(minutes=-300))
|
|
2640
|
+
self.assertEqual(derived.tzname(), 'cookie')
|
|
2641
|
+
|
|
2642
|
+
def test_more_bool(self):
|
|
2643
|
+
# Test cases with non-None tzinfo.
|
|
2644
|
+
cls = self.theclass
|
|
2645
|
+
|
|
2646
|
+
t = cls(0, tzinfo=FixedOffset(-300, ""))
|
|
2647
|
+
self.assertTrue(t)
|
|
2648
|
+
|
|
2649
|
+
t = cls(5, tzinfo=FixedOffset(-300, ""))
|
|
2650
|
+
self.assertTrue(t)
|
|
2651
|
+
|
|
2652
|
+
t = cls(5, tzinfo=FixedOffset(300, ""))
|
|
2653
|
+
self.assertFalse(t)
|
|
2654
|
+
|
|
2655
|
+
t = cls(23, 59, tzinfo=FixedOffset(23*60 + 59, ""))
|
|
2656
|
+
self.assertFalse(t)
|
|
2657
|
+
|
|
2658
|
+
# Mostly ensuring this doesn't overflow internally.
|
|
2659
|
+
t = cls(0, tzinfo=FixedOffset(23*60 + 59, ""))
|
|
2660
|
+
self.assertTrue(t)
|
|
2661
|
+
|
|
2662
|
+
# But this should yield a value error -- the utcoffset is bogus.
|
|
2663
|
+
t = cls(0, tzinfo=FixedOffset(24*60, ""))
|
|
2664
|
+
self.assertRaises(ValueError, lambda: bool(t))
|
|
2665
|
+
|
|
2666
|
+
# Likewise.
|
|
2667
|
+
t = cls(0, tzinfo=FixedOffset(-24*60, ""))
|
|
2668
|
+
self.assertRaises(ValueError, lambda: bool(t))
|
|
2669
|
+
|
|
2670
|
+
def test_replace(self):
|
|
2671
|
+
cls = self.theclass
|
|
2672
|
+
z100 = FixedOffset(100, "+100")
|
|
2673
|
+
zm200 = FixedOffset(timedelta(minutes=-200), "-200")
|
|
2674
|
+
args = [1, 2, 3, 4, z100]
|
|
2675
|
+
base = cls(*args)
|
|
2676
|
+
self.assertEqual(base, base.replace())
|
|
2677
|
+
|
|
2678
|
+
i = 0
|
|
2679
|
+
for name, newval in (("hour", 5),
|
|
2680
|
+
("minute", 6),
|
|
2681
|
+
("second", 7),
|
|
2682
|
+
("microsecond", 8),
|
|
2683
|
+
("tzinfo", zm200)):
|
|
2684
|
+
newargs = args[:]
|
|
2685
|
+
newargs[i] = newval
|
|
2686
|
+
expected = cls(*newargs)
|
|
2687
|
+
got = base.replace(**{name: newval})
|
|
2688
|
+
self.assertEqual(expected, got)
|
|
2689
|
+
i += 1
|
|
2690
|
+
|
|
2691
|
+
# Ensure we can get rid of a tzinfo.
|
|
2692
|
+
self.assertEqual(base.tzname(), "+100")
|
|
2693
|
+
base2 = base.replace(tzinfo=None)
|
|
2694
|
+
self.assertIsNone(base2.tzinfo)
|
|
2695
|
+
self.assertIsNone(base2.tzname())
|
|
2696
|
+
|
|
2697
|
+
# Ensure we can add one.
|
|
2698
|
+
base3 = base2.replace(tzinfo=z100)
|
|
2699
|
+
self.assertEqual(base, base3)
|
|
2700
|
+
self.assertIs(base.tzinfo, base3.tzinfo)
|
|
2701
|
+
|
|
2702
|
+
# Out of bounds.
|
|
2703
|
+
base = cls(1)
|
|
2704
|
+
self.assertRaises(ValueError, base.replace, hour=24)
|
|
2705
|
+
self.assertRaises(ValueError, base.replace, minute=-1)
|
|
2706
|
+
self.assertRaises(ValueError, base.replace, second=100)
|
|
2707
|
+
self.assertRaises(ValueError, base.replace, microsecond=1000000)
|
|
2708
|
+
|
|
2709
|
+
def test_mixed_compare(self):
|
|
2710
|
+
t1 = time(1, 2, 3)
|
|
2711
|
+
t2 = time(1, 2, 3)
|
|
2712
|
+
self.assertEqual(t1, t2)
|
|
2713
|
+
t2 = t2.replace(tzinfo=None)
|
|
2714
|
+
self.assertEqual(t1, t2)
|
|
2715
|
+
t2 = t2.replace(tzinfo=FixedOffset(None, ""))
|
|
2716
|
+
self.assertEqual(t1, t2)
|
|
2717
|
+
t2 = t2.replace(tzinfo=FixedOffset(0, ""))
|
|
2718
|
+
self.assertNotEqual(t1, t2)
|
|
2719
|
+
|
|
2720
|
+
# In time w/ identical tzinfo objects, utcoffset is ignored.
|
|
2721
|
+
class Varies(tzinfo):
|
|
2722
|
+
def __init__(self):
|
|
2723
|
+
self.offset = timedelta(minutes=22)
|
|
2724
|
+
def utcoffset(self, t):
|
|
2725
|
+
self.offset += timedelta(minutes=1)
|
|
2726
|
+
return self.offset
|
|
2727
|
+
|
|
2728
|
+
v = Varies()
|
|
2729
|
+
t1 = t2.replace(tzinfo=v)
|
|
2730
|
+
t2 = t2.replace(tzinfo=v)
|
|
2731
|
+
self.assertEqual(t1.utcoffset(), timedelta(minutes=23))
|
|
2732
|
+
self.assertEqual(t2.utcoffset(), timedelta(minutes=24))
|
|
2733
|
+
self.assertEqual(t1, t2)
|
|
2734
|
+
|
|
2735
|
+
# But if they're not identical, it isn't ignored.
|
|
2736
|
+
t2 = t2.replace(tzinfo=Varies())
|
|
2737
|
+
self.assertTrue(t1 < t2) # t1's offset counter still going up
|
|
2738
|
+
|
|
2739
|
+
def test_subclass_timetz(self):
|
|
2740
|
+
|
|
2741
|
+
class C(self.theclass):
|
|
2742
|
+
theAnswer = 42
|
|
2743
|
+
|
|
2744
|
+
def __new__(cls, *args, **kws):
|
|
2745
|
+
temp = kws.copy()
|
|
2746
|
+
extra = temp.pop('extra')
|
|
2747
|
+
result = self.theclass.__new__(cls, *args, **temp)
|
|
2748
|
+
result.extra = extra
|
|
2749
|
+
return result
|
|
2750
|
+
|
|
2751
|
+
def newmeth(self, start):
|
|
2752
|
+
return start + self.hour + self.second
|
|
2753
|
+
|
|
2754
|
+
args = 4, 5, 6, 500, FixedOffset(-300, "EST", 1)
|
|
2755
|
+
|
|
2756
|
+
dt1 = self.theclass(*args)
|
|
2757
|
+
dt2 = C(*args, **{'extra': 7})
|
|
2758
|
+
|
|
2759
|
+
self.assertEqual(dt2.__class__, C)
|
|
2760
|
+
self.assertEqual(dt2.theAnswer, 42)
|
|
2761
|
+
self.assertEqual(dt2.extra, 7)
|
|
2762
|
+
self.assertEqual(dt1.utcoffset(), dt2.utcoffset())
|
|
2763
|
+
self.assertEqual(dt2.newmeth(-7), dt1.hour + dt1.second - 7)
|
|
2764
|
+
|
|
2765
|
+
|
|
2766
|
+
# Testing datetime objects with a non-None tzinfo.
|
|
2767
|
+
|
|
2768
|
+
class TestDateTimeTZ(TestDateTime, TZInfoBase, unittest.TestCase):
|
|
2769
|
+
theclass = datetime
|
|
2770
|
+
|
|
2771
|
+
def test_trivial(self):
|
|
2772
|
+
dt = self.theclass(1, 2, 3, 4, 5, 6, 7)
|
|
2773
|
+
self.assertEqual(dt.year, 1)
|
|
2774
|
+
self.assertEqual(dt.month, 2)
|
|
2775
|
+
self.assertEqual(dt.day, 3)
|
|
2776
|
+
self.assertEqual(dt.hour, 4)
|
|
2777
|
+
self.assertEqual(dt.minute, 5)
|
|
2778
|
+
self.assertEqual(dt.second, 6)
|
|
2779
|
+
self.assertEqual(dt.microsecond, 7)
|
|
2780
|
+
self.assertEqual(dt.tzinfo, None)
|
|
2781
|
+
|
|
2782
|
+
def test_even_more_compare(self):
|
|
2783
|
+
# The test_compare() and test_more_compare() inherited from TestDate
|
|
2784
|
+
# and TestDateTime covered non-tzinfo cases.
|
|
2785
|
+
|
|
2786
|
+
# Smallest possible after UTC adjustment.
|
|
2787
|
+
t1 = self.theclass(1, 1, 1, tzinfo=FixedOffset(1439, ""))
|
|
2788
|
+
# Largest possible after UTC adjustment.
|
|
2789
|
+
t2 = self.theclass(MAXYEAR, 12, 31, 23, 59, 59, 999999,
|
|
2790
|
+
tzinfo=FixedOffset(-1439, ""))
|
|
2791
|
+
|
|
2792
|
+
# Make sure those compare correctly, and w/o overflow.
|
|
2793
|
+
self.assertTrue(t1 < t2)
|
|
2794
|
+
self.assertTrue(t1 != t2)
|
|
2795
|
+
self.assertTrue(t2 > t1)
|
|
2796
|
+
|
|
2797
|
+
self.assertEqual(t1, t1)
|
|
2798
|
+
self.assertEqual(t2, t2)
|
|
2799
|
+
|
|
2800
|
+
# Equal afer adjustment.
|
|
2801
|
+
t1 = self.theclass(1, 12, 31, 23, 59, tzinfo=FixedOffset(1, ""))
|
|
2802
|
+
t2 = self.theclass(2, 1, 1, 3, 13, tzinfo=FixedOffset(3*60+13+2, ""))
|
|
2803
|
+
self.assertEqual(t1, t2)
|
|
2804
|
+
|
|
2805
|
+
# Change t1 not to subtract a minute, and t1 should be larger.
|
|
2806
|
+
t1 = self.theclass(1, 12, 31, 23, 59, tzinfo=FixedOffset(0, ""))
|
|
2807
|
+
self.assertTrue(t1 > t2)
|
|
2808
|
+
|
|
2809
|
+
# Change t1 to subtract 2 minutes, and t1 should be smaller.
|
|
2810
|
+
t1 = self.theclass(1, 12, 31, 23, 59, tzinfo=FixedOffset(2, ""))
|
|
2811
|
+
self.assertTrue(t1 < t2)
|
|
2812
|
+
|
|
2813
|
+
# Back to the original t1, but make seconds resolve it.
|
|
2814
|
+
t1 = self.theclass(1, 12, 31, 23, 59, tzinfo=FixedOffset(1, ""),
|
|
2815
|
+
second=1)
|
|
2816
|
+
self.assertTrue(t1 > t2)
|
|
2817
|
+
|
|
2818
|
+
# Likewise, but make microseconds resolve it.
|
|
2819
|
+
t1 = self.theclass(1, 12, 31, 23, 59, tzinfo=FixedOffset(1, ""),
|
|
2820
|
+
microsecond=1)
|
|
2821
|
+
self.assertTrue(t1 > t2)
|
|
2822
|
+
|
|
2823
|
+
# Make t2 naive and it should differ.
|
|
2824
|
+
t2 = self.theclass.min
|
|
2825
|
+
self.assertNotEqual(t1, t2)
|
|
2826
|
+
self.assertEqual(t2, t2)
|
|
2827
|
+
|
|
2828
|
+
# It's also naive if it has tzinfo but tzinfo.utcoffset() is None.
|
|
2829
|
+
class Naive(tzinfo):
|
|
2830
|
+
def utcoffset(self, dt): return None
|
|
2831
|
+
t2 = self.theclass(5, 6, 7, tzinfo=Naive())
|
|
2832
|
+
self.assertNotEqual(t1, t2)
|
|
2833
|
+
self.assertEqual(t2, t2)
|
|
2834
|
+
|
|
2835
|
+
# OTOH, it's OK to compare two of these mixing the two ways of being
|
|
2836
|
+
# naive.
|
|
2837
|
+
t1 = self.theclass(5, 6, 7)
|
|
2838
|
+
self.assertEqual(t1, t2)
|
|
2839
|
+
|
|
2840
|
+
# Try a bogus uctoffset.
|
|
2841
|
+
class Bogus(tzinfo):
|
|
2842
|
+
def utcoffset(self, dt):
|
|
2843
|
+
return timedelta(minutes=1440) # out of bounds
|
|
2844
|
+
t1 = self.theclass(2, 2, 2, tzinfo=Bogus())
|
|
2845
|
+
t2 = self.theclass(2, 2, 2, tzinfo=FixedOffset(0, ""))
|
|
2846
|
+
self.assertRaises(ValueError, lambda: t1 == t2)
|
|
2847
|
+
|
|
2848
|
+
def test_pickling(self):
|
|
2849
|
+
# Try one without a tzinfo.
|
|
2850
|
+
args = 6, 7, 23, 20, 59, 1, 64**2
|
|
2851
|
+
orig = self.theclass(*args)
|
|
2852
|
+
for pickler, unpickler, proto in pickle_choices:
|
|
2853
|
+
green = pickler.dumps(orig, proto)
|
|
2854
|
+
derived = unpickler.loads(green)
|
|
2855
|
+
self.assertEqual(orig, derived)
|
|
2856
|
+
|
|
2857
|
+
# Try one with a tzinfo.
|
|
2858
|
+
tinfo = PicklableFixedOffset(-300, 'cookie')
|
|
2859
|
+
orig = self.theclass(*args, **{'tzinfo': tinfo})
|
|
2860
|
+
derived = self.theclass(1, 1, 1, tzinfo=FixedOffset(0, "", 0))
|
|
2861
|
+
for pickler, unpickler, proto in pickle_choices:
|
|
2862
|
+
green = pickler.dumps(orig, proto)
|
|
2863
|
+
derived = unpickler.loads(green)
|
|
2864
|
+
self.assertEqual(orig, derived)
|
|
2865
|
+
self.assertIsInstance(derived.tzinfo, PicklableFixedOffset)
|
|
2866
|
+
self.assertEqual(derived.utcoffset(), timedelta(minutes=-300))
|
|
2867
|
+
self.assertEqual(derived.tzname(), 'cookie')
|
|
2868
|
+
|
|
2869
|
+
def test_extreme_hashes(self):
|
|
2870
|
+
# If an attempt is made to hash these via subtracting the offset
|
|
2871
|
+
# then hashing a datetime object, OverflowError results. The
|
|
2872
|
+
# Python implementation used to blow up here.
|
|
2873
|
+
t = self.theclass(1, 1, 1, tzinfo=FixedOffset(1439, ""))
|
|
2874
|
+
hash(t)
|
|
2875
|
+
t = self.theclass(MAXYEAR, 12, 31, 23, 59, 59, 999999,
|
|
2876
|
+
tzinfo=FixedOffset(-1439, ""))
|
|
2877
|
+
hash(t)
|
|
2878
|
+
|
|
2879
|
+
# OTOH, an OOB offset should blow up.
|
|
2880
|
+
t = self.theclass(5, 5, 5, tzinfo=FixedOffset(-1440, ""))
|
|
2881
|
+
self.assertRaises(ValueError, hash, t)
|
|
2882
|
+
|
|
2883
|
+
def test_zones(self):
|
|
2884
|
+
est = FixedOffset(-300, "EST")
|
|
2885
|
+
utc = FixedOffset(0, "UTC")
|
|
2886
|
+
met = FixedOffset(60, "MET")
|
|
2887
|
+
t1 = datetime(2002, 3, 19, 7, 47, tzinfo=est)
|
|
2888
|
+
t2 = datetime(2002, 3, 19, 12, 47, tzinfo=utc)
|
|
2889
|
+
t3 = datetime(2002, 3, 19, 13, 47, tzinfo=met)
|
|
2890
|
+
self.assertEqual(t1.tzinfo, est)
|
|
2891
|
+
self.assertEqual(t2.tzinfo, utc)
|
|
2892
|
+
self.assertEqual(t3.tzinfo, met)
|
|
2893
|
+
self.assertEqual(t1.utcoffset(), timedelta(minutes=-300))
|
|
2894
|
+
self.assertEqual(t2.utcoffset(), timedelta(minutes=0))
|
|
2895
|
+
self.assertEqual(t3.utcoffset(), timedelta(minutes=60))
|
|
2896
|
+
self.assertEqual(t1.tzname(), "EST")
|
|
2897
|
+
self.assertEqual(t2.tzname(), "UTC")
|
|
2898
|
+
self.assertEqual(t3.tzname(), "MET")
|
|
2899
|
+
self.assertEqual(hash(t1), hash(t2))
|
|
2900
|
+
self.assertEqual(hash(t1), hash(t3))
|
|
2901
|
+
self.assertEqual(hash(t2), hash(t3))
|
|
2902
|
+
self.assertEqual(t1, t2)
|
|
2903
|
+
self.assertEqual(t1, t3)
|
|
2904
|
+
self.assertEqual(t2, t3)
|
|
2905
|
+
self.assertEqual(str(t1), "2002-03-19 07:47:00-05:00")
|
|
2906
|
+
self.assertEqual(str(t2), "2002-03-19 12:47:00+00:00")
|
|
2907
|
+
self.assertEqual(str(t3), "2002-03-19 13:47:00+01:00")
|
|
2908
|
+
d = 'datetime.datetime(2002, 3, 19, '
|
|
2909
|
+
self.assertEqual(repr(t1), d + "7, 47, tzinfo=est)")
|
|
2910
|
+
self.assertEqual(repr(t2), d + "12, 47, tzinfo=utc)")
|
|
2911
|
+
self.assertEqual(repr(t3), d + "13, 47, tzinfo=met)")
|
|
2912
|
+
|
|
2913
|
+
def test_combine(self):
|
|
2914
|
+
met = FixedOffset(60, "MET")
|
|
2915
|
+
d = date(2002, 3, 4)
|
|
2916
|
+
tz = time(18, 45, 3, 1234, tzinfo=met)
|
|
2917
|
+
dt = datetime.combine(d, tz)
|
|
2918
|
+
self.assertEqual(dt, datetime(2002, 3, 4, 18, 45, 3, 1234,
|
|
2919
|
+
tzinfo=met))
|
|
2920
|
+
|
|
2921
|
+
def test_extract(self):
|
|
2922
|
+
met = FixedOffset(60, "MET")
|
|
2923
|
+
dt = self.theclass(2002, 3, 4, 18, 45, 3, 1234, tzinfo=met)
|
|
2924
|
+
self.assertEqual(dt.date(), date(2002, 3, 4))
|
|
2925
|
+
self.assertEqual(dt.time(), time(18, 45, 3, 1234))
|
|
2926
|
+
self.assertEqual(dt.timetz(), time(18, 45, 3, 1234, tzinfo=met))
|
|
2927
|
+
|
|
2928
|
+
def test_tz_aware_arithmetic(self):
|
|
2929
|
+
import random
|
|
2930
|
+
|
|
2931
|
+
now = self.theclass.now()
|
|
2932
|
+
tz55 = FixedOffset(-330, "west 5:30")
|
|
2933
|
+
timeaware = now.time().replace(tzinfo=tz55)
|
|
2934
|
+
nowaware = self.theclass.combine(now.date(), timeaware)
|
|
2935
|
+
self.assertIs(nowaware.tzinfo, tz55)
|
|
2936
|
+
self.assertEqual(nowaware.timetz(), timeaware)
|
|
2937
|
+
|
|
2938
|
+
# Can't mix aware and non-aware.
|
|
2939
|
+
self.assertRaises(TypeError, lambda: now - nowaware)
|
|
2940
|
+
self.assertRaises(TypeError, lambda: nowaware - now)
|
|
2941
|
+
|
|
2942
|
+
# And adding datetime's doesn't make sense, aware or not.
|
|
2943
|
+
self.assertRaises(TypeError, lambda: now + nowaware)
|
|
2944
|
+
self.assertRaises(TypeError, lambda: nowaware + now)
|
|
2945
|
+
self.assertRaises(TypeError, lambda: nowaware + nowaware)
|
|
2946
|
+
|
|
2947
|
+
# Subtracting should yield 0.
|
|
2948
|
+
self.assertEqual(now - now, timedelta(0))
|
|
2949
|
+
self.assertEqual(nowaware - nowaware, timedelta(0))
|
|
2950
|
+
|
|
2951
|
+
# Adding a delta should preserve tzinfo.
|
|
2952
|
+
delta = timedelta(weeks=1, minutes=12, microseconds=5678)
|
|
2953
|
+
nowawareplus = nowaware + delta
|
|
2954
|
+
self.assertIs(nowaware.tzinfo, tz55)
|
|
2955
|
+
nowawareplus2 = delta + nowaware
|
|
2956
|
+
self.assertIs(nowawareplus2.tzinfo, tz55)
|
|
2957
|
+
self.assertEqual(nowawareplus, nowawareplus2)
|
|
2958
|
+
|
|
2959
|
+
# that - delta should be what we started with, and that - what we
|
|
2960
|
+
# started with should be delta.
|
|
2961
|
+
diff = nowawareplus - delta
|
|
2962
|
+
self.assertIs(diff.tzinfo, tz55)
|
|
2963
|
+
self.assertEqual(nowaware, diff)
|
|
2964
|
+
self.assertRaises(TypeError, lambda: delta - nowawareplus)
|
|
2965
|
+
self.assertEqual(nowawareplus - nowaware, delta)
|
|
2966
|
+
|
|
2967
|
+
# Make up a random timezone.
|
|
2968
|
+
tzr = FixedOffset(random.randrange(-1439, 1440), "randomtimezone")
|
|
2969
|
+
# Attach it to nowawareplus.
|
|
2970
|
+
nowawareplus = nowawareplus.replace(tzinfo=tzr)
|
|
2971
|
+
self.assertIs(nowawareplus.tzinfo, tzr)
|
|
2972
|
+
# Make sure the difference takes the timezone adjustments into account.
|
|
2973
|
+
got = nowaware - nowawareplus
|
|
2974
|
+
# Expected: (nowaware base - nowaware offset) -
|
|
2975
|
+
# (nowawareplus base - nowawareplus offset) =
|
|
2976
|
+
# (nowaware base - nowawareplus base) +
|
|
2977
|
+
# (nowawareplus offset - nowaware offset) =
|
|
2978
|
+
# -delta + nowawareplus offset - nowaware offset
|
|
2979
|
+
expected = nowawareplus.utcoffset() - nowaware.utcoffset() - delta
|
|
2980
|
+
self.assertEqual(got, expected)
|
|
2981
|
+
|
|
2982
|
+
# Try max possible difference.
|
|
2983
|
+
min = self.theclass(1, 1, 1, tzinfo=FixedOffset(1439, "min"))
|
|
2984
|
+
max = self.theclass(MAXYEAR, 12, 31, 23, 59, 59, 999999,
|
|
2985
|
+
tzinfo=FixedOffset(-1439, "max"))
|
|
2986
|
+
maxdiff = max - min
|
|
2987
|
+
self.assertEqual(maxdiff, self.theclass.max - self.theclass.min +
|
|
2988
|
+
timedelta(minutes=2*1439))
|
|
2989
|
+
# Different tzinfo, but the same offset
|
|
2990
|
+
tza = timezone(HOUR, 'A')
|
|
2991
|
+
tzb = timezone(HOUR, 'B')
|
|
2992
|
+
delta = min.replace(tzinfo=tza) - max.replace(tzinfo=tzb)
|
|
2993
|
+
self.assertEqual(delta, self.theclass.min - self.theclass.max)
|
|
2994
|
+
|
|
2995
|
+
def test_tzinfo_now(self):
|
|
2996
|
+
meth = self.theclass.now
|
|
2997
|
+
# Ensure it doesn't require tzinfo (i.e., that this doesn't blow up).
|
|
2998
|
+
base = meth()
|
|
2999
|
+
# Try with and without naming the keyword.
|
|
3000
|
+
off42 = FixedOffset(42, "42")
|
|
3001
|
+
another = meth(off42)
|
|
3002
|
+
again = meth(tz=off42)
|
|
3003
|
+
self.assertIs(another.tzinfo, again.tzinfo)
|
|
3004
|
+
self.assertEqual(another.utcoffset(), timedelta(minutes=42))
|
|
3005
|
+
# Bad argument with and w/o naming the keyword.
|
|
3006
|
+
self.assertRaises(TypeError, meth, 16)
|
|
3007
|
+
self.assertRaises(TypeError, meth, tzinfo=16)
|
|
3008
|
+
# Bad keyword name.
|
|
3009
|
+
self.assertRaises(TypeError, meth, tinfo=off42)
|
|
3010
|
+
# Too many args.
|
|
3011
|
+
self.assertRaises(TypeError, meth, off42, off42)
|
|
3012
|
+
|
|
3013
|
+
# We don't know which time zone we're in, and don't have a tzinfo
|
|
3014
|
+
# class to represent it, so seeing whether a tz argument actually
|
|
3015
|
+
# does a conversion is tricky.
|
|
3016
|
+
utc = FixedOffset(0, "utc", 0)
|
|
3017
|
+
for weirdtz in [FixedOffset(timedelta(hours=15, minutes=58), "weirdtz", 0),
|
|
3018
|
+
timezone(timedelta(hours=15, minutes=58), "weirdtz"),]:
|
|
3019
|
+
for dummy in range(3):
|
|
3020
|
+
now = datetime.now(weirdtz)
|
|
3021
|
+
self.assertIs(now.tzinfo, weirdtz)
|
|
3022
|
+
utcnow = datetime.utcnow().replace(tzinfo=utc)
|
|
3023
|
+
now2 = utcnow.astimezone(weirdtz)
|
|
3024
|
+
if abs(now - now2) < timedelta(seconds=30):
|
|
3025
|
+
break
|
|
3026
|
+
# Else the code is broken, or more than 30 seconds passed between
|
|
3027
|
+
# calls; assuming the latter, just try again.
|
|
3028
|
+
else:
|
|
3029
|
+
# Three strikes and we're out.
|
|
3030
|
+
self.fail("utcnow(), now(tz), or astimezone() may be broken")
|
|
3031
|
+
|
|
3032
|
+
def test_tzinfo_fromtimestamp(self):
|
|
3033
|
+
import time
|
|
3034
|
+
meth = self.theclass.fromtimestamp
|
|
3035
|
+
ts = time.time()
|
|
3036
|
+
# Ensure it doesn't require tzinfo (i.e., that this doesn't blow up).
|
|
3037
|
+
base = meth(ts)
|
|
3038
|
+
# Try with and without naming the keyword.
|
|
3039
|
+
off42 = FixedOffset(42, "42")
|
|
3040
|
+
another = meth(ts, off42)
|
|
3041
|
+
again = meth(ts, tz=off42)
|
|
3042
|
+
self.assertIs(another.tzinfo, again.tzinfo)
|
|
3043
|
+
self.assertEqual(another.utcoffset(), timedelta(minutes=42))
|
|
3044
|
+
# Bad argument with and w/o naming the keyword.
|
|
3045
|
+
self.assertRaises(TypeError, meth, ts, 16)
|
|
3046
|
+
self.assertRaises(TypeError, meth, ts, tzinfo=16)
|
|
3047
|
+
# Bad keyword name.
|
|
3048
|
+
self.assertRaises(TypeError, meth, ts, tinfo=off42)
|
|
3049
|
+
# Too many args.
|
|
3050
|
+
self.assertRaises(TypeError, meth, ts, off42, off42)
|
|
3051
|
+
# Too few args.
|
|
3052
|
+
self.assertRaises(TypeError, meth)
|
|
3053
|
+
|
|
3054
|
+
# Try to make sure tz= actually does some conversion.
|
|
3055
|
+
timestamp = 1000000000
|
|
3056
|
+
utcdatetime = datetime.utcfromtimestamp(timestamp)
|
|
3057
|
+
# In POSIX (epoch 1970), that's 2001-09-09 01:46:40 UTC, give or take.
|
|
3058
|
+
# But on some flavor of Mac, it's nowhere near that. So we can't have
|
|
3059
|
+
# any idea here what time that actually is, we can only test that
|
|
3060
|
+
# relative changes match.
|
|
3061
|
+
utcoffset = timedelta(hours=-15, minutes=39) # arbitrary, but not zero
|
|
3062
|
+
tz = FixedOffset(utcoffset, "tz", 0)
|
|
3063
|
+
expected = utcdatetime + utcoffset
|
|
3064
|
+
got = datetime.fromtimestamp(timestamp, tz)
|
|
3065
|
+
self.assertEqual(expected, got.replace(tzinfo=None))
|
|
3066
|
+
|
|
3067
|
+
def test_tzinfo_utcnow(self):
|
|
3068
|
+
meth = self.theclass.utcnow
|
|
3069
|
+
# Ensure it doesn't require tzinfo (i.e., that this doesn't blow up).
|
|
3070
|
+
base = meth()
|
|
3071
|
+
# Try with and without naming the keyword; for whatever reason,
|
|
3072
|
+
# utcnow() doesn't accept a tzinfo argument.
|
|
3073
|
+
off42 = FixedOffset(42, "42")
|
|
3074
|
+
self.assertRaises(TypeError, meth, off42)
|
|
3075
|
+
self.assertRaises(TypeError, meth, tzinfo=off42)
|
|
3076
|
+
|
|
3077
|
+
def test_tzinfo_utcfromtimestamp(self):
|
|
3078
|
+
import time
|
|
3079
|
+
meth = self.theclass.utcfromtimestamp
|
|
3080
|
+
ts = time.time()
|
|
3081
|
+
# Ensure it doesn't require tzinfo (i.e., that this doesn't blow up).
|
|
3082
|
+
base = meth(ts)
|
|
3083
|
+
# Try with and without naming the keyword; for whatever reason,
|
|
3084
|
+
# utcfromtimestamp() doesn't accept a tzinfo argument.
|
|
3085
|
+
off42 = FixedOffset(42, "42")
|
|
3086
|
+
self.assertRaises(TypeError, meth, ts, off42)
|
|
3087
|
+
self.assertRaises(TypeError, meth, ts, tzinfo=off42)
|
|
3088
|
+
|
|
3089
|
+
def test_tzinfo_timetuple(self):
|
|
3090
|
+
# TestDateTime tested most of this. datetime adds a twist to the
|
|
3091
|
+
# DST flag.
|
|
3092
|
+
class DST(tzinfo):
|
|
3093
|
+
def __init__(self, dstvalue):
|
|
3094
|
+
if isinstance(dstvalue, int):
|
|
3095
|
+
dstvalue = timedelta(minutes=dstvalue)
|
|
3096
|
+
self.dstvalue = dstvalue
|
|
3097
|
+
def dst(self, dt):
|
|
3098
|
+
return self.dstvalue
|
|
3099
|
+
|
|
3100
|
+
cls = self.theclass
|
|
3101
|
+
for dstvalue, flag in (-33, 1), (33, 1), (0, 0), (None, -1):
|
|
3102
|
+
d = cls(1, 1, 1, 10, 20, 30, 40, tzinfo=DST(dstvalue))
|
|
3103
|
+
t = d.timetuple()
|
|
3104
|
+
self.assertEqual(1, t.tm_year)
|
|
3105
|
+
self.assertEqual(1, t.tm_mon)
|
|
3106
|
+
self.assertEqual(1, t.tm_mday)
|
|
3107
|
+
self.assertEqual(10, t.tm_hour)
|
|
3108
|
+
self.assertEqual(20, t.tm_min)
|
|
3109
|
+
self.assertEqual(30, t.tm_sec)
|
|
3110
|
+
self.assertEqual(0, t.tm_wday)
|
|
3111
|
+
self.assertEqual(1, t.tm_yday)
|
|
3112
|
+
self.assertEqual(flag, t.tm_isdst)
|
|
3113
|
+
|
|
3114
|
+
# dst() returns wrong type.
|
|
3115
|
+
self.assertRaises(TypeError, cls(1, 1, 1, tzinfo=DST("x")).timetuple)
|
|
3116
|
+
|
|
3117
|
+
# dst() at the edge.
|
|
3118
|
+
self.assertEqual(cls(1,1,1, tzinfo=DST(1439)).timetuple().tm_isdst, 1)
|
|
3119
|
+
self.assertEqual(cls(1,1,1, tzinfo=DST(-1439)).timetuple().tm_isdst, 1)
|
|
3120
|
+
|
|
3121
|
+
# dst() out of range.
|
|
3122
|
+
self.assertRaises(ValueError, cls(1,1,1, tzinfo=DST(1440)).timetuple)
|
|
3123
|
+
self.assertRaises(ValueError, cls(1,1,1, tzinfo=DST(-1440)).timetuple)
|
|
3124
|
+
|
|
3125
|
+
def test_utctimetuple(self):
|
|
3126
|
+
class DST(tzinfo):
|
|
3127
|
+
def __init__(self, dstvalue=0):
|
|
3128
|
+
if isinstance(dstvalue, int):
|
|
3129
|
+
dstvalue = timedelta(minutes=dstvalue)
|
|
3130
|
+
self.dstvalue = dstvalue
|
|
3131
|
+
def dst(self, dt):
|
|
3132
|
+
return self.dstvalue
|
|
3133
|
+
|
|
3134
|
+
cls = self.theclass
|
|
3135
|
+
# This can't work: DST didn't implement utcoffset.
|
|
3136
|
+
self.assertRaises(NotImplementedError,
|
|
3137
|
+
cls(1, 1, 1, tzinfo=DST(0)).utcoffset)
|
|
3138
|
+
|
|
3139
|
+
class UOFS(DST):
|
|
3140
|
+
def __init__(self, uofs, dofs=None):
|
|
3141
|
+
DST.__init__(self, dofs)
|
|
3142
|
+
self.uofs = timedelta(minutes=uofs)
|
|
3143
|
+
def utcoffset(self, dt):
|
|
3144
|
+
return self.uofs
|
|
3145
|
+
|
|
3146
|
+
for dstvalue in -33, 33, 0, None:
|
|
3147
|
+
d = cls(1, 2, 3, 10, 20, 30, 40, tzinfo=UOFS(-53, dstvalue))
|
|
3148
|
+
t = d.utctimetuple()
|
|
3149
|
+
self.assertEqual(d.year, t.tm_year)
|
|
3150
|
+
self.assertEqual(d.month, t.tm_mon)
|
|
3151
|
+
self.assertEqual(d.day, t.tm_mday)
|
|
3152
|
+
self.assertEqual(11, t.tm_hour) # 20mm + 53mm = 1hn + 13mm
|
|
3153
|
+
self.assertEqual(13, t.tm_min)
|
|
3154
|
+
self.assertEqual(d.second, t.tm_sec)
|
|
3155
|
+
self.assertEqual(d.weekday(), t.tm_wday)
|
|
3156
|
+
self.assertEqual(d.toordinal() - date(1, 1, 1).toordinal() + 1,
|
|
3157
|
+
t.tm_yday)
|
|
3158
|
+
# Ensure tm_isdst is 0 regardless of what dst() says: DST
|
|
3159
|
+
# is never in effect for a UTC time.
|
|
3160
|
+
self.assertEqual(0, t.tm_isdst)
|
|
3161
|
+
|
|
3162
|
+
# For naive datetime, utctimetuple == timetuple except for isdst
|
|
3163
|
+
d = cls(1, 2, 3, 10, 20, 30, 40)
|
|
3164
|
+
t = d.utctimetuple()
|
|
3165
|
+
self.assertEqual(t[:-1], d.timetuple()[:-1])
|
|
3166
|
+
self.assertEqual(0, t.tm_isdst)
|
|
3167
|
+
# Same if utcoffset is None
|
|
3168
|
+
class NOFS(DST):
|
|
3169
|
+
def utcoffset(self, dt):
|
|
3170
|
+
return None
|
|
3171
|
+
d = cls(1, 2, 3, 10, 20, 30, 40, tzinfo=NOFS())
|
|
3172
|
+
t = d.utctimetuple()
|
|
3173
|
+
self.assertEqual(t[:-1], d.timetuple()[:-1])
|
|
3174
|
+
self.assertEqual(0, t.tm_isdst)
|
|
3175
|
+
# Check that bad tzinfo is detected
|
|
3176
|
+
class BOFS(DST):
|
|
3177
|
+
def utcoffset(self, dt):
|
|
3178
|
+
return "EST"
|
|
3179
|
+
d = cls(1, 2, 3, 10, 20, 30, 40, tzinfo=BOFS())
|
|
3180
|
+
self.assertRaises(TypeError, d.utctimetuple)
|
|
3181
|
+
|
|
3182
|
+
# Check that utctimetuple() is the same as
|
|
3183
|
+
# astimezone(utc).timetuple()
|
|
3184
|
+
d = cls(2010, 11, 13, 14, 15, 16, 171819)
|
|
3185
|
+
for tz in [timezone.min, timezone.utc, timezone.max]:
|
|
3186
|
+
dtz = d.replace(tzinfo=tz)
|
|
3187
|
+
self.assertEqual(dtz.utctimetuple()[:-1],
|
|
3188
|
+
dtz.astimezone(timezone.utc).timetuple()[:-1])
|
|
3189
|
+
# At the edges, UTC adjustment can produce years out-of-range
|
|
3190
|
+
# for a datetime object. Ensure that an OverflowError is
|
|
3191
|
+
# raised.
|
|
3192
|
+
tiny = cls(MINYEAR, 1, 1, 0, 0, 37, tzinfo=UOFS(1439))
|
|
3193
|
+
# That goes back 1 minute less than a full day.
|
|
3194
|
+
self.assertRaises(OverflowError, tiny.utctimetuple)
|
|
3195
|
+
|
|
3196
|
+
huge = cls(MAXYEAR, 12, 31, 23, 59, 37, 999999, tzinfo=UOFS(-1439))
|
|
3197
|
+
# That goes forward 1 minute less than a full day.
|
|
3198
|
+
self.assertRaises(OverflowError, huge.utctimetuple)
|
|
3199
|
+
# More overflow cases
|
|
3200
|
+
tiny = cls.min.replace(tzinfo=timezone(MINUTE))
|
|
3201
|
+
self.assertRaises(OverflowError, tiny.utctimetuple)
|
|
3202
|
+
huge = cls.max.replace(tzinfo=timezone(-MINUTE))
|
|
3203
|
+
self.assertRaises(OverflowError, huge.utctimetuple)
|
|
3204
|
+
|
|
3205
|
+
def test_tzinfo_isoformat(self):
|
|
3206
|
+
zero = FixedOffset(0, "+00:00")
|
|
3207
|
+
plus = FixedOffset(220, "+03:40")
|
|
3208
|
+
minus = FixedOffset(-231, "-03:51")
|
|
3209
|
+
unknown = FixedOffset(None, "")
|
|
3210
|
+
|
|
3211
|
+
cls = self.theclass
|
|
3212
|
+
datestr = '0001-02-03'
|
|
3213
|
+
for ofs in None, zero, plus, minus, unknown:
|
|
3214
|
+
for us in 0, 987001:
|
|
3215
|
+
d = cls(1, 2, 3, 4, 5, 59, us, tzinfo=ofs)
|
|
3216
|
+
timestr = '04:05:59' + (us and '.987001' or '')
|
|
3217
|
+
ofsstr = ofs is not None and d.tzname() or ''
|
|
3218
|
+
tailstr = timestr + ofsstr
|
|
3219
|
+
iso = d.isoformat()
|
|
3220
|
+
self.assertEqual(iso, datestr + 'T' + tailstr)
|
|
3221
|
+
self.assertEqual(iso, d.isoformat('T'))
|
|
3222
|
+
self.assertEqual(d.isoformat('k'), datestr + 'k' + tailstr)
|
|
3223
|
+
self.assertEqual(d.isoformat('\u1234'), datestr + '\u1234' + tailstr)
|
|
3224
|
+
self.assertEqual(str(d), datestr + ' ' + tailstr)
|
|
3225
|
+
|
|
3226
|
+
def test_replace(self):
|
|
3227
|
+
cls = self.theclass
|
|
3228
|
+
z100 = FixedOffset(100, "+100")
|
|
3229
|
+
zm200 = FixedOffset(timedelta(minutes=-200), "-200")
|
|
3230
|
+
args = [1, 2, 3, 4, 5, 6, 7, z100]
|
|
3231
|
+
base = cls(*args)
|
|
3232
|
+
self.assertEqual(base, base.replace())
|
|
3233
|
+
|
|
3234
|
+
i = 0
|
|
3235
|
+
for name, newval in (("year", 2),
|
|
3236
|
+
("month", 3),
|
|
3237
|
+
("day", 4),
|
|
3238
|
+
("hour", 5),
|
|
3239
|
+
("minute", 6),
|
|
3240
|
+
("second", 7),
|
|
3241
|
+
("microsecond", 8),
|
|
3242
|
+
("tzinfo", zm200)):
|
|
3243
|
+
newargs = args[:]
|
|
3244
|
+
newargs[i] = newval
|
|
3245
|
+
expected = cls(*newargs)
|
|
3246
|
+
got = base.replace(**{name: newval})
|
|
3247
|
+
self.assertEqual(expected, got)
|
|
3248
|
+
i += 1
|
|
3249
|
+
|
|
3250
|
+
# Ensure we can get rid of a tzinfo.
|
|
3251
|
+
self.assertEqual(base.tzname(), "+100")
|
|
3252
|
+
base2 = base.replace(tzinfo=None)
|
|
3253
|
+
self.assertIsNone(base2.tzinfo)
|
|
3254
|
+
self.assertIsNone(base2.tzname())
|
|
3255
|
+
|
|
3256
|
+
# Ensure we can add one.
|
|
3257
|
+
base3 = base2.replace(tzinfo=z100)
|
|
3258
|
+
self.assertEqual(base, base3)
|
|
3259
|
+
self.assertIs(base.tzinfo, base3.tzinfo)
|
|
3260
|
+
|
|
3261
|
+
# Out of bounds.
|
|
3262
|
+
base = cls(2000, 2, 29)
|
|
3263
|
+
self.assertRaises(ValueError, base.replace, year=2001)
|
|
3264
|
+
|
|
3265
|
+
def test_more_astimezone(self):
|
|
3266
|
+
# The inherited test_astimezone covered some trivial and error cases.
|
|
3267
|
+
fnone = FixedOffset(None, "None")
|
|
3268
|
+
f44m = FixedOffset(44, "44")
|
|
3269
|
+
fm5h = FixedOffset(-timedelta(hours=5), "m300")
|
|
3270
|
+
|
|
3271
|
+
dt = self.theclass.now(tz=f44m)
|
|
3272
|
+
self.assertIs(dt.tzinfo, f44m)
|
|
3273
|
+
# Replacing with degenerate tzinfo raises an exception.
|
|
3274
|
+
self.assertRaises(ValueError, dt.astimezone, fnone)
|
|
3275
|
+
# Replacing with same tzinfo makes no change.
|
|
3276
|
+
x = dt.astimezone(dt.tzinfo)
|
|
3277
|
+
self.assertIs(x.tzinfo, f44m)
|
|
3278
|
+
self.assertEqual(x.date(), dt.date())
|
|
3279
|
+
self.assertEqual(x.time(), dt.time())
|
|
3280
|
+
|
|
3281
|
+
# Replacing with different tzinfo does adjust.
|
|
3282
|
+
got = dt.astimezone(fm5h)
|
|
3283
|
+
self.assertIs(got.tzinfo, fm5h)
|
|
3284
|
+
self.assertEqual(got.utcoffset(), timedelta(hours=-5))
|
|
3285
|
+
expected = dt - dt.utcoffset() # in effect, convert to UTC
|
|
3286
|
+
expected += fm5h.utcoffset(dt) # and from there to local time
|
|
3287
|
+
expected = expected.replace(tzinfo=fm5h) # and attach new tzinfo
|
|
3288
|
+
self.assertEqual(got.date(), expected.date())
|
|
3289
|
+
self.assertEqual(got.time(), expected.time())
|
|
3290
|
+
self.assertEqual(got.timetz(), expected.timetz())
|
|
3291
|
+
self.assertIs(got.tzinfo, expected.tzinfo)
|
|
3292
|
+
self.assertEqual(got, expected)
|
|
3293
|
+
|
|
3294
|
+
@support.run_with_tz('UTC')
|
|
3295
|
+
def test_astimezone_default_utc(self):
|
|
3296
|
+
dt = self.theclass.now(timezone.utc)
|
|
3297
|
+
self.assertEqual(dt.astimezone(None), dt)
|
|
3298
|
+
self.assertEqual(dt.astimezone(), dt)
|
|
3299
|
+
|
|
3300
|
+
# Note that offset in TZ variable has the opposite sign to that
|
|
3301
|
+
# produced by %z directive.
|
|
3302
|
+
@support.run_with_tz('EST+05EDT,M3.2.0,M11.1.0')
|
|
3303
|
+
def test_astimezone_default_eastern(self):
|
|
3304
|
+
dt = self.theclass(2012, 11, 4, 6, 30, tzinfo=timezone.utc)
|
|
3305
|
+
local = dt.astimezone()
|
|
3306
|
+
self.assertEqual(dt, local)
|
|
3307
|
+
self.assertEqual(local.strftime("%z %Z"), "-0500 EST")
|
|
3308
|
+
dt = self.theclass(2012, 11, 4, 5, 30, tzinfo=timezone.utc)
|
|
3309
|
+
local = dt.astimezone()
|
|
3310
|
+
self.assertEqual(dt, local)
|
|
3311
|
+
self.assertEqual(local.strftime("%z %Z"), "-0400 EDT")
|
|
3312
|
+
|
|
3313
|
+
def test_aware_subtract(self):
|
|
3314
|
+
cls = self.theclass
|
|
3315
|
+
|
|
3316
|
+
# Ensure that utcoffset() is ignored when the operands have the
|
|
3317
|
+
# same tzinfo member.
|
|
3318
|
+
class OperandDependentOffset(tzinfo):
|
|
3319
|
+
def utcoffset(self, t):
|
|
3320
|
+
if t.minute < 10:
|
|
3321
|
+
# d0 and d1 equal after adjustment
|
|
3322
|
+
return timedelta(minutes=t.minute)
|
|
3323
|
+
else:
|
|
3324
|
+
# d2 off in the weeds
|
|
3325
|
+
return timedelta(minutes=59)
|
|
3326
|
+
|
|
3327
|
+
base = cls(8, 9, 10, 11, 12, 13, 14, tzinfo=OperandDependentOffset())
|
|
3328
|
+
d0 = base.replace(minute=3)
|
|
3329
|
+
d1 = base.replace(minute=9)
|
|
3330
|
+
d2 = base.replace(minute=11)
|
|
3331
|
+
for x in d0, d1, d2:
|
|
3332
|
+
for y in d0, d1, d2:
|
|
3333
|
+
got = x - y
|
|
3334
|
+
expected = timedelta(minutes=x.minute - y.minute)
|
|
3335
|
+
self.assertEqual(got, expected)
|
|
3336
|
+
|
|
3337
|
+
# OTOH, if the tzinfo members are distinct, utcoffsets aren't
|
|
3338
|
+
# ignored.
|
|
3339
|
+
base = cls(8, 9, 10, 11, 12, 13, 14)
|
|
3340
|
+
d0 = base.replace(minute=3, tzinfo=OperandDependentOffset())
|
|
3341
|
+
d1 = base.replace(minute=9, tzinfo=OperandDependentOffset())
|
|
3342
|
+
d2 = base.replace(minute=11, tzinfo=OperandDependentOffset())
|
|
3343
|
+
for x in d0, d1, d2:
|
|
3344
|
+
for y in d0, d1, d2:
|
|
3345
|
+
got = x - y
|
|
3346
|
+
if (x is d0 or x is d1) and (y is d0 or y is d1):
|
|
3347
|
+
expected = timedelta(0)
|
|
3348
|
+
elif x is y is d2:
|
|
3349
|
+
expected = timedelta(0)
|
|
3350
|
+
elif x is d2:
|
|
3351
|
+
expected = timedelta(minutes=(11-59)-0)
|
|
3352
|
+
else:
|
|
3353
|
+
assert y is d2
|
|
3354
|
+
expected = timedelta(minutes=0-(11-59))
|
|
3355
|
+
self.assertEqual(got, expected)
|
|
3356
|
+
|
|
3357
|
+
def test_mixed_compare(self):
|
|
3358
|
+
t1 = datetime(1, 2, 3, 4, 5, 6, 7)
|
|
3359
|
+
t2 = datetime(1, 2, 3, 4, 5, 6, 7)
|
|
3360
|
+
self.assertEqual(t1, t2)
|
|
3361
|
+
t2 = t2.replace(tzinfo=None)
|
|
3362
|
+
self.assertEqual(t1, t2)
|
|
3363
|
+
t2 = t2.replace(tzinfo=FixedOffset(None, ""))
|
|
3364
|
+
self.assertEqual(t1, t2)
|
|
3365
|
+
t2 = t2.replace(tzinfo=FixedOffset(0, ""))
|
|
3366
|
+
self.assertNotEqual(t1, t2)
|
|
3367
|
+
|
|
3368
|
+
# In datetime w/ identical tzinfo objects, utcoffset is ignored.
|
|
3369
|
+
class Varies(tzinfo):
|
|
3370
|
+
def __init__(self):
|
|
3371
|
+
self.offset = timedelta(minutes=22)
|
|
3372
|
+
def utcoffset(self, t):
|
|
3373
|
+
self.offset += timedelta(minutes=1)
|
|
3374
|
+
return self.offset
|
|
3375
|
+
|
|
3376
|
+
v = Varies()
|
|
3377
|
+
t1 = t2.replace(tzinfo=v)
|
|
3378
|
+
t2 = t2.replace(tzinfo=v)
|
|
3379
|
+
self.assertEqual(t1.utcoffset(), timedelta(minutes=23))
|
|
3380
|
+
self.assertEqual(t2.utcoffset(), timedelta(minutes=24))
|
|
3381
|
+
self.assertEqual(t1, t2)
|
|
3382
|
+
|
|
3383
|
+
# But if they're not identical, it isn't ignored.
|
|
3384
|
+
t2 = t2.replace(tzinfo=Varies())
|
|
3385
|
+
self.assertTrue(t1 < t2) # t1's offset counter still going up
|
|
3386
|
+
|
|
3387
|
+
def test_subclass_datetimetz(self):
|
|
3388
|
+
|
|
3389
|
+
class C(self.theclass):
|
|
3390
|
+
theAnswer = 42
|
|
3391
|
+
|
|
3392
|
+
def __new__(cls, *args, **kws):
|
|
3393
|
+
temp = kws.copy()
|
|
3394
|
+
extra = temp.pop('extra')
|
|
3395
|
+
result = self.theclass.__new__(cls, *args, **temp)
|
|
3396
|
+
result.extra = extra
|
|
3397
|
+
return result
|
|
3398
|
+
|
|
3399
|
+
def newmeth(self, start):
|
|
3400
|
+
return start + self.hour + self.year
|
|
3401
|
+
|
|
3402
|
+
args = 2002, 12, 31, 4, 5, 6, 500, FixedOffset(-300, "EST", 1)
|
|
3403
|
+
|
|
3404
|
+
dt1 = self.theclass(*args)
|
|
3405
|
+
dt2 = C(*args, **{'extra': 7})
|
|
3406
|
+
|
|
3407
|
+
self.assertEqual(dt2.__class__, C)
|
|
3408
|
+
self.assertEqual(dt2.theAnswer, 42)
|
|
3409
|
+
self.assertEqual(dt2.extra, 7)
|
|
3410
|
+
self.assertEqual(dt1.utcoffset(), dt2.utcoffset())
|
|
3411
|
+
self.assertEqual(dt2.newmeth(-7), dt1.hour + dt1.year - 7)
|
|
3412
|
+
|
|
3413
|
+
# Pain to set up DST-aware tzinfo classes.
|
|
3414
|
+
|
|
3415
|
+
def first_sunday_on_or_after(dt):
|
|
3416
|
+
days_to_go = 6 - dt.weekday()
|
|
3417
|
+
if days_to_go:
|
|
3418
|
+
dt += timedelta(days_to_go)
|
|
3419
|
+
return dt
|
|
3420
|
+
|
|
3421
|
+
ZERO = timedelta(0)
|
|
3422
|
+
MINUTE = timedelta(minutes=1)
|
|
3423
|
+
HOUR = timedelta(hours=1)
|
|
3424
|
+
DAY = timedelta(days=1)
|
|
3425
|
+
# In the US, DST starts at 2am (standard time) on the first Sunday in April.
|
|
3426
|
+
DSTSTART = datetime(1, 4, 1, 2)
|
|
3427
|
+
# and ends at 2am (DST time; 1am standard time) on the last Sunday of Oct,
|
|
3428
|
+
# which is the first Sunday on or after Oct 25. Because we view 1:MM as
|
|
3429
|
+
# being standard time on that day, there is no spelling in local time of
|
|
3430
|
+
# the last hour of DST (that's 1:MM DST, but 1:MM is taken as standard time).
|
|
3431
|
+
DSTEND = datetime(1, 10, 25, 1)
|
|
3432
|
+
|
|
3433
|
+
class USTimeZone(tzinfo):
|
|
3434
|
+
|
|
3435
|
+
def __init__(self, hours, reprname, stdname, dstname):
|
|
3436
|
+
self.stdoffset = timedelta(hours=hours)
|
|
3437
|
+
self.reprname = reprname
|
|
3438
|
+
self.stdname = stdname
|
|
3439
|
+
self.dstname = dstname
|
|
3440
|
+
|
|
3441
|
+
def __repr__(self):
|
|
3442
|
+
return self.reprname
|
|
3443
|
+
|
|
3444
|
+
def tzname(self, dt):
|
|
3445
|
+
if self.dst(dt):
|
|
3446
|
+
return self.dstname
|
|
3447
|
+
else:
|
|
3448
|
+
return self.stdname
|
|
3449
|
+
|
|
3450
|
+
def utcoffset(self, dt):
|
|
3451
|
+
return self.stdoffset + self.dst(dt)
|
|
3452
|
+
|
|
3453
|
+
def dst(self, dt):
|
|
3454
|
+
if dt is None or dt.tzinfo is None:
|
|
3455
|
+
# An exception instead may be sensible here, in one or more of
|
|
3456
|
+
# the cases.
|
|
3457
|
+
return ZERO
|
|
3458
|
+
assert dt.tzinfo is self
|
|
3459
|
+
|
|
3460
|
+
# Find first Sunday in April.
|
|
3461
|
+
start = first_sunday_on_or_after(DSTSTART.replace(year=dt.year))
|
|
3462
|
+
assert start.weekday() == 6 and start.month == 4 and start.day <= 7
|
|
3463
|
+
|
|
3464
|
+
# Find last Sunday in October.
|
|
3465
|
+
end = first_sunday_on_or_after(DSTEND.replace(year=dt.year))
|
|
3466
|
+
assert end.weekday() == 6 and end.month == 10 and end.day >= 25
|
|
3467
|
+
|
|
3468
|
+
# Can't compare naive to aware objects, so strip the timezone from
|
|
3469
|
+
# dt first.
|
|
3470
|
+
if start <= dt.replace(tzinfo=None) < end:
|
|
3471
|
+
return HOUR
|
|
3472
|
+
else:
|
|
3473
|
+
return ZERO
|
|
3474
|
+
|
|
3475
|
+
Eastern = USTimeZone(-5, "Eastern", "EST", "EDT")
|
|
3476
|
+
Central = USTimeZone(-6, "Central", "CST", "CDT")
|
|
3477
|
+
Mountain = USTimeZone(-7, "Mountain", "MST", "MDT")
|
|
3478
|
+
Pacific = USTimeZone(-8, "Pacific", "PST", "PDT")
|
|
3479
|
+
utc_real = FixedOffset(0, "UTC", 0)
|
|
3480
|
+
# For better test coverage, we want another flavor of UTC that's west of
|
|
3481
|
+
# the Eastern and Pacific timezones.
|
|
3482
|
+
utc_fake = FixedOffset(-12*60, "UTCfake", 0)
|
|
3483
|
+
|
|
3484
|
+
class TestTimezoneConversions(unittest.TestCase):
|
|
3485
|
+
# The DST switch times for 2002, in std time.
|
|
3486
|
+
dston = datetime(2002, 4, 7, 2)
|
|
3487
|
+
dstoff = datetime(2002, 10, 27, 1)
|
|
3488
|
+
|
|
3489
|
+
theclass = datetime
|
|
3490
|
+
|
|
3491
|
+
# Check a time that's inside DST.
|
|
3492
|
+
def checkinside(self, dt, tz, utc, dston, dstoff):
|
|
3493
|
+
self.assertEqual(dt.dst(), HOUR)
|
|
3494
|
+
|
|
3495
|
+
# Conversion to our own timezone is always an identity.
|
|
3496
|
+
self.assertEqual(dt.astimezone(tz), dt)
|
|
3497
|
+
|
|
3498
|
+
asutc = dt.astimezone(utc)
|
|
3499
|
+
there_and_back = asutc.astimezone(tz)
|
|
3500
|
+
|
|
3501
|
+
# Conversion to UTC and back isn't always an identity here,
|
|
3502
|
+
# because there are redundant spellings (in local time) of
|
|
3503
|
+
# UTC time when DST begins: the clock jumps from 1:59:59
|
|
3504
|
+
# to 3:00:00, and a local time of 2:MM:SS doesn't really
|
|
3505
|
+
# make sense then. The classes above treat 2:MM:SS as
|
|
3506
|
+
# daylight time then (it's "after 2am"), really an alias
|
|
3507
|
+
# for 1:MM:SS standard time. The latter form is what
|
|
3508
|
+
# conversion back from UTC produces.
|
|
3509
|
+
if dt.date() == dston.date() and dt.hour == 2:
|
|
3510
|
+
# We're in the redundant hour, and coming back from
|
|
3511
|
+
# UTC gives the 1:MM:SS standard-time spelling.
|
|
3512
|
+
self.assertEqual(there_and_back + HOUR, dt)
|
|
3513
|
+
# Although during was considered to be in daylight
|
|
3514
|
+
# time, there_and_back is not.
|
|
3515
|
+
self.assertEqual(there_and_back.dst(), ZERO)
|
|
3516
|
+
# They're the same times in UTC.
|
|
3517
|
+
self.assertEqual(there_and_back.astimezone(utc),
|
|
3518
|
+
dt.astimezone(utc))
|
|
3519
|
+
else:
|
|
3520
|
+
# We're not in the redundant hour.
|
|
3521
|
+
self.assertEqual(dt, there_and_back)
|
|
3522
|
+
|
|
3523
|
+
# Because we have a redundant spelling when DST begins, there is
|
|
3524
|
+
# (unfortunately) an hour when DST ends that can't be spelled at all in
|
|
3525
|
+
# local time. When DST ends, the clock jumps from 1:59 back to 1:00
|
|
3526
|
+
# again. The hour 1:MM DST has no spelling then: 1:MM is taken to be
|
|
3527
|
+
# standard time. 1:MM DST == 0:MM EST, but 0:MM is taken to be
|
|
3528
|
+
# daylight time. The hour 1:MM daylight == 0:MM standard can't be
|
|
3529
|
+
# expressed in local time. Nevertheless, we want conversion back
|
|
3530
|
+
# from UTC to mimic the local clock's "repeat an hour" behavior.
|
|
3531
|
+
nexthour_utc = asutc + HOUR
|
|
3532
|
+
nexthour_tz = nexthour_utc.astimezone(tz)
|
|
3533
|
+
if dt.date() == dstoff.date() and dt.hour == 0:
|
|
3534
|
+
# We're in the hour before the last DST hour. The last DST hour
|
|
3535
|
+
# is ineffable. We want the conversion back to repeat 1:MM.
|
|
3536
|
+
self.assertEqual(nexthour_tz, dt.replace(hour=1))
|
|
3537
|
+
nexthour_utc += HOUR
|
|
3538
|
+
nexthour_tz = nexthour_utc.astimezone(tz)
|
|
3539
|
+
self.assertEqual(nexthour_tz, dt.replace(hour=1))
|
|
3540
|
+
else:
|
|
3541
|
+
self.assertEqual(nexthour_tz - dt, HOUR)
|
|
3542
|
+
|
|
3543
|
+
# Check a time that's outside DST.
|
|
3544
|
+
def checkoutside(self, dt, tz, utc):
|
|
3545
|
+
self.assertEqual(dt.dst(), ZERO)
|
|
3546
|
+
|
|
3547
|
+
# Conversion to our own timezone is always an identity.
|
|
3548
|
+
self.assertEqual(dt.astimezone(tz), dt)
|
|
3549
|
+
|
|
3550
|
+
# Converting to UTC and back is an identity too.
|
|
3551
|
+
asutc = dt.astimezone(utc)
|
|
3552
|
+
there_and_back = asutc.astimezone(tz)
|
|
3553
|
+
self.assertEqual(dt, there_and_back)
|
|
3554
|
+
|
|
3555
|
+
def convert_between_tz_and_utc(self, tz, utc):
|
|
3556
|
+
dston = self.dston.replace(tzinfo=tz)
|
|
3557
|
+
# Because 1:MM on the day DST ends is taken as being standard time,
|
|
3558
|
+
# there is no spelling in tz for the last hour of daylight time.
|
|
3559
|
+
# For purposes of the test, the last hour of DST is 0:MM, which is
|
|
3560
|
+
# taken as being daylight time (and 1:MM is taken as being standard
|
|
3561
|
+
# time).
|
|
3562
|
+
dstoff = self.dstoff.replace(tzinfo=tz)
|
|
3563
|
+
for delta in (timedelta(weeks=13),
|
|
3564
|
+
DAY,
|
|
3565
|
+
HOUR,
|
|
3566
|
+
timedelta(minutes=1),
|
|
3567
|
+
timedelta(microseconds=1)):
|
|
3568
|
+
|
|
3569
|
+
self.checkinside(dston, tz, utc, dston, dstoff)
|
|
3570
|
+
for during in dston + delta, dstoff - delta:
|
|
3571
|
+
self.checkinside(during, tz, utc, dston, dstoff)
|
|
3572
|
+
|
|
3573
|
+
self.checkoutside(dstoff, tz, utc)
|
|
3574
|
+
for outside in dston - delta, dstoff + delta:
|
|
3575
|
+
self.checkoutside(outside, tz, utc)
|
|
3576
|
+
|
|
3577
|
+
def test_easy(self):
|
|
3578
|
+
# Despite the name of this test, the endcases are excruciating.
|
|
3579
|
+
self.convert_between_tz_and_utc(Eastern, utc_real)
|
|
3580
|
+
self.convert_between_tz_and_utc(Pacific, utc_real)
|
|
3581
|
+
self.convert_between_tz_and_utc(Eastern, utc_fake)
|
|
3582
|
+
self.convert_between_tz_and_utc(Pacific, utc_fake)
|
|
3583
|
+
# The next is really dancing near the edge. It works because
|
|
3584
|
+
# Pacific and Eastern are far enough apart that their "problem
|
|
3585
|
+
# hours" don't overlap.
|
|
3586
|
+
self.convert_between_tz_and_utc(Eastern, Pacific)
|
|
3587
|
+
self.convert_between_tz_and_utc(Pacific, Eastern)
|
|
3588
|
+
# OTOH, these fail! Don't enable them. The difficulty is that
|
|
3589
|
+
# the edge case tests assume that every hour is representable in
|
|
3590
|
+
# the "utc" class. This is always true for a fixed-offset tzinfo
|
|
3591
|
+
# class (lke utc_real and utc_fake), but not for Eastern or Central.
|
|
3592
|
+
# For these adjacent DST-aware time zones, the range of time offsets
|
|
3593
|
+
# tested ends up creating hours in the one that aren't representable
|
|
3594
|
+
# in the other. For the same reason, we would see failures in the
|
|
3595
|
+
# Eastern vs Pacific tests too if we added 3*HOUR to the list of
|
|
3596
|
+
# offset deltas in convert_between_tz_and_utc().
|
|
3597
|
+
#
|
|
3598
|
+
# self.convert_between_tz_and_utc(Eastern, Central) # can't work
|
|
3599
|
+
# self.convert_between_tz_and_utc(Central, Eastern) # can't work
|
|
3600
|
+
|
|
3601
|
+
def test_tricky(self):
|
|
3602
|
+
# 22:00 on day before daylight starts.
|
|
3603
|
+
fourback = self.dston - timedelta(hours=4)
|
|
3604
|
+
ninewest = FixedOffset(-9*60, "-0900", 0)
|
|
3605
|
+
fourback = fourback.replace(tzinfo=ninewest)
|
|
3606
|
+
# 22:00-0900 is 7:00 UTC == 2:00 EST == 3:00 DST. Since it's "after
|
|
3607
|
+
# 2", we should get the 3 spelling.
|
|
3608
|
+
# If we plug 22:00 the day before into Eastern, it "looks like std
|
|
3609
|
+
# time", so its offset is returned as -5, and -5 - -9 = 4. Adding 4
|
|
3610
|
+
# to 22:00 lands on 2:00, which makes no sense in local time (the
|
|
3611
|
+
# local clock jumps from 1 to 3). The point here is to make sure we
|
|
3612
|
+
# get the 3 spelling.
|
|
3613
|
+
expected = self.dston.replace(hour=3)
|
|
3614
|
+
got = fourback.astimezone(Eastern).replace(tzinfo=None)
|
|
3615
|
+
self.assertEqual(expected, got)
|
|
3616
|
+
|
|
3617
|
+
# Similar, but map to 6:00 UTC == 1:00 EST == 2:00 DST. In that
|
|
3618
|
+
# case we want the 1:00 spelling.
|
|
3619
|
+
sixutc = self.dston.replace(hour=6, tzinfo=utc_real)
|
|
3620
|
+
# Now 6:00 "looks like daylight", so the offset wrt Eastern is -4,
|
|
3621
|
+
# and adding -4-0 == -4 gives the 2:00 spelling. We want the 1:00 EST
|
|
3622
|
+
# spelling.
|
|
3623
|
+
expected = self.dston.replace(hour=1)
|
|
3624
|
+
got = sixutc.astimezone(Eastern).replace(tzinfo=None)
|
|
3625
|
+
self.assertEqual(expected, got)
|
|
3626
|
+
|
|
3627
|
+
# Now on the day DST ends, we want "repeat an hour" behavior.
|
|
3628
|
+
# UTC 4:MM 5:MM 6:MM 7:MM checking these
|
|
3629
|
+
# EST 23:MM 0:MM 1:MM 2:MM
|
|
3630
|
+
# EDT 0:MM 1:MM 2:MM 3:MM
|
|
3631
|
+
# wall 0:MM 1:MM 1:MM 2:MM against these
|
|
3632
|
+
for utc in utc_real, utc_fake:
|
|
3633
|
+
for tz in Eastern, Pacific:
|
|
3634
|
+
first_std_hour = self.dstoff - timedelta(hours=2) # 23:MM
|
|
3635
|
+
# Convert that to UTC.
|
|
3636
|
+
first_std_hour -= tz.utcoffset(None)
|
|
3637
|
+
# Adjust for possibly fake UTC.
|
|
3638
|
+
asutc = first_std_hour + utc.utcoffset(None)
|
|
3639
|
+
# First UTC hour to convert; this is 4:00 when utc=utc_real &
|
|
3640
|
+
# tz=Eastern.
|
|
3641
|
+
asutcbase = asutc.replace(tzinfo=utc)
|
|
3642
|
+
for tzhour in (0, 1, 1, 2):
|
|
3643
|
+
expectedbase = self.dstoff.replace(hour=tzhour)
|
|
3644
|
+
for minute in 0, 30, 59:
|
|
3645
|
+
expected = expectedbase.replace(minute=minute)
|
|
3646
|
+
asutc = asutcbase.replace(minute=minute)
|
|
3647
|
+
astz = asutc.astimezone(tz)
|
|
3648
|
+
self.assertEqual(astz.replace(tzinfo=None), expected)
|
|
3649
|
+
asutcbase += HOUR
|
|
3650
|
+
|
|
3651
|
+
|
|
3652
|
+
def test_bogus_dst(self):
|
|
3653
|
+
class ok(tzinfo):
|
|
3654
|
+
def utcoffset(self, dt): return HOUR
|
|
3655
|
+
def dst(self, dt): return HOUR
|
|
3656
|
+
|
|
3657
|
+
now = self.theclass.now().replace(tzinfo=utc_real)
|
|
3658
|
+
# Doesn't blow up.
|
|
3659
|
+
now.astimezone(ok())
|
|
3660
|
+
|
|
3661
|
+
# Does blow up.
|
|
3662
|
+
class notok(ok):
|
|
3663
|
+
def dst(self, dt): return None
|
|
3664
|
+
self.assertRaises(ValueError, now.astimezone, notok())
|
|
3665
|
+
|
|
3666
|
+
# Sometimes blow up. In the following, tzinfo.dst()
|
|
3667
|
+
# implementation may return None or not None depending on
|
|
3668
|
+
# whether DST is assumed to be in effect. In this situation,
|
|
3669
|
+
# a ValueError should be raised by astimezone().
|
|
3670
|
+
class tricky_notok(ok):
|
|
3671
|
+
def dst(self, dt):
|
|
3672
|
+
if dt.year == 2000:
|
|
3673
|
+
return None
|
|
3674
|
+
else:
|
|
3675
|
+
return 10*HOUR
|
|
3676
|
+
dt = self.theclass(2001, 1, 1).replace(tzinfo=utc_real)
|
|
3677
|
+
self.assertRaises(ValueError, dt.astimezone, tricky_notok())
|
|
3678
|
+
|
|
3679
|
+
def test_fromutc(self):
|
|
3680
|
+
self.assertRaises(TypeError, Eastern.fromutc) # not enough args
|
|
3681
|
+
now = datetime.utcnow().replace(tzinfo=utc_real)
|
|
3682
|
+
self.assertRaises(ValueError, Eastern.fromutc, now) # wrong tzinfo
|
|
3683
|
+
now = now.replace(tzinfo=Eastern) # insert correct tzinfo
|
|
3684
|
+
enow = Eastern.fromutc(now) # doesn't blow up
|
|
3685
|
+
self.assertEqual(enow.tzinfo, Eastern) # has right tzinfo member
|
|
3686
|
+
self.assertRaises(TypeError, Eastern.fromutc, now, now) # too many args
|
|
3687
|
+
self.assertRaises(TypeError, Eastern.fromutc, date.today()) # wrong type
|
|
3688
|
+
|
|
3689
|
+
# Always converts UTC to standard time.
|
|
3690
|
+
class FauxUSTimeZone(USTimeZone):
|
|
3691
|
+
def fromutc(self, dt):
|
|
3692
|
+
return dt + self.stdoffset
|
|
3693
|
+
FEastern = FauxUSTimeZone(-5, "FEastern", "FEST", "FEDT")
|
|
3694
|
+
|
|
3695
|
+
# UTC 4:MM 5:MM 6:MM 7:MM 8:MM 9:MM
|
|
3696
|
+
# EST 23:MM 0:MM 1:MM 2:MM 3:MM 4:MM
|
|
3697
|
+
# EDT 0:MM 1:MM 2:MM 3:MM 4:MM 5:MM
|
|
3698
|
+
|
|
3699
|
+
# Check around DST start.
|
|
3700
|
+
start = self.dston.replace(hour=4, tzinfo=Eastern)
|
|
3701
|
+
fstart = start.replace(tzinfo=FEastern)
|
|
3702
|
+
for wall in 23, 0, 1, 3, 4, 5:
|
|
3703
|
+
expected = start.replace(hour=wall)
|
|
3704
|
+
if wall == 23:
|
|
3705
|
+
expected -= timedelta(days=1)
|
|
3706
|
+
got = Eastern.fromutc(start)
|
|
3707
|
+
self.assertEqual(expected, got)
|
|
3708
|
+
|
|
3709
|
+
expected = fstart + FEastern.stdoffset
|
|
3710
|
+
got = FEastern.fromutc(fstart)
|
|
3711
|
+
self.assertEqual(expected, got)
|
|
3712
|
+
|
|
3713
|
+
# Ensure astimezone() calls fromutc() too.
|
|
3714
|
+
got = fstart.replace(tzinfo=utc_real).astimezone(FEastern)
|
|
3715
|
+
self.assertEqual(expected, got)
|
|
3716
|
+
|
|
3717
|
+
start += HOUR
|
|
3718
|
+
fstart += HOUR
|
|
3719
|
+
|
|
3720
|
+
# Check around DST end.
|
|
3721
|
+
start = self.dstoff.replace(hour=4, tzinfo=Eastern)
|
|
3722
|
+
fstart = start.replace(tzinfo=FEastern)
|
|
3723
|
+
for wall in 0, 1, 1, 2, 3, 4:
|
|
3724
|
+
expected = start.replace(hour=wall)
|
|
3725
|
+
got = Eastern.fromutc(start)
|
|
3726
|
+
self.assertEqual(expected, got)
|
|
3727
|
+
|
|
3728
|
+
expected = fstart + FEastern.stdoffset
|
|
3729
|
+
got = FEastern.fromutc(fstart)
|
|
3730
|
+
self.assertEqual(expected, got)
|
|
3731
|
+
|
|
3732
|
+
# Ensure astimezone() calls fromutc() too.
|
|
3733
|
+
got = fstart.replace(tzinfo=utc_real).astimezone(FEastern)
|
|
3734
|
+
self.assertEqual(expected, got)
|
|
3735
|
+
|
|
3736
|
+
start += HOUR
|
|
3737
|
+
fstart += HOUR
|
|
3738
|
+
|
|
3739
|
+
|
|
3740
|
+
#############################################################################
|
|
3741
|
+
# oddballs
|
|
3742
|
+
|
|
3743
|
+
class Oddballs(unittest.TestCase):
|
|
3744
|
+
|
|
3745
|
+
def test_bug_1028306(self):
|
|
3746
|
+
# Trying to compare a date to a datetime should act like a mixed-
|
|
3747
|
+
# type comparison, despite that datetime is a subclass of date.
|
|
3748
|
+
as_date = date.today()
|
|
3749
|
+
as_datetime = datetime.combine(as_date, time())
|
|
3750
|
+
self.assertTrue(as_date != as_datetime)
|
|
3751
|
+
self.assertTrue(as_datetime != as_date)
|
|
3752
|
+
self.assertFalse(as_date == as_datetime)
|
|
3753
|
+
self.assertFalse(as_datetime == as_date)
|
|
3754
|
+
self.assertRaises(TypeError, lambda: as_date < as_datetime)
|
|
3755
|
+
self.assertRaises(TypeError, lambda: as_datetime < as_date)
|
|
3756
|
+
self.assertRaises(TypeError, lambda: as_date <= as_datetime)
|
|
3757
|
+
self.assertRaises(TypeError, lambda: as_datetime <= as_date)
|
|
3758
|
+
self.assertRaises(TypeError, lambda: as_date > as_datetime)
|
|
3759
|
+
self.assertRaises(TypeError, lambda: as_datetime > as_date)
|
|
3760
|
+
self.assertRaises(TypeError, lambda: as_date >= as_datetime)
|
|
3761
|
+
self.assertRaises(TypeError, lambda: as_datetime >= as_date)
|
|
3762
|
+
|
|
3763
|
+
# Neverthelss, comparison should work with the base-class (date)
|
|
3764
|
+
# projection if use of a date method is forced.
|
|
3765
|
+
self.assertEqual(as_date.__eq__(as_datetime), True)
|
|
3766
|
+
different_day = (as_date.day + 1) % 20 + 1
|
|
3767
|
+
as_different = as_datetime.replace(day= different_day)
|
|
3768
|
+
self.assertEqual(as_date.__eq__(as_different), False)
|
|
3769
|
+
|
|
3770
|
+
# And date should compare with other subclasses of date. If a
|
|
3771
|
+
# subclass wants to stop this, it's up to the subclass to do so.
|
|
3772
|
+
date_sc = SubclassDate(as_date.year, as_date.month, as_date.day)
|
|
3773
|
+
self.assertEqual(as_date, date_sc)
|
|
3774
|
+
self.assertEqual(date_sc, as_date)
|
|
3775
|
+
|
|
3776
|
+
# Ditto for datetimes.
|
|
3777
|
+
datetime_sc = SubclassDatetime(as_datetime.year, as_datetime.month,
|
|
3778
|
+
as_date.day, 0, 0, 0)
|
|
3779
|
+
self.assertEqual(as_datetime, datetime_sc)
|
|
3780
|
+
self.assertEqual(datetime_sc, as_datetime)
|
|
3781
|
+
|
|
3782
|
+
def test_main():
|
|
3783
|
+
support.run_unittest(__name__)
|
|
3784
|
+
|
|
3785
|
+
if __name__ == "__main__":
|
|
3786
|
+
test_main()
|