com.googler.python 1.1.2 → 1.1.4
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 +3 -9
- package/python3.6.2/bin/2to3 +1 -1
- package/python3.6.2/bin/2to3-3.4 +1 -1
- package/python3.6.2/bin/easy_install-3.4 +1 -1
- package/python3.6.2/bin/idle3 +1 -1
- package/python3.6.2/bin/pip3 +1 -1
- package/python3.6.2/bin/pydoc3 +1 -1
- package/python3.6.2/bin/pyvenv +1 -1
- package/python3.6.2/lib/python3.6/LICENSE.txt +254 -0
- package/python3.6.2/lib/python3.6/__future__.pyc +0 -0
- package/python3.6.2/lib/python3.6/__phello__.foo.pyc +0 -0
- package/python3.6.2/lib/python3.6/_bootlocale.pyc +0 -0
- package/python3.6.2/lib/python3.6/_collections_abc.pyc +0 -0
- package/python3.6.2/lib/python3.6/_compat_pickle.pyc +0 -0
- package/python3.6.2/lib/python3.6/_compression.pyc +0 -0
- package/python3.6.2/lib/python3.6/_dummy_thread.pyc +0 -0
- package/python3.6.2/lib/python3.6/_markupbase.pyc +0 -0
- package/python3.6.2/lib/python3.6/_osx_support.pyc +0 -0
- package/python3.6.2/lib/python3.6/_pydecimal.pyc +0 -0
- package/python3.6.2/lib/python3.6/_pyio.pyc +0 -0
- package/python3.6.2/lib/python3.6/_sitebuiltins.pyc +0 -0
- package/python3.6.2/lib/python3.6/_strptime.pyc +0 -0
- package/python3.6.2/lib/python3.6/_threading_local.pyc +0 -0
- package/python3.6.2/lib/python3.6/_weakrefset.pyc +0 -0
- package/python3.6.2/lib/python3.6/abc.pyc +0 -0
- package/python3.6.2/lib/python3.6/aifc.pyc +0 -0
- package/python3.6.2/lib/python3.6/android.pyc +0 -0
- package/python3.6.2/lib/python3.6/antigravity.pyc +0 -0
- package/python3.6.2/lib/python3.6/argparse.pyc +0 -0
- package/python3.6.2/lib/python3.6/ast.pyc +0 -0
- package/python3.6.2/lib/python3.6/asynchat.pyc +0 -0
- package/python3.6.2/lib/python3.6/asyncio/__init__.pyc +0 -0
- package/python3.6.2/lib/python3.6/asyncio/base_events.pyc +0 -0
- package/python3.6.2/lib/python3.6/asyncio/base_futures.pyc +0 -0
- package/python3.6.2/lib/python3.6/asyncio/base_subprocess.pyc +0 -0
- package/python3.6.2/lib/python3.6/asyncio/base_tasks.pyc +0 -0
- package/python3.6.2/lib/python3.6/asyncio/compat.pyc +0 -0
- package/python3.6.2/lib/python3.6/asyncio/constants.pyc +0 -0
- package/python3.6.2/lib/python3.6/asyncio/coroutines.pyc +0 -0
- package/python3.6.2/lib/python3.6/asyncio/events.pyc +0 -0
- package/python3.6.2/lib/python3.6/asyncio/futures.pyc +0 -0
- package/python3.6.2/lib/python3.6/asyncio/locks.pyc +0 -0
- package/python3.6.2/lib/python3.6/asyncio/log.pyc +0 -0
- package/python3.6.2/lib/python3.6/asyncio/proactor_events.pyc +0 -0
- package/python3.6.2/lib/python3.6/asyncio/protocols.pyc +0 -0
- package/python3.6.2/lib/python3.6/asyncio/queues.pyc +0 -0
- package/python3.6.2/lib/python3.6/asyncio/selector_events.pyc +0 -0
- package/python3.6.2/lib/python3.6/asyncio/sslproto.pyc +0 -0
- package/python3.6.2/lib/python3.6/asyncio/streams.pyc +0 -0
- package/python3.6.2/lib/python3.6/asyncio/subprocess.pyc +0 -0
- package/python3.6.2/lib/python3.6/asyncio/tasks.pyc +0 -0
- package/python3.6.2/lib/python3.6/asyncio/test_utils.pyc +0 -0
- package/python3.6.2/lib/python3.6/asyncio/transports.pyc +0 -0
- package/python3.6.2/lib/python3.6/asyncio/unix_events.pyc +0 -0
- package/python3.6.2/lib/python3.6/asyncio/windows_events.pyc +0 -0
- package/python3.6.2/lib/python3.6/asyncio/windows_utils.pyc +0 -0
- package/python3.6.2/lib/python3.6/asyncore.pyc +0 -0
- package/python3.6.2/lib/python3.6/base64.pyc +0 -0
- package/python3.6.2/lib/python3.6/bdb.pyc +0 -0
- package/python3.6.2/lib/python3.6/binhex.pyc +0 -0
- package/python3.6.2/lib/python3.6/bisect.pyc +0 -0
- package/python3.6.2/lib/python3.6/bz2.pyc +0 -0
- package/python3.6.2/lib/python3.6/cProfile.pyc +0 -0
- package/python3.6.2/lib/python3.6/calendar.pyc +0 -0
- package/python3.6.2/lib/python3.6/cgi.pyc +0 -0
- package/python3.6.2/lib/python3.6/cgitb.pyc +0 -0
- package/python3.6.2/lib/python3.6/chunk.pyc +0 -0
- package/python3.6.2/lib/python3.6/cmd.pyc +0 -0
- package/python3.6.2/lib/python3.6/code.pyc +0 -0
- package/python3.6.2/lib/python3.6/codecs.pyc +0 -0
- package/python3.6.2/lib/python3.6/codeop.pyc +0 -0
- package/python3.6.2/lib/python3.6/collections/__init__.pyc +0 -0
- package/python3.6.2/lib/python3.6/collections/abc.pyc +0 -0
- package/python3.6.2/lib/python3.6/colorsys.pyc +0 -0
- package/python3.6.2/lib/python3.6/compileall.pyc +0 -0
- package/python3.6.2/lib/python3.6/concurrent/__init__.pyc +0 -0
- package/python3.6.2/lib/python3.6/concurrent/futures/__init__.pyc +0 -0
- package/python3.6.2/lib/python3.6/concurrent/futures/_base.pyc +0 -0
- package/python3.6.2/lib/python3.6/concurrent/futures/process.pyc +0 -0
- package/python3.6.2/lib/python3.6/concurrent/futures/thread.pyc +0 -0
- package/python3.6.2/lib/python3.6/config-3.6m-arm-linux-androideabi/Makefile +1808 -0
- package/python3.6.2/lib/python3.6/config-3.6m-arm-linux-androideabi/Setup +397 -0
- package/python3.6.2/lib/python3.6/config-3.6m-arm-linux-androideabi/Setup.config +10 -0
- package/python3.6.2/lib/python3.6/config-3.6m-arm-linux-androideabi/Setup.local +1 -0
- package/python3.6.2/lib/python3.6/config-3.6m-arm-linux-androideabi/config.c +114 -0
- package/python3.6.2/lib/python3.6/config-3.6m-arm-linux-androideabi/config.c.in +67 -0
- package/python3.6.2/lib/python3.6/config-3.6m-arm-linux-androideabi/install-sh +294 -0
- package/python3.6.2/lib/python3.6/config-3.6m-arm-linux-androideabi/makesetup +296 -0
- package/python3.6.2/lib/python3.6/config-3.6m-arm-linux-androideabi/python-config.pyc +0 -0
- package/python3.6.2/lib/python3.6/config-3.6m-arm-linux-androideabi/python.o +0 -0
- package/python3.6.2/lib/python3.6/configparser.pyc +0 -0
- package/python3.6.2/lib/python3.6/contextlib.pyc +0 -0
- package/python3.6.2/lib/python3.6/copy.pyc +0 -0
- package/python3.6.2/lib/python3.6/copyreg.pyc +0 -0
- package/python3.6.2/lib/python3.6/crypt.pyc +0 -0
- package/python3.6.2/lib/python3.6/csv.pyc +0 -0
- package/python3.6.2/lib/python3.6/ctypes/__init__.pyc +0 -0
- package/python3.6.2/lib/python3.6/ctypes/_endian.pyc +0 -0
- package/python3.6.2/lib/python3.6/ctypes/macholib/__init__.pyc +0 -0
- package/python3.6.2/lib/python3.6/ctypes/macholib/dyld.pyc +0 -0
- package/python3.6.2/lib/python3.6/ctypes/macholib/dylib.pyc +0 -0
- package/python3.6.2/lib/python3.6/ctypes/macholib/framework.pyc +0 -0
- package/python3.6.2/lib/python3.6/ctypes/util.pyc +0 -0
- package/python3.6.2/lib/python3.6/ctypes/wintypes.pyc +0 -0
- package/python3.6.2/lib/python3.6/curses/__init__.pyc +0 -0
- package/python3.6.2/lib/python3.6/curses/ascii.pyc +0 -0
- package/python3.6.2/lib/python3.6/curses/has_key.pyc +0 -0
- package/python3.6.2/lib/python3.6/curses/panel.pyc +0 -0
- package/python3.6.2/lib/python3.6/curses/textpad.pyc +0 -0
- package/python3.6.2/lib/python3.6/datetime.pyc +0 -0
- package/python3.6.2/lib/python3.6/dbm/__init__.pyc +0 -0
- package/python3.6.2/lib/python3.6/dbm/dumb.pyc +0 -0
- package/python3.6.2/lib/python3.6/dbm/gnu.pyc +0 -0
- package/python3.6.2/lib/python3.6/dbm/ndbm.pyc +0 -0
- package/python3.6.2/lib/python3.6/decimal.pyc +0 -0
- package/python3.6.2/lib/python3.6/difflib.pyc +0 -0
- package/python3.6.2/lib/python3.6/dis.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/__init__.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/_msvccompiler.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/archive_util.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/bcppcompiler.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/ccompiler.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/cmd.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/command/__init__.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/command/bdist.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/command/bdist_dumb.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/command/bdist_msi.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/command/bdist_rpm.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/command/bdist_wininst.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/command/build.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/command/build_clib.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/command/build_ext.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/command/build_py.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/command/build_scripts.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/command/check.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/command/clean.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/command/config.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/command/install.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/command/install_data.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/command/install_egg_info.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/command/install_headers.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/command/install_lib.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/command/install_scripts.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/command/register.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/command/sdist.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/command/upload.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/config.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/core.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/cygwinccompiler.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/debug.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/dep_util.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/dir_util.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/dist.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/errors.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/extension.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/fancy_getopt.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/file_util.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/filelist.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/log.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/msvc9compiler.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/msvccompiler.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/spawn.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/sysconfig.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/text_file.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/unixccompiler.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/util.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/version.pyc +0 -0
- package/python3.6.2/lib/python3.6/distutils/versionpredicate.pyc +0 -0
- package/python3.6.2/lib/python3.6/doctest.pyc +0 -0
- package/python3.6.2/lib/python3.6/dummy_threading.pyc +0 -0
- package/python3.6.2/lib/python3.6/email/__init__.pyc +0 -0
- package/python3.6.2/lib/python3.6/email/_encoded_words.pyc +0 -0
- package/python3.6.2/lib/python3.6/email/_header_value_parser.pyc +0 -0
- package/python3.6.2/lib/python3.6/email/_parseaddr.pyc +0 -0
- package/python3.6.2/lib/python3.6/email/_policybase.pyc +0 -0
- package/python3.6.2/lib/python3.6/email/base64mime.pyc +0 -0
- package/python3.6.2/lib/python3.6/email/charset.pyc +0 -0
- package/python3.6.2/lib/python3.6/email/contentmanager.pyc +0 -0
- package/python3.6.2/lib/python3.6/email/encoders.pyc +0 -0
- package/python3.6.2/lib/python3.6/email/errors.pyc +0 -0
- package/python3.6.2/lib/python3.6/email/feedparser.pyc +0 -0
- package/python3.6.2/lib/python3.6/email/generator.pyc +0 -0
- package/python3.6.2/lib/python3.6/email/header.pyc +0 -0
- package/python3.6.2/lib/python3.6/email/headerregistry.pyc +0 -0
- package/python3.6.2/lib/python3.6/email/iterators.pyc +0 -0
- package/python3.6.2/lib/python3.6/email/message.pyc +0 -0
- package/python3.6.2/lib/python3.6/email/mime/__init__.pyc +0 -0
- package/python3.6.2/lib/python3.6/email/mime/application.pyc +0 -0
- package/python3.6.2/lib/python3.6/email/mime/audio.pyc +0 -0
- package/python3.6.2/lib/python3.6/email/mime/base.pyc +0 -0
- package/python3.6.2/lib/python3.6/email/mime/image.pyc +0 -0
- package/python3.6.2/lib/python3.6/email/mime/message.pyc +0 -0
- package/python3.6.2/lib/python3.6/email/mime/multipart.pyc +0 -0
- package/python3.6.2/lib/python3.6/email/mime/nonmultipart.pyc +0 -0
- package/python3.6.2/lib/python3.6/email/mime/text.pyc +0 -0
- package/python3.6.2/lib/python3.6/email/parser.pyc +0 -0
- package/python3.6.2/lib/python3.6/email/policy.pyc +0 -0
- package/python3.6.2/lib/python3.6/email/quoprimime.pyc +0 -0
- package/python3.6.2/lib/python3.6/email/utils.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/__init__.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/aliases.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/ascii.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/base64_codec.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/big5.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/big5hkscs.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/bz2_codec.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/charmap.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/cp037.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/cp1006.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/cp1026.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/cp1125.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/cp1140.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/cp1250.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/cp1251.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/cp1252.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/cp1253.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/cp1254.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/cp1255.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/cp1256.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/cp1257.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/cp1258.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/cp273.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/cp424.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/cp437.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/cp500.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/cp65001.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/cp720.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/cp737.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/cp775.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/cp850.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/cp852.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/cp855.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/cp856.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/cp857.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/cp858.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/cp860.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/cp861.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/cp862.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/cp863.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/cp864.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/cp865.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/cp866.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/cp869.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/cp874.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/cp875.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/cp932.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/cp949.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/cp950.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/euc_jis_2004.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/euc_jisx0213.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/euc_jp.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/euc_kr.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/gb18030.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/gb2312.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/gbk.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/hex_codec.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/hp_roman8.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/hz.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/idna.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/iso2022_jp.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/iso2022_jp_1.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/iso2022_jp_2.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/iso2022_jp_2004.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/iso2022_jp_3.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/iso2022_jp_ext.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/iso2022_kr.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/iso8859_1.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/iso8859_10.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/iso8859_11.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/iso8859_13.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/iso8859_14.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/iso8859_15.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/iso8859_16.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/iso8859_2.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/iso8859_3.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/iso8859_4.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/iso8859_5.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/iso8859_6.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/iso8859_7.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/iso8859_8.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/iso8859_9.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/johab.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/koi8_r.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/koi8_t.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/koi8_u.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/kz1048.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/latin_1.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/mac_arabic.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/mac_centeuro.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/mac_croatian.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/mac_cyrillic.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/mac_farsi.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/mac_greek.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/mac_iceland.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/mac_latin2.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/mac_roman.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/mac_romanian.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/mac_turkish.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/mbcs.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/oem.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/palmos.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/ptcp154.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/punycode.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/quopri_codec.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/raw_unicode_escape.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/rot_13.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/shift_jis.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/shift_jis_2004.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/shift_jisx0213.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/tis_620.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/undefined.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/unicode_escape.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/unicode_internal.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/utf_16.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/utf_16_be.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/utf_16_le.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/utf_32.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/utf_32_be.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/utf_32_le.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/utf_7.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/utf_8.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/utf_8_sig.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/uu_codec.pyc +0 -0
- package/python3.6.2/lib/python3.6/encodings/zlib_codec.pyc +0 -0
- package/python3.6.2/lib/python3.6/ensurepip/__init__.pyc +0 -0
- package/python3.6.2/lib/python3.6/ensurepip/__main__.pyc +0 -0
- package/python3.6.2/lib/python3.6/ensurepip/_uninstall.pyc +0 -0
- package/python3.6.2/lib/python3.6/enum.pyc +0 -0
- package/python3.6.2/lib/python3.6/filecmp.pyc +0 -0
- package/python3.6.2/lib/python3.6/fileinput.pyc +0 -0
- package/python3.6.2/lib/python3.6/fnmatch.pyc +0 -0
- package/python3.6.2/lib/python3.6/formatter.pyc +0 -0
- package/python3.6.2/lib/python3.6/fractions.pyc +0 -0
- package/python3.6.2/lib/python3.6/ftplib.pyc +0 -0
- package/python3.6.2/lib/python3.6/functools.pyc +0 -0
- package/python3.6.2/lib/python3.6/genericpath.pyc +0 -0
- package/python3.6.2/lib/python3.6/getopt.pyc +0 -0
- package/python3.6.2/lib/python3.6/getpass.pyc +0 -0
- package/python3.6.2/lib/python3.6/gettext.pyc +0 -0
- package/python3.6.2/lib/python3.6/glob.pyc +0 -0
- package/python3.6.2/lib/python3.6/gzip.pyc +0 -0
- package/python3.6.2/lib/python3.6/hashlib.pyc +0 -0
- package/python3.6.2/lib/python3.6/heapq.pyc +0 -0
- package/python3.6.2/lib/python3.6/hmac.pyc +0 -0
- package/python3.6.2/lib/python3.6/html/__init__.pyc +0 -0
- package/python3.6.2/lib/python3.6/html/entities.pyc +0 -0
- package/python3.6.2/lib/python3.6/html/parser.pyc +0 -0
- package/python3.6.2/lib/python3.6/http/__init__.pyc +0 -0
- package/python3.6.2/lib/python3.6/http/client.pyc +0 -0
- package/python3.6.2/lib/python3.6/http/cookiejar.pyc +0 -0
- package/python3.6.2/lib/python3.6/http/cookies.pyc +0 -0
- package/python3.6.2/lib/python3.6/http/server.pyc +0 -0
- package/python3.6.2/lib/python3.6/imaplib.pyc +0 -0
- package/python3.6.2/lib/python3.6/imghdr.pyc +0 -0
- package/python3.6.2/lib/python3.6/imp.pyc +0 -0
- package/python3.6.2/lib/python3.6/importlib/__init__.pyc +0 -0
- package/python3.6.2/lib/python3.6/importlib/_bootstrap.pyc +0 -0
- package/python3.6.2/lib/python3.6/importlib/_bootstrap_external.pyc +0 -0
- package/python3.6.2/lib/python3.6/importlib/abc.pyc +0 -0
- package/python3.6.2/lib/python3.6/importlib/machinery.pyc +0 -0
- package/python3.6.2/lib/python3.6/importlib/util.pyc +0 -0
- package/python3.6.2/lib/python3.6/inspect.pyc +0 -0
- package/python3.6.2/lib/python3.6/io.pyc +0 -0
- package/python3.6.2/lib/python3.6/ipaddress.pyc +0 -0
- package/python3.6.2/lib/python3.6/json/__init__.pyc +0 -0
- package/python3.6.2/lib/python3.6/json/decoder.pyc +0 -0
- package/python3.6.2/lib/python3.6/json/encoder.pyc +0 -0
- package/python3.6.2/lib/python3.6/json/scanner.pyc +0 -0
- package/python3.6.2/lib/python3.6/json/tool.pyc +0 -0
- package/python3.6.2/lib/python3.6/keyword.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/Grammar3.6.3.final.0.pickle +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/PatternGrammar3.6.3.final.0.pickle +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/__init__.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/__main__.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/btm_matcher.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/btm_utils.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixer_base.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixer_util.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/__init__.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_apply.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_asserts.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_basestring.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_buffer.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_dict.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_except.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_exec.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_execfile.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_exitfunc.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_filter.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_funcattrs.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_future.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_getcwdu.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_has_key.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_idioms.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_import.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_imports.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_imports2.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_input.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_intern.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_isinstance.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_itertools.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_itertools_imports.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_long.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_map.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_metaclass.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_methodattrs.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_ne.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_next.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_nonzero.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_numliterals.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_operator.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_paren.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_print.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_raise.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_raw_input.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_reduce.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_reload.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_renames.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_repr.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_set_literal.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_standarderror.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_sys_exc.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_throw.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_tuple_params.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_types.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_unicode.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_urllib.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_ws_comma.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_xrange.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_xreadlines.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_zip.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/main.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/patcomp.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/pgen2/__init__.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/pgen2/conv.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/pgen2/driver.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/pgen2/grammar.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/pgen2/literals.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/pgen2/parse.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/pgen2/pgen.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/pgen2/token.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/pgen2/tokenize.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/pygram.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/pytree.pyc +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/refactor.pyc +0 -0
- package/python3.6.2/lib/python3.6/linecache.pyc +0 -0
- package/python3.6.2/lib/python3.6/locale.pyc +0 -0
- package/python3.6.2/lib/python3.6/logging/__init__.pyc +0 -0
- package/python3.6.2/lib/python3.6/logging/config.pyc +0 -0
- package/python3.6.2/lib/python3.6/logging/handlers.pyc +0 -0
- package/python3.6.2/lib/python3.6/lzma.pyc +0 -0
- package/python3.6.2/lib/python3.6/macpath.pyc +0 -0
- package/python3.6.2/lib/python3.6/macurl2path.pyc +0 -0
- package/python3.6.2/lib/python3.6/mailbox.pyc +0 -0
- package/python3.6.2/lib/python3.6/mailcap.pyc +0 -0
- package/python3.6.2/lib/python3.6/mimetypes.pyc +0 -0
- package/python3.6.2/lib/python3.6/modulefinder.pyc +0 -0
- package/python3.6.2/lib/python3.6/multiprocessing/__init__.pyc +0 -0
- package/python3.6.2/lib/python3.6/multiprocessing/connection.pyc +0 -0
- package/python3.6.2/lib/python3.6/multiprocessing/context.pyc +0 -0
- package/python3.6.2/lib/python3.6/multiprocessing/dummy/__init__.pyc +0 -0
- package/python3.6.2/lib/python3.6/multiprocessing/dummy/connection.pyc +0 -0
- package/python3.6.2/lib/python3.6/multiprocessing/forkserver.pyc +0 -0
- package/python3.6.2/lib/python3.6/multiprocessing/heap.pyc +0 -0
- package/python3.6.2/lib/python3.6/multiprocessing/managers.pyc +0 -0
- package/python3.6.2/lib/python3.6/multiprocessing/pool.pyc +0 -0
- package/python3.6.2/lib/python3.6/multiprocessing/popen_fork.pyc +0 -0
- package/python3.6.2/lib/python3.6/multiprocessing/popen_forkserver.pyc +0 -0
- package/python3.6.2/lib/python3.6/multiprocessing/popen_spawn_posix.pyc +0 -0
- package/python3.6.2/lib/python3.6/multiprocessing/popen_spawn_win32.pyc +0 -0
- package/python3.6.2/lib/python3.6/multiprocessing/process.pyc +0 -0
- package/python3.6.2/lib/python3.6/multiprocessing/queues.pyc +0 -0
- package/python3.6.2/lib/python3.6/multiprocessing/reduction.pyc +0 -0
- package/python3.6.2/lib/python3.6/multiprocessing/resource_sharer.pyc +0 -0
- package/python3.6.2/lib/python3.6/multiprocessing/semaphore_tracker.pyc +0 -0
- package/python3.6.2/lib/python3.6/multiprocessing/sharedctypes.pyc +0 -0
- package/python3.6.2/lib/python3.6/multiprocessing/spawn.pyc +0 -0
- package/python3.6.2/lib/python3.6/multiprocessing/synchronize.pyc +0 -0
- package/python3.6.2/lib/python3.6/multiprocessing/util.pyc +0 -0
- package/python3.6.2/lib/python3.6/netrc.pyc +0 -0
- package/python3.6.2/lib/python3.6/nntplib.pyc +0 -0
- package/python3.6.2/lib/python3.6/ntpath.pyc +0 -0
- package/python3.6.2/lib/python3.6/nturl2path.pyc +0 -0
- package/python3.6.2/lib/python3.6/numbers.pyc +0 -0
- package/python3.6.2/lib/python3.6/opcode.pyc +0 -0
- package/python3.6.2/lib/python3.6/operator.pyc +0 -0
- package/python3.6.2/lib/python3.6/optparse.pyc +0 -0
- package/python3.6.2/lib/python3.6/os.pyc +0 -0
- package/python3.6.2/lib/python3.6/pathlib.pyc +0 -0
- package/python3.6.2/lib/python3.6/pdb.pyc +0 -0
- package/python3.6.2/lib/python3.6/pickle.pyc +0 -0
- package/python3.6.2/lib/python3.6/pickletools.pyc +0 -0
- package/python3.6.2/lib/python3.6/pipes.pyc +0 -0
- package/python3.6.2/lib/python3.6/pkgutil.pyc +0 -0
- package/python3.6.2/lib/python3.6/platform.pyc +0 -0
- package/python3.6.2/lib/python3.6/plistlib.pyc +0 -0
- package/python3.6.2/lib/python3.6/poplib.pyc +0 -0
- package/python3.6.2/lib/python3.6/posixpath.pyc +0 -0
- package/python3.6.2/lib/python3.6/pprint.pyc +0 -0
- package/python3.6.2/lib/python3.6/profile.pyc +0 -0
- package/python3.6.2/lib/python3.6/pstats.pyc +0 -0
- package/python3.6.2/lib/python3.6/pty.pyc +0 -0
- package/python3.6.2/lib/python3.6/py_compile.pyc +0 -0
- package/python3.6.2/lib/python3.6/pyclbr.pyc +0 -0
- package/python3.6.2/lib/python3.6/pydoc.pyc +0 -0
- package/python3.6.2/lib/python3.6/pydoc_data/__init__.pyc +0 -0
- package/python3.6.2/lib/python3.6/pydoc_data/topics.pyc +0 -0
- package/python3.6.2/lib/python3.6/queue.pyc +0 -0
- package/python3.6.2/lib/python3.6/quopri.pyc +0 -0
- package/python3.6.2/lib/python3.6/random.pyc +0 -0
- package/python3.6.2/lib/python3.6/re.pyc +0 -0
- package/python3.6.2/lib/python3.6/reprlib.pyc +0 -0
- package/python3.6.2/lib/python3.6/rlcompleter.pyc +0 -0
- package/python3.6.2/lib/python3.6/runpy.pyc +0 -0
- package/python3.6.2/lib/python3.6/sched.pyc +0 -0
- package/python3.6.2/lib/python3.6/secrets.pyc +0 -0
- package/python3.6.2/lib/python3.6/selectors.pyc +0 -0
- package/python3.6.2/lib/python3.6/shelve.pyc +0 -0
- package/python3.6.2/lib/python3.6/shlex.pyc +0 -0
- package/python3.6.2/lib/python3.6/shutil.pyc +0 -0
- package/python3.6.2/lib/python3.6/signal.pyc +0 -0
- package/python3.6.2/lib/python3.6/site.pyc +0 -0
- package/python3.6.2/lib/python3.6/smtpd.pyc +0 -0
- package/python3.6.2/lib/python3.6/smtplib.pyc +0 -0
- package/python3.6.2/lib/python3.6/sndhdr.pyc +0 -0
- package/python3.6.2/lib/python3.6/socket.pyc +0 -0
- package/python3.6.2/lib/python3.6/socketserver.pyc +0 -0
- package/python3.6.2/lib/python3.6/sqlite3/__init__.pyc +0 -0
- package/python3.6.2/lib/python3.6/sqlite3/dbapi2.pyc +0 -0
- package/python3.6.2/lib/python3.6/sqlite3/dump.pyc +0 -0
- package/python3.6.2/lib/python3.6/sre_compile.pyc +0 -0
- package/python3.6.2/lib/python3.6/sre_constants.pyc +0 -0
- package/python3.6.2/lib/python3.6/sre_parse.pyc +0 -0
- package/python3.6.2/lib/python3.6/ssl.pyc +0 -0
- package/python3.6.2/lib/python3.6/stat.pyc +0 -0
- package/python3.6.2/lib/python3.6/statistics.pyc +0 -0
- package/python3.6.2/lib/python3.6/string.pyc +0 -0
- package/python3.6.2/lib/python3.6/stringprep.pyc +0 -0
- package/python3.6.2/lib/python3.6/struct.pyc +0 -0
- package/python3.6.2/lib/python3.6/subprocess.pyc +0 -0
- package/python3.6.2/lib/python3.6/sunau.pyc +0 -0
- package/python3.6.2/lib/python3.6/symbol.pyc +0 -0
- package/python3.6.2/lib/python3.6/symtable.pyc +0 -0
- package/python3.6.2/lib/python3.6/sysconfig.pyc +0 -0
- package/python3.6.2/lib/python3.6/tabnanny.pyc +0 -0
- package/python3.6.2/lib/python3.6/tarfile.pyc +0 -0
- package/python3.6.2/lib/python3.6/telnetlib.pyc +0 -0
- package/python3.6.2/lib/python3.6/tempfile.pyc +0 -0
- package/python3.6.2/lib/python3.6/textwrap.pyc +0 -0
- package/python3.6.2/lib/python3.6/this.pyc +0 -0
- package/python3.6.2/lib/python3.6/threading.pyc +0 -0
- package/python3.6.2/lib/python3.6/timeit.pyc +0 -0
- package/python3.6.2/lib/python3.6/token.pyc +0 -0
- package/python3.6.2/lib/python3.6/tokenize.pyc +0 -0
- package/python3.6.2/lib/python3.6/trace.pyc +0 -0
- package/python3.6.2/lib/python3.6/traceback.pyc +0 -0
- package/python3.6.2/lib/python3.6/tracemalloc.pyc +0 -0
- package/python3.6.2/lib/python3.6/tty.pyc +0 -0
- package/python3.6.2/lib/python3.6/turtle.pyc +0 -0
- package/python3.6.2/lib/python3.6/types.pyc +0 -0
- package/python3.6.2/lib/python3.6/typing.pyc +0 -0
- package/python3.6.2/lib/python3.6/unittest/__init__.pyc +0 -0
- package/python3.6.2/lib/python3.6/unittest/__main__.pyc +0 -0
- package/python3.6.2/lib/python3.6/unittest/case.pyc +0 -0
- package/python3.6.2/lib/python3.6/unittest/loader.pyc +0 -0
- package/python3.6.2/lib/python3.6/unittest/main.pyc +0 -0
- package/python3.6.2/lib/python3.6/unittest/mock.pyc +0 -0
- package/python3.6.2/lib/python3.6/unittest/result.pyc +0 -0
- package/python3.6.2/lib/python3.6/unittest/runner.pyc +0 -0
- package/python3.6.2/lib/python3.6/unittest/signals.pyc +0 -0
- package/python3.6.2/lib/python3.6/unittest/suite.pyc +0 -0
- package/python3.6.2/lib/python3.6/unittest/util.pyc +0 -0
- package/python3.6.2/lib/python3.6/urllib/__init__.pyc +0 -0
- package/python3.6.2/lib/python3.6/urllib/error.pyc +0 -0
- package/python3.6.2/lib/python3.6/urllib/parse.pyc +0 -0
- package/python3.6.2/lib/python3.6/urllib/request.pyc +0 -0
- package/python3.6.2/lib/python3.6/urllib/response.pyc +0 -0
- package/python3.6.2/lib/python3.6/urllib/robotparser.pyc +0 -0
- package/python3.6.2/lib/python3.6/uu.pyc +0 -0
- package/python3.6.2/lib/python3.6/uuid.pyc +0 -0
- package/python3.6.2/lib/python3.6/venv/__init__.pyc +0 -0
- package/python3.6.2/lib/python3.6/venv/__main__.pyc +0 -0
- package/python3.6.2/lib/python3.6/warnings.pyc +0 -0
- package/python3.6.2/lib/python3.6/wave.pyc +0 -0
- package/python3.6.2/lib/python3.6/weakref.pyc +0 -0
- package/python3.6.2/lib/python3.6/webbrowser.pyc +0 -0
- package/python3.6.2/lib/python3.6/wsgiref/__init__.pyc +0 -0
- package/python3.6.2/lib/python3.6/wsgiref/handlers.pyc +0 -0
- package/python3.6.2/lib/python3.6/wsgiref/headers.pyc +0 -0
- package/python3.6.2/lib/python3.6/wsgiref/simple_server.pyc +0 -0
- package/python3.6.2/lib/python3.6/wsgiref/util.pyc +0 -0
- package/python3.6.2/lib/python3.6/wsgiref/validate.pyc +0 -0
- package/python3.6.2/lib/python3.6/xdrlib.pyc +0 -0
- package/python3.6.2/lib/python3.6/xml/__init__.pyc +0 -0
- package/python3.6.2/lib/python3.6/xml/dom/NodeFilter.pyc +0 -0
- package/python3.6.2/lib/python3.6/xml/dom/__init__.pyc +0 -0
- package/python3.6.2/lib/python3.6/xml/dom/domreg.pyc +0 -0
- package/python3.6.2/lib/python3.6/xml/dom/expatbuilder.pyc +0 -0
- package/python3.6.2/lib/python3.6/xml/dom/minicompat.pyc +0 -0
- package/python3.6.2/lib/python3.6/xml/dom/minidom.pyc +0 -0
- package/python3.6.2/lib/python3.6/xml/dom/pulldom.pyc +0 -0
- package/python3.6.2/lib/python3.6/xml/dom/xmlbuilder.pyc +0 -0
- package/python3.6.2/lib/python3.6/xml/etree/ElementInclude.pyc +0 -0
- package/python3.6.2/lib/python3.6/xml/etree/ElementPath.pyc +0 -0
- package/python3.6.2/lib/python3.6/xml/etree/ElementTree.pyc +0 -0
- package/python3.6.2/lib/python3.6/xml/etree/__init__.pyc +0 -0
- package/python3.6.2/lib/python3.6/xml/etree/cElementTree.pyc +0 -0
- package/python3.6.2/lib/python3.6/xml/parsers/__init__.pyc +0 -0
- package/python3.6.2/lib/python3.6/xml/parsers/expat.pyc +0 -0
- package/python3.6.2/lib/python3.6/xml/sax/__init__.pyc +0 -0
- package/python3.6.2/lib/python3.6/xml/sax/_exceptions.pyc +0 -0
- package/python3.6.2/lib/python3.6/xml/sax/expatreader.pyc +0 -0
- package/python3.6.2/lib/python3.6/xml/sax/handler.pyc +0 -0
- package/python3.6.2/lib/python3.6/xml/sax/saxutils.pyc +0 -0
- package/python3.6.2/lib/python3.6/xml/sax/xmlreader.pyc +0 -0
- package/python3.6.2/lib/python3.6/xmlrpc/__init__.pyc +0 -0
- package/python3.6.2/lib/python3.6/xmlrpc/client.pyc +0 -0
- package/python3.6.2/lib/python3.6/xmlrpc/server.pyc +0 -0
- package/python3.6.2/lib/python3.6/zipapp.pyc +0 -0
- package/python3.6.2/lib/python3.6/zipfile.pyc +0 -0
- package/python3.6.2/bin/idle3.4 +0 -5
- package/python3.6.2/bin/pip3.4 +0 -11
- package/python3.6.2/bin/pydoc3.4 +0 -5
- package/python3.6.2/bin/pyvenv-3.4 +0 -11
- package/python3.6.2/lib/python3.6/__future__.py +0 -140
- package/python3.6.2/lib/python3.6/__phello__.foo.py +0 -1
- package/python3.6.2/lib/python3.6/_bootlocale.py +0 -34
- package/python3.6.2/lib/python3.6/_collections_abc.py +0 -1008
- package/python3.6.2/lib/python3.6/_compat_pickle.py +0 -251
- package/python3.6.2/lib/python3.6/_compression.py +0 -152
- package/python3.6.2/lib/python3.6/_dummy_thread.py +0 -163
- package/python3.6.2/lib/python3.6/_markupbase.py +0 -395
- package/python3.6.2/lib/python3.6/_osx_support.py +0 -502
- package/python3.6.2/lib/python3.6/_pydecimal.py +0 -6449
- package/python3.6.2/lib/python3.6/_pyio.py +0 -2531
- package/python3.6.2/lib/python3.6/_sitebuiltins.py +0 -103
- package/python3.6.2/lib/python3.6/_strptime.py +0 -576
- package/python3.6.2/lib/python3.6/_threading_local.py +0 -246
- package/python3.6.2/lib/python3.6/_weakrefset.py +0 -196
- package/python3.6.2/lib/python3.6/abc.py +0 -248
- package/python3.6.2/lib/python3.6/aifc.py +0 -943
- package/python3.6.2/lib/python3.6/antigravity.py +0 -17
- package/python3.6.2/lib/python3.6/argparse.py +0 -2389
- package/python3.6.2/lib/python3.6/ast.py +0 -322
- package/python3.6.2/lib/python3.6/asynchat.py +0 -307
- package/python3.6.2/lib/python3.6/asyncio/__init__.py +0 -50
- package/python3.6.2/lib/python3.6/asyncio/base_events.py +0 -1474
- package/python3.6.2/lib/python3.6/asyncio/base_futures.py +0 -71
- package/python3.6.2/lib/python3.6/asyncio/base_subprocess.py +0 -293
- package/python3.6.2/lib/python3.6/asyncio/base_tasks.py +0 -76
- package/python3.6.2/lib/python3.6/asyncio/compat.py +0 -18
- package/python3.6.2/lib/python3.6/asyncio/constants.py +0 -12
- package/python3.6.2/lib/python3.6/asyncio/coroutines.py +0 -346
- package/python3.6.2/lib/python3.6/asyncio/events.py +0 -715
- package/python3.6.2/lib/python3.6/asyncio/futures.py +0 -439
- package/python3.6.2/lib/python3.6/asyncio/locks.py +0 -485
- package/python3.6.2/lib/python3.6/asyncio/log.py +0 -7
- package/python3.6.2/lib/python3.6/asyncio/proactor_events.py +0 -551
- package/python3.6.2/lib/python3.6/asyncio/protocols.py +0 -134
- package/python3.6.2/lib/python3.6/asyncio/queues.py +0 -259
- package/python3.6.2/lib/python3.6/asyncio/selector_events.py +0 -1141
- package/python3.6.2/lib/python3.6/asyncio/sslproto.py +0 -697
- package/python3.6.2/lib/python3.6/asyncio/streams.py +0 -701
- package/python3.6.2/lib/python3.6/asyncio/subprocess.py +0 -226
- package/python3.6.2/lib/python3.6/asyncio/tasks.py +0 -717
- package/python3.6.2/lib/python3.6/asyncio/test_utils.py +0 -519
- package/python3.6.2/lib/python3.6/asyncio/transports.py +0 -306
- package/python3.6.2/lib/python3.6/asyncio/unix_events.py +0 -1074
- package/python3.6.2/lib/python3.6/asyncio/windows_events.py +0 -779
- package/python3.6.2/lib/python3.6/asyncio/windows_utils.py +0 -224
- package/python3.6.2/lib/python3.6/asyncore.py +0 -645
- package/python3.6.2/lib/python3.6/base64.py +0 -602
- package/python3.6.2/lib/python3.6/bdb.py +0 -673
- package/python3.6.2/lib/python3.6/binhex.py +0 -479
- package/python3.6.2/lib/python3.6/bisect.py +0 -92
- package/python3.6.2/lib/python3.6/bz2.py +0 -361
- package/python3.6.2/lib/python3.6/cProfile.py +0 -160
- package/python3.6.2/lib/python3.6/calendar.py +0 -713
- package/python3.6.2/lib/python3.6/cgi.py +0 -1077
- package/python3.6.2/lib/python3.6/cgitb.py +0 -319
- package/python3.6.2/lib/python3.6/chunk.py +0 -169
- package/python3.6.2/lib/python3.6/cmd.py +0 -401
- package/python3.6.2/lib/python3.6/code.py +0 -314
- package/python3.6.2/lib/python3.6/codecs.py +0 -1113
- package/python3.6.2/lib/python3.6/codeop.py +0 -168
- package/python3.6.2/lib/python3.6/collections/__init__.py +0 -1244
- package/python3.6.2/lib/python3.6/collections/abc.py +0 -2
- package/python3.6.2/lib/python3.6/colorsys.py +0 -164
- package/python3.6.2/lib/python3.6/compileall.py +0 -295
- package/python3.6.2/lib/python3.6/concurrent/__init__.py +0 -1
- package/python3.6.2/lib/python3.6/concurrent/futures/__init__.py +0 -18
- package/python3.6.2/lib/python3.6/concurrent/futures/_base.py +0 -612
- package/python3.6.2/lib/python3.6/concurrent/futures/process.py +0 -515
- package/python3.6.2/lib/python3.6/concurrent/futures/thread.py +0 -153
- package/python3.6.2/lib/python3.6/configparser.py +0 -1342
- package/python3.6.2/lib/python3.6/contextlib.py +0 -384
- package/python3.6.2/lib/python3.6/copy.py +0 -313
- package/python3.6.2/lib/python3.6/copyreg.py +0 -206
- package/python3.6.2/lib/python3.6/crypt.py +0 -61
- package/python3.6.2/lib/python3.6/csv.py +0 -449
- package/python3.6.2/lib/python3.6/ctypes/__init__.py +0 -538
- package/python3.6.2/lib/python3.6/ctypes/_endian.py +0 -61
- package/python3.6.2/lib/python3.6/ctypes/macholib/__init__.py +0 -9
- package/python3.6.2/lib/python3.6/ctypes/macholib/dyld.py +0 -159
- package/python3.6.2/lib/python3.6/ctypes/macholib/dylib.py +0 -63
- package/python3.6.2/lib/python3.6/ctypes/macholib/framework.py +0 -65
- package/python3.6.2/lib/python3.6/ctypes/test/__init__.py +0 -14
- package/python3.6.2/lib/python3.6/ctypes/test/__main__.py +0 -4
- package/python3.6.2/lib/python3.6/ctypes/test/test_anon.py +0 -73
- package/python3.6.2/lib/python3.6/ctypes/test/test_array_in_pointer.py +0 -64
- package/python3.6.2/lib/python3.6/ctypes/test/test_arrays.py +0 -185
- package/python3.6.2/lib/python3.6/ctypes/test/test_as_parameter.py +0 -226
- package/python3.6.2/lib/python3.6/ctypes/test/test_bitfields.py +0 -290
- package/python3.6.2/lib/python3.6/ctypes/test/test_buffers.py +0 -64
- package/python3.6.2/lib/python3.6/ctypes/test/test_bytes.py +0 -65
- package/python3.6.2/lib/python3.6/ctypes/test/test_byteswap.py +0 -315
- package/python3.6.2/lib/python3.6/ctypes/test/test_callbacks.py +0 -293
- package/python3.6.2/lib/python3.6/ctypes/test/test_cast.py +0 -86
- package/python3.6.2/lib/python3.6/ctypes/test/test_cfuncs.py +0 -212
- package/python3.6.2/lib/python3.6/ctypes/test/test_checkretval.py +0 -36
- package/python3.6.2/lib/python3.6/ctypes/test/test_delattr.py +0 -21
- package/python3.6.2/lib/python3.6/ctypes/test/test_errno.py +0 -79
- package/python3.6.2/lib/python3.6/ctypes/test/test_find.py +0 -116
- package/python3.6.2/lib/python3.6/ctypes/test/test_frombuffer.py +0 -141
- package/python3.6.2/lib/python3.6/ctypes/test/test_funcptr.py +0 -132
- package/python3.6.2/lib/python3.6/ctypes/test/test_functions.py +0 -402
- package/python3.6.2/lib/python3.6/ctypes/test/test_incomplete.py +0 -42
- package/python3.6.2/lib/python3.6/ctypes/test/test_init.py +0 -40
- package/python3.6.2/lib/python3.6/ctypes/test/test_internals.py +0 -100
- package/python3.6.2/lib/python3.6/ctypes/test/test_keeprefs.py +0 -153
- package/python3.6.2/lib/python3.6/ctypes/test/test_libc.py +0 -33
- package/python3.6.2/lib/python3.6/ctypes/test/test_loading.py +0 -116
- package/python3.6.2/lib/python3.6/ctypes/test/test_macholib.py +0 -63
- package/python3.6.2/lib/python3.6/ctypes/test/test_memfunctions.py +0 -79
- package/python3.6.2/lib/python3.6/ctypes/test/test_numbers.py +0 -290
- package/python3.6.2/lib/python3.6/ctypes/test/test_objects.py +0 -67
- package/python3.6.2/lib/python3.6/ctypes/test/test_parameters.py +0 -207
- package/python3.6.2/lib/python3.6/ctypes/test/test_pep3118.py +0 -233
- package/python3.6.2/lib/python3.6/ctypes/test/test_pickling.py +0 -81
- package/python3.6.2/lib/python3.6/ctypes/test/test_pointers.py +0 -223
- package/python3.6.2/lib/python3.6/ctypes/test/test_prototypes.py +0 -222
- package/python3.6.2/lib/python3.6/ctypes/test/test_python_api.py +0 -89
- package/python3.6.2/lib/python3.6/ctypes/test/test_random_things.py +0 -74
- package/python3.6.2/lib/python3.6/ctypes/test/test_refcounts.py +0 -101
- package/python3.6.2/lib/python3.6/ctypes/test/test_repr.py +0 -29
- package/python3.6.2/lib/python3.6/ctypes/test/test_returnfuncptrs.py +0 -66
- package/python3.6.2/lib/python3.6/ctypes/test/test_simplesubclasses.py +0 -55
- package/python3.6.2/lib/python3.6/ctypes/test/test_sizes.py +0 -33
- package/python3.6.2/lib/python3.6/ctypes/test/test_slicing.py +0 -167
- package/python3.6.2/lib/python3.6/ctypes/test/test_stringptr.py +0 -77
- package/python3.6.2/lib/python3.6/ctypes/test/test_strings.py +0 -225
- package/python3.6.2/lib/python3.6/ctypes/test/test_struct_fields.py +0 -74
- package/python3.6.2/lib/python3.6/ctypes/test/test_structures.py +0 -491
- package/python3.6.2/lib/python3.6/ctypes/test/test_unaligned_structures.py +0 -45
- package/python3.6.2/lib/python3.6/ctypes/test/test_unicode.py +0 -56
- package/python3.6.2/lib/python3.6/ctypes/test/test_values.py +0 -100
- package/python3.6.2/lib/python3.6/ctypes/test/test_varsize_struct.py +0 -50
- package/python3.6.2/lib/python3.6/ctypes/test/test_win32.py +0 -147
- package/python3.6.2/lib/python3.6/ctypes/test/test_wintypes.py +0 -41
- package/python3.6.2/lib/python3.6/ctypes/util.py +0 -337
- package/python3.6.2/lib/python3.6/ctypes/wintypes.py +0 -202
- package/python3.6.2/lib/python3.6/curses/__init__.py +0 -101
- package/python3.6.2/lib/python3.6/curses/ascii.py +0 -99
- package/python3.6.2/lib/python3.6/curses/has_key.py +0 -192
- package/python3.6.2/lib/python3.6/curses/panel.py +0 -6
- package/python3.6.2/lib/python3.6/curses/textpad.py +0 -201
- package/python3.6.2/lib/python3.6/datetime.py +0 -2280
- package/python3.6.2/lib/python3.6/dbm/__init__.py +0 -188
- package/python3.6.2/lib/python3.6/dbm/dumb.py +0 -324
- package/python3.6.2/lib/python3.6/dbm/gnu.py +0 -3
- package/python3.6.2/lib/python3.6/dbm/ndbm.py +0 -3
- package/python3.6.2/lib/python3.6/decimal.py +0 -11
- package/python3.6.2/lib/python3.6/difflib.py +0 -2093
- package/python3.6.2/lib/python3.6/dis.py +0 -490
- package/python3.6.2/lib/python3.6/distutils/__init__.py +0 -13
- package/python3.6.2/lib/python3.6/distutils/_msvccompiler.py +0 -574
- package/python3.6.2/lib/python3.6/distutils/archive_util.py +0 -248
- package/python3.6.2/lib/python3.6/distutils/bcppcompiler.py +0 -393
- package/python3.6.2/lib/python3.6/distutils/ccompiler.py +0 -1115
- package/python3.6.2/lib/python3.6/distutils/cmd.py +0 -434
- package/python3.6.2/lib/python3.6/distutils/command/__init__.py +0 -31
- package/python3.6.2/lib/python3.6/distutils/command/bdist.py +0 -143
- package/python3.6.2/lib/python3.6/distutils/command/bdist_dumb.py +0 -123
- package/python3.6.2/lib/python3.6/distutils/command/bdist_msi.py +0 -741
- package/python3.6.2/lib/python3.6/distutils/command/bdist_rpm.py +0 -582
- package/python3.6.2/lib/python3.6/distutils/command/bdist_wininst.py +0 -365
- package/python3.6.2/lib/python3.6/distutils/command/build.py +0 -157
- package/python3.6.2/lib/python3.6/distutils/command/build_clib.py +0 -209
- package/python3.6.2/lib/python3.6/distutils/command/build_ext.py +0 -755
- package/python3.6.2/lib/python3.6/distutils/command/build_py.py +0 -416
- package/python3.6.2/lib/python3.6/distutils/command/build_scripts.py +0 -160
- package/python3.6.2/lib/python3.6/distutils/command/check.py +0 -145
- package/python3.6.2/lib/python3.6/distutils/command/clean.py +0 -76
- package/python3.6.2/lib/python3.6/distutils/command/config.py +0 -347
- package/python3.6.2/lib/python3.6/distutils/command/install.py +0 -656
- package/python3.6.2/lib/python3.6/distutils/command/install_data.py +0 -79
- package/python3.6.2/lib/python3.6/distutils/command/install_egg_info.py +0 -77
- package/python3.6.2/lib/python3.6/distutils/command/install_headers.py +0 -47
- package/python3.6.2/lib/python3.6/distutils/command/install_lib.py +0 -217
- package/python3.6.2/lib/python3.6/distutils/command/install_scripts.py +0 -60
- package/python3.6.2/lib/python3.6/distutils/command/register.py +0 -304
- package/python3.6.2/lib/python3.6/distutils/command/sdist.py +0 -456
- package/python3.6.2/lib/python3.6/distutils/command/upload.py +0 -201
- package/python3.6.2/lib/python3.6/distutils/command/wininst-10.0-amd64.exe +0 -0
- package/python3.6.2/lib/python3.6/distutils/command/wininst-10.0.exe +0 -0
- package/python3.6.2/lib/python3.6/distutils/command/wininst-14.0-amd64.exe +0 -0
- package/python3.6.2/lib/python3.6/distutils/command/wininst-14.0.exe +0 -0
- package/python3.6.2/lib/python3.6/distutils/command/wininst-6.0.exe +0 -0
- package/python3.6.2/lib/python3.6/distutils/command/wininst-7.1.exe +0 -0
- package/python3.6.2/lib/python3.6/distutils/command/wininst-8.0.exe +0 -0
- package/python3.6.2/lib/python3.6/distutils/command/wininst-9.0-amd64.exe +0 -0
- package/python3.6.2/lib/python3.6/distutils/command/wininst-9.0.exe +0 -0
- package/python3.6.2/lib/python3.6/distutils/config.py +0 -131
- package/python3.6.2/lib/python3.6/distutils/core.py +0 -234
- package/python3.6.2/lib/python3.6/distutils/cygwinccompiler.py +0 -405
- package/python3.6.2/lib/python3.6/distutils/debug.py +0 -5
- package/python3.6.2/lib/python3.6/distutils/dep_util.py +0 -92
- package/python3.6.2/lib/python3.6/distutils/dir_util.py +0 -210
- package/python3.6.2/lib/python3.6/distutils/dist.py +0 -1236
- package/python3.6.2/lib/python3.6/distutils/errors.py +0 -97
- package/python3.6.2/lib/python3.6/distutils/extension.py +0 -240
- package/python3.6.2/lib/python3.6/distutils/fancy_getopt.py +0 -457
- package/python3.6.2/lib/python3.6/distutils/file_util.py +0 -238
- package/python3.6.2/lib/python3.6/distutils/filelist.py +0 -327
- package/python3.6.2/lib/python3.6/distutils/log.py +0 -75
- package/python3.6.2/lib/python3.6/distutils/msvc9compiler.py +0 -791
- package/python3.6.2/lib/python3.6/distutils/msvccompiler.py +0 -643
- package/python3.6.2/lib/python3.6/distutils/spawn.py +0 -192
- package/python3.6.2/lib/python3.6/distutils/sysconfig.py +0 -532
- package/python3.6.2/lib/python3.6/distutils/tests/Setup.sample +0 -67
- package/python3.6.2/lib/python3.6/distutils/tests/__init__.py +0 -36
- package/python3.6.2/lib/python3.6/distutils/tests/support.py +0 -210
- package/python3.6.2/lib/python3.6/distutils/tests/test_archive_util.py +0 -395
- package/python3.6.2/lib/python3.6/distutils/tests/test_bdist.py +0 -50
- package/python3.6.2/lib/python3.6/distutils/tests/test_bdist_dumb.py +0 -97
- package/python3.6.2/lib/python3.6/distutils/tests/test_bdist_msi.py +0 -25
- package/python3.6.2/lib/python3.6/distutils/tests/test_bdist_rpm.py +0 -135
- package/python3.6.2/lib/python3.6/distutils/tests/test_bdist_wininst.py +0 -31
- package/python3.6.2/lib/python3.6/distutils/tests/test_build.py +0 -56
- package/python3.6.2/lib/python3.6/distutils/tests/test_build_clib.py +0 -135
- package/python3.6.2/lib/python3.6/distutils/tests/test_build_ext.py +0 -521
- package/python3.6.2/lib/python3.6/distutils/tests/test_build_py.py +0 -179
- package/python3.6.2/lib/python3.6/distutils/tests/test_build_scripts.py +0 -112
- package/python3.6.2/lib/python3.6/distutils/tests/test_check.py +0 -149
- package/python3.6.2/lib/python3.6/distutils/tests/test_clean.py +0 -49
- package/python3.6.2/lib/python3.6/distutils/tests/test_cmd.py +0 -126
- package/python3.6.2/lib/python3.6/distutils/tests/test_config.py +0 -140
- package/python3.6.2/lib/python3.6/distutils/tests/test_config_cmd.py +0 -92
- package/python3.6.2/lib/python3.6/distutils/tests/test_core.py +0 -140
- package/python3.6.2/lib/python3.6/distutils/tests/test_cygwinccompiler.py +0 -154
- package/python3.6.2/lib/python3.6/distutils/tests/test_dep_util.py +0 -80
- package/python3.6.2/lib/python3.6/distutils/tests/test_dir_util.py +0 -139
- package/python3.6.2/lib/python3.6/distutils/tests/test_dist.py +0 -456
- package/python3.6.2/lib/python3.6/distutils/tests/test_extension.py +0 -69
- package/python3.6.2/lib/python3.6/distutils/tests/test_file_util.py +0 -114
- package/python3.6.2/lib/python3.6/distutils/tests/test_filelist.py +0 -340
- package/python3.6.2/lib/python3.6/distutils/tests/test_install.py +0 -248
- package/python3.6.2/lib/python3.6/distutils/tests/test_install_data.py +0 -75
- package/python3.6.2/lib/python3.6/distutils/tests/test_install_headers.py +0 -39
- package/python3.6.2/lib/python3.6/distutils/tests/test_install_lib.py +0 -115
- package/python3.6.2/lib/python3.6/distutils/tests/test_install_scripts.py +0 -82
- package/python3.6.2/lib/python3.6/distutils/tests/test_log.py +0 -38
- package/python3.6.2/lib/python3.6/distutils/tests/test_msvc9compiler.py +0 -184
- package/python3.6.2/lib/python3.6/distutils/tests/test_msvccompiler.py +0 -132
- package/python3.6.2/lib/python3.6/distutils/tests/test_register.py +0 -323
- package/python3.6.2/lib/python3.6/distutils/tests/test_sdist.py +0 -484
- package/python3.6.2/lib/python3.6/distutils/tests/test_spawn.py +0 -58
- package/python3.6.2/lib/python3.6/distutils/tests/test_sysconfig.py +0 -198
- package/python3.6.2/lib/python3.6/distutils/tests/test_text_file.py +0 -107
- package/python3.6.2/lib/python3.6/distutils/tests/test_unixccompiler.py +0 -149
- package/python3.6.2/lib/python3.6/distutils/tests/test_upload.py +0 -181
- package/python3.6.2/lib/python3.6/distutils/tests/test_util.py +0 -300
- package/python3.6.2/lib/python3.6/distutils/tests/test_version.py +0 -71
- package/python3.6.2/lib/python3.6/distutils/tests/test_versionpredicate.py +0 -13
- package/python3.6.2/lib/python3.6/distutils/text_file.py +0 -286
- package/python3.6.2/lib/python3.6/distutils/unixccompiler.py +0 -322
- package/python3.6.2/lib/python3.6/distutils/util.py +0 -557
- package/python3.6.2/lib/python3.6/distutils/version.py +0 -343
- package/python3.6.2/lib/python3.6/distutils/versionpredicate.py +0 -166
- package/python3.6.2/lib/python3.6/doctest.py +0 -2787
- package/python3.6.2/lib/python3.6/dummy_threading.py +0 -78
- package/python3.6.2/lib/python3.6/email/__init__.py +0 -62
- package/python3.6.2/lib/python3.6/email/_encoded_words.py +0 -221
- package/python3.6.2/lib/python3.6/email/_header_value_parser.py +0 -2811
- package/python3.6.2/lib/python3.6/email/_parseaddr.py +0 -540
- package/python3.6.2/lib/python3.6/email/_policybase.py +0 -374
- package/python3.6.2/lib/python3.6/email/base64mime.py +0 -119
- package/python3.6.2/lib/python3.6/email/charset.py +0 -406
- package/python3.6.2/lib/python3.6/email/contentmanager.py +0 -250
- package/python3.6.2/lib/python3.6/email/encoders.py +0 -69
- package/python3.6.2/lib/python3.6/email/errors.py +0 -107
- package/python3.6.2/lib/python3.6/email/feedparser.py +0 -536
- package/python3.6.2/lib/python3.6/email/generator.py +0 -508
- package/python3.6.2/lib/python3.6/email/header.py +0 -578
- package/python3.6.2/lib/python3.6/email/headerregistry.py +0 -589
- package/python3.6.2/lib/python3.6/email/iterators.py +0 -71
- package/python3.6.2/lib/python3.6/email/message.py +0 -1164
- package/python3.6.2/lib/python3.6/email/mime/__init__.py +0 -0
- package/python3.6.2/lib/python3.6/email/mime/application.py +0 -37
- package/python3.6.2/lib/python3.6/email/mime/audio.py +0 -74
- package/python3.6.2/lib/python3.6/email/mime/base.py +0 -30
- package/python3.6.2/lib/python3.6/email/mime/image.py +0 -47
- package/python3.6.2/lib/python3.6/email/mime/message.py +0 -34
- package/python3.6.2/lib/python3.6/email/mime/multipart.py +0 -48
- package/python3.6.2/lib/python3.6/email/mime/nonmultipart.py +0 -22
- package/python3.6.2/lib/python3.6/email/mime/text.py +0 -42
- package/python3.6.2/lib/python3.6/email/parser.py +0 -132
- package/python3.6.2/lib/python3.6/email/policy.py +0 -223
- package/python3.6.2/lib/python3.6/email/quoprimime.py +0 -299
- package/python3.6.2/lib/python3.6/email/utils.py +0 -388
- package/python3.6.2/lib/python3.6/encodings/__init__.py +0 -169
- package/python3.6.2/lib/python3.6/encodings/aliases.py +0 -550
- package/python3.6.2/lib/python3.6/encodings/ascii.py +0 -50
- package/python3.6.2/lib/python3.6/encodings/base64_codec.py +0 -55
- package/python3.6.2/lib/python3.6/encodings/big5.py +0 -39
- package/python3.6.2/lib/python3.6/encodings/big5hkscs.py +0 -39
- package/python3.6.2/lib/python3.6/encodings/bz2_codec.py +0 -78
- package/python3.6.2/lib/python3.6/encodings/charmap.py +0 -69
- package/python3.6.2/lib/python3.6/encodings/cp037.py +0 -307
- package/python3.6.2/lib/python3.6/encodings/cp1006.py +0 -307
- package/python3.6.2/lib/python3.6/encodings/cp1026.py +0 -307
- package/python3.6.2/lib/python3.6/encodings/cp1125.py +0 -698
- package/python3.6.2/lib/python3.6/encodings/cp1140.py +0 -307
- package/python3.6.2/lib/python3.6/encodings/cp1250.py +0 -307
- package/python3.6.2/lib/python3.6/encodings/cp1251.py +0 -307
- package/python3.6.2/lib/python3.6/encodings/cp1252.py +0 -307
- package/python3.6.2/lib/python3.6/encodings/cp1253.py +0 -307
- package/python3.6.2/lib/python3.6/encodings/cp1254.py +0 -307
- package/python3.6.2/lib/python3.6/encodings/cp1255.py +0 -307
- package/python3.6.2/lib/python3.6/encodings/cp1256.py +0 -307
- package/python3.6.2/lib/python3.6/encodings/cp1257.py +0 -307
- package/python3.6.2/lib/python3.6/encodings/cp1258.py +0 -307
- package/python3.6.2/lib/python3.6/encodings/cp273.py +0 -307
- package/python3.6.2/lib/python3.6/encodings/cp424.py +0 -307
- package/python3.6.2/lib/python3.6/encodings/cp437.py +0 -698
- package/python3.6.2/lib/python3.6/encodings/cp500.py +0 -307
- package/python3.6.2/lib/python3.6/encodings/cp65001.py +0 -43
- package/python3.6.2/lib/python3.6/encodings/cp720.py +0 -309
- package/python3.6.2/lib/python3.6/encodings/cp737.py +0 -698
- package/python3.6.2/lib/python3.6/encodings/cp775.py +0 -697
- package/python3.6.2/lib/python3.6/encodings/cp850.py +0 -698
- package/python3.6.2/lib/python3.6/encodings/cp852.py +0 -698
- package/python3.6.2/lib/python3.6/encodings/cp855.py +0 -698
- package/python3.6.2/lib/python3.6/encodings/cp856.py +0 -307
- package/python3.6.2/lib/python3.6/encodings/cp857.py +0 -694
- package/python3.6.2/lib/python3.6/encodings/cp858.py +0 -698
- package/python3.6.2/lib/python3.6/encodings/cp860.py +0 -698
- package/python3.6.2/lib/python3.6/encodings/cp861.py +0 -698
- package/python3.6.2/lib/python3.6/encodings/cp862.py +0 -698
- package/python3.6.2/lib/python3.6/encodings/cp863.py +0 -698
- package/python3.6.2/lib/python3.6/encodings/cp864.py +0 -690
- package/python3.6.2/lib/python3.6/encodings/cp865.py +0 -698
- package/python3.6.2/lib/python3.6/encodings/cp866.py +0 -698
- package/python3.6.2/lib/python3.6/encodings/cp869.py +0 -689
- package/python3.6.2/lib/python3.6/encodings/cp874.py +0 -307
- package/python3.6.2/lib/python3.6/encodings/cp875.py +0 -307
- package/python3.6.2/lib/python3.6/encodings/cp932.py +0 -39
- package/python3.6.2/lib/python3.6/encodings/cp949.py +0 -39
- package/python3.6.2/lib/python3.6/encodings/cp950.py +0 -39
- package/python3.6.2/lib/python3.6/encodings/euc_jis_2004.py +0 -39
- package/python3.6.2/lib/python3.6/encodings/euc_jisx0213.py +0 -39
- package/python3.6.2/lib/python3.6/encodings/euc_jp.py +0 -39
- package/python3.6.2/lib/python3.6/encodings/euc_kr.py +0 -39
- package/python3.6.2/lib/python3.6/encodings/gb18030.py +0 -39
- package/python3.6.2/lib/python3.6/encodings/gb2312.py +0 -39
- package/python3.6.2/lib/python3.6/encodings/gbk.py +0 -39
- package/python3.6.2/lib/python3.6/encodings/hex_codec.py +0 -55
- package/python3.6.2/lib/python3.6/encodings/hp_roman8.py +0 -314
- package/python3.6.2/lib/python3.6/encodings/hz.py +0 -39
- package/python3.6.2/lib/python3.6/encodings/idna.py +0 -309
- package/python3.6.2/lib/python3.6/encodings/iso2022_jp.py +0 -39
- package/python3.6.2/lib/python3.6/encodings/iso2022_jp_1.py +0 -39
- package/python3.6.2/lib/python3.6/encodings/iso2022_jp_2.py +0 -39
- package/python3.6.2/lib/python3.6/encodings/iso2022_jp_2004.py +0 -39
- package/python3.6.2/lib/python3.6/encodings/iso2022_jp_3.py +0 -39
- package/python3.6.2/lib/python3.6/encodings/iso2022_jp_ext.py +0 -39
- package/python3.6.2/lib/python3.6/encodings/iso2022_kr.py +0 -39
- package/python3.6.2/lib/python3.6/encodings/iso8859_1.py +0 -307
- package/python3.6.2/lib/python3.6/encodings/iso8859_10.py +0 -307
- package/python3.6.2/lib/python3.6/encodings/iso8859_11.py +0 -307
- package/python3.6.2/lib/python3.6/encodings/iso8859_13.py +0 -307
- package/python3.6.2/lib/python3.6/encodings/iso8859_14.py +0 -307
- package/python3.6.2/lib/python3.6/encodings/iso8859_15.py +0 -307
- package/python3.6.2/lib/python3.6/encodings/iso8859_16.py +0 -307
- package/python3.6.2/lib/python3.6/encodings/iso8859_2.py +0 -307
- package/python3.6.2/lib/python3.6/encodings/iso8859_3.py +0 -307
- package/python3.6.2/lib/python3.6/encodings/iso8859_4.py +0 -307
- package/python3.6.2/lib/python3.6/encodings/iso8859_5.py +0 -307
- package/python3.6.2/lib/python3.6/encodings/iso8859_6.py +0 -307
- package/python3.6.2/lib/python3.6/encodings/iso8859_7.py +0 -307
- package/python3.6.2/lib/python3.6/encodings/iso8859_8.py +0 -307
- package/python3.6.2/lib/python3.6/encodings/iso8859_9.py +0 -307
- package/python3.6.2/lib/python3.6/encodings/johab.py +0 -39
- package/python3.6.2/lib/python3.6/encodings/koi8_r.py +0 -307
- package/python3.6.2/lib/python3.6/encodings/koi8_t.py +0 -308
- package/python3.6.2/lib/python3.6/encodings/koi8_u.py +0 -307
- package/python3.6.2/lib/python3.6/encodings/kz1048.py +0 -307
- package/python3.6.2/lib/python3.6/encodings/latin_1.py +0 -50
- package/python3.6.2/lib/python3.6/encodings/mac_arabic.py +0 -698
- package/python3.6.2/lib/python3.6/encodings/mac_centeuro.py +0 -307
- package/python3.6.2/lib/python3.6/encodings/mac_croatian.py +0 -307
- package/python3.6.2/lib/python3.6/encodings/mac_cyrillic.py +0 -307
- package/python3.6.2/lib/python3.6/encodings/mac_farsi.py +0 -307
- package/python3.6.2/lib/python3.6/encodings/mac_greek.py +0 -307
- package/python3.6.2/lib/python3.6/encodings/mac_iceland.py +0 -307
- package/python3.6.2/lib/python3.6/encodings/mac_latin2.py +0 -312
- package/python3.6.2/lib/python3.6/encodings/mac_roman.py +0 -307
- package/python3.6.2/lib/python3.6/encodings/mac_romanian.py +0 -307
- package/python3.6.2/lib/python3.6/encodings/mac_turkish.py +0 -307
- package/python3.6.2/lib/python3.6/encodings/mbcs.py +0 -47
- package/python3.6.2/lib/python3.6/encodings/oem.py +0 -41
- package/python3.6.2/lib/python3.6/encodings/palmos.py +0 -308
- package/python3.6.2/lib/python3.6/encodings/ptcp154.py +0 -312
- package/python3.6.2/lib/python3.6/encodings/punycode.py +0 -237
- package/python3.6.2/lib/python3.6/encodings/quopri_codec.py +0 -56
- package/python3.6.2/lib/python3.6/encodings/raw_unicode_escape.py +0 -45
- package/python3.6.2/lib/python3.6/encodings/rot_13.py +0 -113
- package/python3.6.2/lib/python3.6/encodings/shift_jis.py +0 -39
- package/python3.6.2/lib/python3.6/encodings/shift_jis_2004.py +0 -39
- package/python3.6.2/lib/python3.6/encodings/shift_jisx0213.py +0 -39
- package/python3.6.2/lib/python3.6/encodings/tis_620.py +0 -307
- package/python3.6.2/lib/python3.6/encodings/undefined.py +0 -49
- package/python3.6.2/lib/python3.6/encodings/unicode_escape.py +0 -45
- package/python3.6.2/lib/python3.6/encodings/unicode_internal.py +0 -45
- package/python3.6.2/lib/python3.6/encodings/utf_16.py +0 -155
- package/python3.6.2/lib/python3.6/encodings/utf_16_be.py +0 -42
- package/python3.6.2/lib/python3.6/encodings/utf_16_le.py +0 -42
- package/python3.6.2/lib/python3.6/encodings/utf_32.py +0 -150
- package/python3.6.2/lib/python3.6/encodings/utf_32_be.py +0 -37
- package/python3.6.2/lib/python3.6/encodings/utf_32_le.py +0 -37
- package/python3.6.2/lib/python3.6/encodings/utf_7.py +0 -38
- package/python3.6.2/lib/python3.6/encodings/utf_8.py +0 -42
- package/python3.6.2/lib/python3.6/encodings/utf_8_sig.py +0 -130
- package/python3.6.2/lib/python3.6/encodings/uu_codec.py +0 -99
- package/python3.6.2/lib/python3.6/encodings/zlib_codec.py +0 -77
- package/python3.6.2/lib/python3.6/ensurepip/__init__.py +0 -205
- package/python3.6.2/lib/python3.6/ensurepip/__main__.py +0 -5
- package/python3.6.2/lib/python3.6/ensurepip/_uninstall.py +0 -31
- package/python3.6.2/lib/python3.6/enum.py +0 -875
- package/python3.6.2/lib/python3.6/filecmp.py +0 -305
- package/python3.6.2/lib/python3.6/fileinput.py +0 -425
- package/python3.6.2/lib/python3.6/fnmatch.py +0 -109
- package/python3.6.2/lib/python3.6/formatter.py +0 -452
- package/python3.6.2/lib/python3.6/fractions.py +0 -643
- package/python3.6.2/lib/python3.6/ftplib.py +0 -989
- package/python3.6.2/lib/python3.6/functools.py +0 -811
- package/python3.6.2/lib/python3.6/genericpath.py +0 -151
- package/python3.6.2/lib/python3.6/getopt.py +0 -215
- package/python3.6.2/lib/python3.6/getpass.py +0 -185
- package/python3.6.2/lib/python3.6/gettext.py +0 -637
- package/python3.6.2/lib/python3.6/glob.py +0 -171
- package/python3.6.2/lib/python3.6/gzip.py +0 -574
- package/python3.6.2/lib/python3.6/hashlib.py +0 -251
- package/python3.6.2/lib/python3.6/heapq.py +0 -607
- package/python3.6.2/lib/python3.6/hmac.py +0 -144
- package/python3.6.2/lib/python3.6/html/__init__.py +0 -132
- package/python3.6.2/lib/python3.6/html/entities.py +0 -2509
- package/python3.6.2/lib/python3.6/html/parser.py +0 -470
- package/python3.6.2/lib/python3.6/http/__init__.py +0 -134
- package/python3.6.2/lib/python3.6/http/client.py +0 -1478
- package/python3.6.2/lib/python3.6/http/cookiejar.py +0 -2098
- package/python3.6.2/lib/python3.6/http/cookies.py +0 -635
- package/python3.6.2/lib/python3.6/http/server.py +0 -1211
- package/python3.6.2/lib/python3.6/idlelib/CREDITS.txt +0 -37
- package/python3.6.2/lib/python3.6/idlelib/ChangeLog +0 -1591
- package/python3.6.2/lib/python3.6/idlelib/HISTORY.txt +0 -296
- package/python3.6.2/lib/python3.6/idlelib/Icons/folder.gif +0 -0
- package/python3.6.2/lib/python3.6/idlelib/Icons/idle.icns +0 -0
- package/python3.6.2/lib/python3.6/idlelib/Icons/idle.ico +0 -0
- package/python3.6.2/lib/python3.6/idlelib/Icons/idle_16.gif +0 -0
- package/python3.6.2/lib/python3.6/idlelib/Icons/idle_16.png +0 -0
- package/python3.6.2/lib/python3.6/idlelib/Icons/idle_32.gif +0 -0
- package/python3.6.2/lib/python3.6/idlelib/Icons/idle_32.png +0 -0
- package/python3.6.2/lib/python3.6/idlelib/Icons/idle_48.gif +0 -0
- package/python3.6.2/lib/python3.6/idlelib/Icons/idle_48.png +0 -0
- package/python3.6.2/lib/python3.6/idlelib/Icons/minusnode.gif +0 -0
- package/python3.6.2/lib/python3.6/idlelib/Icons/openfolder.gif +0 -0
- package/python3.6.2/lib/python3.6/idlelib/Icons/plusnode.gif +0 -0
- package/python3.6.2/lib/python3.6/idlelib/Icons/python.gif +0 -0
- package/python3.6.2/lib/python3.6/idlelib/Icons/tk.gif +0 -0
- package/python3.6.2/lib/python3.6/idlelib/NEWS.txt +0 -749
- package/python3.6.2/lib/python3.6/idlelib/NEWS2x.txt +0 -660
- package/python3.6.2/lib/python3.6/idlelib/README.txt +0 -251
- package/python3.6.2/lib/python3.6/idlelib/TODO.txt +0 -210
- package/python3.6.2/lib/python3.6/idlelib/__init__.py +0 -10
- package/python3.6.2/lib/python3.6/idlelib/__main__.py +0 -8
- package/python3.6.2/lib/python3.6/idlelib/_pyclbr.py +0 -402
- package/python3.6.2/lib/python3.6/idlelib/autocomplete.py +0 -232
- package/python3.6.2/lib/python3.6/idlelib/autocomplete_w.py +0 -460
- package/python3.6.2/lib/python3.6/idlelib/autoexpand.py +0 -96
- package/python3.6.2/lib/python3.6/idlelib/browser.py +0 -248
- package/python3.6.2/lib/python3.6/idlelib/calltip_w.py +0 -164
- package/python3.6.2/lib/python3.6/idlelib/calltips.py +0 -178
- package/python3.6.2/lib/python3.6/idlelib/codecontext.py +0 -185
- package/python3.6.2/lib/python3.6/idlelib/colorizer.py +0 -289
- package/python3.6.2/lib/python3.6/idlelib/config-extensions.def +0 -65
- package/python3.6.2/lib/python3.6/idlelib/config-highlight.def +0 -93
- package/python3.6.2/lib/python3.6/idlelib/config-keys.def +0 -304
- package/python3.6.2/lib/python3.6/idlelib/config-main.def +0 -88
- package/python3.6.2/lib/python3.6/idlelib/config.py +0 -929
- package/python3.6.2/lib/python3.6/idlelib/config_key.py +0 -298
- package/python3.6.2/lib/python3.6/idlelib/configdialog.py +0 -2254
- package/python3.6.2/lib/python3.6/idlelib/debugger.py +0 -544
- package/python3.6.2/lib/python3.6/idlelib/debugger_r.py +0 -388
- package/python3.6.2/lib/python3.6/idlelib/debugobj.py +0 -139
- package/python3.6.2/lib/python3.6/idlelib/debugobj_r.py +0 -36
- package/python3.6.2/lib/python3.6/idlelib/delegator.py +0 -33
- package/python3.6.2/lib/python3.6/idlelib/dynoption.py +0 -58
- package/python3.6.2/lib/python3.6/idlelib/editor.py +0 -1688
- package/python3.6.2/lib/python3.6/idlelib/extend.txt +0 -83
- package/python3.6.2/lib/python3.6/idlelib/filelist.py +0 -132
- package/python3.6.2/lib/python3.6/idlelib/grep.py +0 -200
- package/python3.6.2/lib/python3.6/idlelib/help.html +0 -791
- package/python3.6.2/lib/python3.6/idlelib/help.py +0 -275
- package/python3.6.2/lib/python3.6/idlelib/help_about.py +0 -205
- package/python3.6.2/lib/python3.6/idlelib/history.py +0 -106
- package/python3.6.2/lib/python3.6/idlelib/hyperparser.py +0 -312
- package/python3.6.2/lib/python3.6/idlelib/idle.bat +0 -4
- package/python3.6.2/lib/python3.6/idlelib/idle.py +0 -14
- package/python3.6.2/lib/python3.6/idlelib/idle.pyw +0 -17
- package/python3.6.2/lib/python3.6/idlelib/idle_test/README.txt +0 -226
- package/python3.6.2/lib/python3.6/idlelib/idle_test/__init__.py +0 -17
- package/python3.6.2/lib/python3.6/idlelib/idle_test/htest.py +0 -421
- package/python3.6.2/lib/python3.6/idlelib/idle_test/mock_idle.py +0 -60
- package/python3.6.2/lib/python3.6/idlelib/idle_test/mock_tk.py +0 -303
- package/python3.6.2/lib/python3.6/idlelib/idle_test/test_autocomplete.py +0 -149
- package/python3.6.2/lib/python3.6/idlelib/idle_test/test_autoexpand.py +0 -143
- package/python3.6.2/lib/python3.6/idlelib/idle_test/test_browser.py +0 -253
- package/python3.6.2/lib/python3.6/idlelib/idle_test/test_calltips.py +0 -203
- package/python3.6.2/lib/python3.6/idlelib/idle_test/test_colorizer.py +0 -56
- package/python3.6.2/lib/python3.6/idlelib/idle_test/test_config.py +0 -824
- package/python3.6.2/lib/python3.6/idlelib/idle_test/test_config_key.py +0 -102
- package/python3.6.2/lib/python3.6/idlelib/idle_test/test_configdialog.py +0 -1415
- package/python3.6.2/lib/python3.6/idlelib/idle_test/test_debugger.py +0 -29
- package/python3.6.2/lib/python3.6/idlelib/idle_test/test_delegator.py +0 -40
- package/python3.6.2/lib/python3.6/idlelib/idle_test/test_editmenu.py +0 -74
- package/python3.6.2/lib/python3.6/idlelib/idle_test/test_editor.py +0 -14
- package/python3.6.2/lib/python3.6/idlelib/idle_test/test_grep.py +0 -80
- package/python3.6.2/lib/python3.6/idlelib/idle_test/test_help.py +0 -34
- package/python3.6.2/lib/python3.6/idlelib/idle_test/test_help_about.py +0 -177
- package/python3.6.2/lib/python3.6/idlelib/idle_test/test_history.py +0 -168
- package/python3.6.2/lib/python3.6/idlelib/idle_test/test_hyperparser.py +0 -274
- package/python3.6.2/lib/python3.6/idlelib/idle_test/test_iomenu.py +0 -234
- package/python3.6.2/lib/python3.6/idlelib/idle_test/test_macosx.py +0 -106
- package/python3.6.2/lib/python3.6/idlelib/idle_test/test_outwin.py +0 -172
- package/python3.6.2/lib/python3.6/idlelib/idle_test/test_paragraph.py +0 -376
- package/python3.6.2/lib/python3.6/idlelib/idle_test/test_parenmatch.py +0 -112
- package/python3.6.2/lib/python3.6/idlelib/idle_test/test_pathbrowser.py +0 -88
- package/python3.6.2/lib/python3.6/idlelib/idle_test/test_percolator.py +0 -118
- package/python3.6.2/lib/python3.6/idlelib/idle_test/test_query.py +0 -354
- package/python3.6.2/lib/python3.6/idlelib/idle_test/test_redirector.py +0 -124
- package/python3.6.2/lib/python3.6/idlelib/idle_test/test_replace.py +0 -293
- package/python3.6.2/lib/python3.6/idlelib/idle_test/test_rstrip.py +0 -49
- package/python3.6.2/lib/python3.6/idlelib/idle_test/test_run.py +0 -35
- package/python3.6.2/lib/python3.6/idlelib/idle_test/test_scrolledlist.py +0 -29
- package/python3.6.2/lib/python3.6/idlelib/idle_test/test_search.py +0 -82
- package/python3.6.2/lib/python3.6/idlelib/idle_test/test_searchbase.py +0 -156
- package/python3.6.2/lib/python3.6/idlelib/idle_test/test_searchengine.py +0 -329
- package/python3.6.2/lib/python3.6/idlelib/idle_test/test_text.py +0 -236
- package/python3.6.2/lib/python3.6/idlelib/idle_test/test_textview.py +0 -179
- package/python3.6.2/lib/python3.6/idlelib/idle_test/test_tree.py +0 -35
- package/python3.6.2/lib/python3.6/idlelib/idle_test/test_undo.py +0 -135
- package/python3.6.2/lib/python3.6/idlelib/idle_test/test_warning.py +0 -73
- package/python3.6.2/lib/python3.6/idlelib/iomenu.py +0 -574
- package/python3.6.2/lib/python3.6/idlelib/macosx.py +0 -252
- package/python3.6.2/lib/python3.6/idlelib/mainmenu.py +0 -108
- package/python3.6.2/lib/python3.6/idlelib/multicall.py +0 -445
- package/python3.6.2/lib/python3.6/idlelib/outwin.py +0 -188
- package/python3.6.2/lib/python3.6/idlelib/paragraph.py +0 -195
- package/python3.6.2/lib/python3.6/idlelib/parenmatch.py +0 -183
- package/python3.6.2/lib/python3.6/idlelib/pathbrowser.py +0 -111
- package/python3.6.2/lib/python3.6/idlelib/percolator.py +0 -104
- package/python3.6.2/lib/python3.6/idlelib/pyparse.py +0 -617
- package/python3.6.2/lib/python3.6/idlelib/pyshell.py +0 -1542
- package/python3.6.2/lib/python3.6/idlelib/query.py +0 -308
- package/python3.6.2/lib/python3.6/idlelib/redirector.py +0 -175
- package/python3.6.2/lib/python3.6/idlelib/replace.py +0 -243
- package/python3.6.2/lib/python3.6/idlelib/rpc.py +0 -627
- package/python3.6.2/lib/python3.6/idlelib/rstrip.py +0 -29
- package/python3.6.2/lib/python3.6/idlelib/run.py +0 -525
- package/python3.6.2/lib/python3.6/idlelib/runscript.py +0 -195
- package/python3.6.2/lib/python3.6/idlelib/scrolledlist.py +0 -147
- package/python3.6.2/lib/python3.6/idlelib/search.py +0 -102
- package/python3.6.2/lib/python3.6/idlelib/searchbase.py +0 -200
- package/python3.6.2/lib/python3.6/idlelib/searchengine.py +0 -236
- package/python3.6.2/lib/python3.6/idlelib/stackviewer.py +0 -152
- package/python3.6.2/lib/python3.6/idlelib/statusbar.py +0 -46
- package/python3.6.2/lib/python3.6/idlelib/textview.py +0 -136
- package/python3.6.2/lib/python3.6/idlelib/tooltip.py +0 -96
- package/python3.6.2/lib/python3.6/idlelib/tree.py +0 -467
- package/python3.6.2/lib/python3.6/idlelib/undo.py +0 -366
- package/python3.6.2/lib/python3.6/idlelib/windows.py +0 -92
- package/python3.6.2/lib/python3.6/idlelib/zoomheight.py +0 -48
- package/python3.6.2/lib/python3.6/idlelib/zzdummy.py +0 -42
- package/python3.6.2/lib/python3.6/imaplib.py +0 -1609
- package/python3.6.2/lib/python3.6/imghdr.py +0 -168
- package/python3.6.2/lib/python3.6/imp.py +0 -346
- package/python3.6.2/lib/python3.6/importlib/__init__.py +0 -173
- package/python3.6.2/lib/python3.6/importlib/_bootstrap.py +0 -1161
- package/python3.6.2/lib/python3.6/importlib/_bootstrap_external.py +0 -1443
- package/python3.6.2/lib/python3.6/importlib/abc.py +0 -329
- package/python3.6.2/lib/python3.6/importlib/machinery.py +0 -21
- package/python3.6.2/lib/python3.6/importlib/util.py +0 -288
- package/python3.6.2/lib/python3.6/inspect.py +0 -3098
- package/python3.6.2/lib/python3.6/io.py +0 -99
- package/python3.6.2/lib/python3.6/ipaddress.py +0 -2299
- package/python3.6.2/lib/python3.6/json/__init__.py +0 -367
- package/python3.6.2/lib/python3.6/json/decoder.py +0 -358
- package/python3.6.2/lib/python3.6/json/encoder.py +0 -441
- package/python3.6.2/lib/python3.6/json/scanner.py +0 -73
- package/python3.6.2/lib/python3.6/json/tool.py +0 -50
- package/python3.6.2/lib/python3.6/keyword.py +0 -94
- package/python3.6.2/lib/python3.6/lib-dynload/_asyncio.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/_bisect.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/_blake2.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/_bz2.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/_codecs_cn.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/_codecs_hk.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/_codecs_iso2022.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/_codecs_jp.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/_codecs_kr.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/_codecs_tw.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/_crypt.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/_csv.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/_ctypes.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/_ctypes_test.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/_curses.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/_curses_panel.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/_datetime.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/_elementtree.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/_hashlib.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/_heapq.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/_json.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/_lsprof.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/_md5.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/_multibytecodec.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/_multiprocessing.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/_opcode.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/_pickle.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/_posixsubprocess.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/_random.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/_sha1.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/_sha256.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/_sha3.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/_sha512.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/_socket.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/_sqlite3.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/_ssl.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/_struct.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/_sysconfigdata_m_linux_arm-linux-androideabi.py +0 -743
- package/python3.6.2/lib/python3.6/lib-dynload/_testbuffer.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/_testcapi.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/_testimportmultiple.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/_testmultiphase.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/array.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/audioop.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/binascii.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/cmath.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/fcntl.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/grp.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/math.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/mmap.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/ossaudiodev.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/parser.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/pyexpat.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/readline.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/resource.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/select.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/syslog.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/termios.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/unicodedata.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/xxlimited.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib-dynload/zlib.cpython-36m-arm-linux-androideabi.so +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/__init__.py +0 -1
- package/python3.6.2/lib/python3.6/lib2to3/__main__.py +0 -4
- package/python3.6.2/lib/python3.6/lib2to3/btm_matcher.py +0 -168
- package/python3.6.2/lib/python3.6/lib2to3/btm_utils.py +0 -281
- package/python3.6.2/lib/python3.6/lib2to3/fixer_base.py +0 -186
- package/python3.6.2/lib/python3.6/lib2to3/fixer_util.py +0 -453
- package/python3.6.2/lib/python3.6/lib2to3/fixes/__init__.py +0 -1
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_apply.py +0 -70
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_asserts.py +0 -34
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_basestring.py +0 -14
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_buffer.py +0 -22
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_dict.py +0 -106
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_except.py +0 -93
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_exec.py +0 -39
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_execfile.py +0 -52
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_exitfunc.py +0 -72
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_filter.py +0 -90
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_funcattrs.py +0 -21
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_future.py +0 -22
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_getcwdu.py +0 -19
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_has_key.py +0 -109
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_idioms.py +0 -152
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_import.py +0 -99
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_imports.py +0 -145
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_imports2.py +0 -16
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_input.py +0 -26
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_intern.py +0 -41
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_isinstance.py +0 -52
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_itertools.py +0 -43
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_itertools_imports.py +0 -57
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_long.py +0 -19
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_map.py +0 -110
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_metaclass.py +0 -228
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_methodattrs.py +0 -24
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_ne.py +0 -23
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_next.py +0 -103
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_nonzero.py +0 -21
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_numliterals.py +0 -28
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_operator.py +0 -98
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_paren.py +0 -44
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_print.py +0 -87
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_raise.py +0 -90
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_raw_input.py +0 -17
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_reduce.py +0 -35
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_reload.py +0 -38
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_renames.py +0 -70
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_repr.py +0 -23
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_set_literal.py +0 -53
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_standarderror.py +0 -18
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_sys_exc.py +0 -30
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_throw.py +0 -56
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_tuple_params.py +0 -175
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_types.py +0 -61
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_unicode.py +0 -42
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_urllib.py +0 -196
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_ws_comma.py +0 -39
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_xrange.py +0 -73
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_xreadlines.py +0 -25
- package/python3.6.2/lib/python3.6/lib2to3/fixes/fix_zip.py +0 -46
- package/python3.6.2/lib/python3.6/lib2to3/main.py +0 -268
- package/python3.6.2/lib/python3.6/lib2to3/patcomp.py +0 -205
- package/python3.6.2/lib/python3.6/lib2to3/pgen2/__init__.py +0 -4
- package/python3.6.2/lib/python3.6/lib2to3/pgen2/conv.py +0 -257
- package/python3.6.2/lib/python3.6/lib2to3/pgen2/driver.py +0 -160
- package/python3.6.2/lib/python3.6/lib2to3/pgen2/grammar.py +0 -207
- package/python3.6.2/lib/python3.6/lib2to3/pgen2/literals.py +0 -60
- package/python3.6.2/lib/python3.6/lib2to3/pgen2/parse.py +0 -201
- package/python3.6.2/lib/python3.6/lib2to3/pgen2/pgen.py +0 -386
- package/python3.6.2/lib/python3.6/lib2to3/pgen2/token.py +0 -85
- package/python3.6.2/lib/python3.6/lib2to3/pgen2/tokenize.py +0 -590
- package/python3.6.2/lib/python3.6/lib2to3/pygram.py +0 -40
- package/python3.6.2/lib/python3.6/lib2to3/pytree.py +0 -854
- package/python3.6.2/lib/python3.6/lib2to3/refactor.py +0 -744
- package/python3.6.2/lib/python3.6/lib2to3/tests/__init__.py +0 -9
- package/python3.6.2/lib/python3.6/lib2to3/tests/__main__.py +0 -4
- package/python3.6.2/lib/python3.6/lib2to3/tests/data/README +0 -6
- package/python3.6.2/lib/python3.6/lib2to3/tests/data/bom.py +0 -2
- package/python3.6.2/lib/python3.6/lib2to3/tests/data/crlf.py +0 -3
- package/python3.6.2/lib/python3.6/lib2to3/tests/data/different_encoding.py +0 -6
- package/python3.6.2/lib/python3.6/lib2to3/tests/data/false_encoding.py +0 -2
- package/python3.6.2/lib/python3.6/lib2to3/tests/data/fixers/bad_order.py +0 -5
- package/python3.6.2/lib/python3.6/lib2to3/tests/data/fixers/myfixes/__init__.py +0 -0
- package/python3.6.2/lib/python3.6/lib2to3/tests/data/fixers/myfixes/fix_explicit.py +0 -6
- package/python3.6.2/lib/python3.6/lib2to3/tests/data/fixers/myfixes/fix_first.py +0 -6
- package/python3.6.2/lib/python3.6/lib2to3/tests/data/fixers/myfixes/fix_last.py +0 -7
- package/python3.6.2/lib/python3.6/lib2to3/tests/data/fixers/myfixes/fix_parrot.py +0 -13
- package/python3.6.2/lib/python3.6/lib2to3/tests/data/fixers/myfixes/fix_preorder.py +0 -6
- package/python3.6.2/lib/python3.6/lib2to3/tests/data/fixers/no_fixer_cls.py +0 -1
- package/python3.6.2/lib/python3.6/lib2to3/tests/data/fixers/parrot_example.py +0 -2
- package/python3.6.2/lib/python3.6/lib2to3/tests/data/infinite_recursion.py +0 -2669
- package/python3.6.2/lib/python3.6/lib2to3/tests/data/py2_test_grammar.py +0 -974
- package/python3.6.2/lib/python3.6/lib2to3/tests/data/py3_test_grammar.py +0 -945
- package/python3.6.2/lib/python3.6/lib2to3/tests/pytree_idempotency.py +0 -94
- package/python3.6.2/lib/python3.6/lib2to3/tests/support.py +0 -52
- package/python3.6.2/lib/python3.6/lib2to3/tests/test_all_fixers.py +0 -27
- package/python3.6.2/lib/python3.6/lib2to3/tests/test_fixers.py +0 -4640
- package/python3.6.2/lib/python3.6/lib2to3/tests/test_main.py +0 -139
- package/python3.6.2/lib/python3.6/lib2to3/tests/test_parser.py +0 -472
- package/python3.6.2/lib/python3.6/lib2to3/tests/test_pytree.py +0 -472
- package/python3.6.2/lib/python3.6/lib2to3/tests/test_refactor.py +0 -316
- package/python3.6.2/lib/python3.6/lib2to3/tests/test_util.py +0 -591
- package/python3.6.2/lib/python3.6/linecache.py +0 -177
- package/python3.6.2/lib/python3.6/locale.py +0 -1684
- package/python3.6.2/lib/python3.6/logging/__init__.py +0 -2019
- package/python3.6.2/lib/python3.6/logging/config.py +0 -933
- package/python3.6.2/lib/python3.6/logging/handlers.py +0 -1505
- package/python3.6.2/lib/python3.6/lzma.py +0 -347
- package/python3.6.2/lib/python3.6/macpath.py +0 -211
- package/python3.6.2/lib/python3.6/macurl2path.py +0 -77
- package/python3.6.2/lib/python3.6/mailbox.py +0 -2146
- package/python3.6.2/lib/python3.6/mailcap.py +0 -275
- package/python3.6.2/lib/python3.6/mimetypes.py +0 -598
- package/python3.6.2/lib/python3.6/modulefinder.py +0 -633
- package/python3.6.2/lib/python3.6/msilib/__init__.py +0 -483
- package/python3.6.2/lib/python3.6/msilib/schema.py +0 -1007
- package/python3.6.2/lib/python3.6/msilib/sequence.py +0 -126
- package/python3.6.2/lib/python3.6/msilib/text.py +0 -129
- package/python3.6.2/lib/python3.6/multiprocessing/__init__.py +0 -38
- package/python3.6.2/lib/python3.6/multiprocessing/connection.py +0 -953
- package/python3.6.2/lib/python3.6/multiprocessing/context.py +0 -357
- package/python3.6.2/lib/python3.6/multiprocessing/dummy/__init__.py +0 -119
- package/python3.6.2/lib/python3.6/multiprocessing/dummy/connection.py +0 -73
- package/python3.6.2/lib/python3.6/multiprocessing/forkserver.py +0 -266
- package/python3.6.2/lib/python3.6/multiprocessing/heap.py +0 -254
- package/python3.6.2/lib/python3.6/multiprocessing/managers.py +0 -1160
- package/python3.6.2/lib/python3.6/multiprocessing/pool.py +0 -803
- package/python3.6.2/lib/python3.6/multiprocessing/popen_fork.py +0 -86
- package/python3.6.2/lib/python3.6/multiprocessing/popen_forkserver.py +0 -68
- package/python3.6.2/lib/python3.6/multiprocessing/popen_spawn_posix.py +0 -68
- package/python3.6.2/lib/python3.6/multiprocessing/popen_spawn_win32.py +0 -98
- package/python3.6.2/lib/python3.6/multiprocessing/process.py +0 -336
- package/python3.6.2/lib/python3.6/multiprocessing/queues.py +0 -347
- package/python3.6.2/lib/python3.6/multiprocessing/reduction.py +0 -274
- package/python3.6.2/lib/python3.6/multiprocessing/resource_sharer.py +0 -158
- package/python3.6.2/lib/python3.6/multiprocessing/semaphore_tracker.py +0 -157
- package/python3.6.2/lib/python3.6/multiprocessing/sharedctypes.py +0 -239
- package/python3.6.2/lib/python3.6/multiprocessing/spawn.py +0 -286
- package/python3.6.2/lib/python3.6/multiprocessing/synchronize.py +0 -406
- package/python3.6.2/lib/python3.6/multiprocessing/util.py +0 -406
- package/python3.6.2/lib/python3.6/netrc.py +0 -142
- package/python3.6.2/lib/python3.6/nntplib.py +0 -1147
- package/python3.6.2/lib/python3.6/ntpath.py +0 -692
- package/python3.6.2/lib/python3.6/nturl2path.py +0 -68
- package/python3.6.2/lib/python3.6/numbers.py +0 -389
- package/python3.6.2/lib/python3.6/opcode.py +0 -215
- package/python3.6.2/lib/python3.6/operator.py +0 -464
- package/python3.6.2/lib/python3.6/optparse.py +0 -1681
- package/python3.6.2/lib/python3.6/os.py +0 -1069
- package/python3.6.2/lib/python3.6/pathlib.py +0 -1434
- package/python3.6.2/lib/python3.6/pdb.py +0 -1694
- package/python3.6.2/lib/python3.6/pickle.py +0 -1605
- package/python3.6.2/lib/python3.6/pickletools.py +0 -2840
- package/python3.6.2/lib/python3.6/pipes.py +0 -247
- package/python3.6.2/lib/python3.6/pkgutil.py +0 -634
- package/python3.6.2/lib/python3.6/platform.py +0 -1400
- package/python3.6.2/lib/python3.6/plistlib.py +0 -1043
- package/python3.6.2/lib/python3.6/poplib.py +0 -478
- package/python3.6.2/lib/python3.6/posixpath.py +0 -520
- package/python3.6.2/lib/python3.6/pprint.py +0 -597
- package/python3.6.2/lib/python3.6/profile.py +0 -589
- package/python3.6.2/lib/python3.6/pstats.py +0 -697
- package/python3.6.2/lib/python3.6/pty.py +0 -170
- package/python3.6.2/lib/python3.6/py_compile.py +0 -186
- package/python3.6.2/lib/python3.6/pyclbr.py +0 -352
- package/python3.6.2/lib/python3.6/pydoc.py +0 -2663
- package/python3.6.2/lib/python3.6/pydoc_data/__init__.py +0 -0
- package/python3.6.2/lib/python3.6/pydoc_data/topics.py +0 -12951
- package/python3.6.2/lib/python3.6/queue.py +0 -246
- package/python3.6.2/lib/python3.6/quopri.py +0 -242
- package/python3.6.2/lib/python3.6/random.py +0 -768
- package/python3.6.2/lib/python3.6/re.py +0 -381
- package/python3.6.2/lib/python3.6/reprlib.py +0 -164
- package/python3.6.2/lib/python3.6/rlcompleter.py +0 -205
- package/python3.6.2/lib/python3.6/runpy.py +0 -294
- package/python3.6.2/lib/python3.6/sched.py +0 -170
- package/python3.6.2/lib/python3.6/secrets.py +0 -73
- package/python3.6.2/lib/python3.6/selectors.py +0 -611
- package/python3.6.2/lib/python3.6/shelve.py +0 -243
- package/python3.6.2/lib/python3.6/shlex.py +0 -335
- package/python3.6.2/lib/python3.6/shutil.py +0 -1153
- package/python3.6.2/lib/python3.6/signal.py +0 -79
- package/python3.6.2/lib/python3.6/site.py +0 -598
- package/python3.6.2/lib/python3.6/smtpd.py +0 -965
- package/python3.6.2/lib/python3.6/smtplib.py +0 -1115
- package/python3.6.2/lib/python3.6/sndhdr.py +0 -257
- package/python3.6.2/lib/python3.6/socket.py +0 -750
- package/python3.6.2/lib/python3.6/socketserver.py +0 -793
- package/python3.6.2/lib/python3.6/sqlite3/__init__.py +0 -23
- package/python3.6.2/lib/python3.6/sqlite3/dbapi2.py +0 -89
- package/python3.6.2/lib/python3.6/sqlite3/dump.py +0 -70
- package/python3.6.2/lib/python3.6/sqlite3/test/__init__.py +0 -0
- package/python3.6.2/lib/python3.6/sqlite3/test/dbapi.py +0 -938
- package/python3.6.2/lib/python3.6/sqlite3/test/dump.py +0 -81
- package/python3.6.2/lib/python3.6/sqlite3/test/factory.py +0 -293
- package/python3.6.2/lib/python3.6/sqlite3/test/hooks.py +0 -264
- package/python3.6.2/lib/python3.6/sqlite3/test/regression.py +0 -410
- package/python3.6.2/lib/python3.6/sqlite3/test/transactions.py +0 -214
- package/python3.6.2/lib/python3.6/sqlite3/test/types.py +0 -421
- package/python3.6.2/lib/python3.6/sqlite3/test/userfunctions.py +0 -473
- package/python3.6.2/lib/python3.6/sre_compile.py +0 -580
- package/python3.6.2/lib/python3.6/sre_constants.py +0 -233
- package/python3.6.2/lib/python3.6/sre_parse.py +0 -973
- package/python3.6.2/lib/python3.6/ssl.py +0 -1228
- package/python3.6.2/lib/python3.6/stat.py +0 -178
- package/python3.6.2/lib/python3.6/statistics.py +0 -670
- package/python3.6.2/lib/python3.6/string.py +0 -309
- package/python3.6.2/lib/python3.6/stringprep.py +0 -272
- package/python3.6.2/lib/python3.6/struct.py +0 -15
- package/python3.6.2/lib/python3.6/subprocess.py +0 -1590
- package/python3.6.2/lib/python3.6/sunau.py +0 -525
- package/python3.6.2/lib/python3.6/symbol.py +0 -115
- package/python3.6.2/lib/python3.6/symtable.py +0 -238
- package/python3.6.2/lib/python3.6/sysconfig.py +0 -721
- package/python3.6.2/lib/python3.6/tabnanny.py +0 -332
- package/python3.6.2/lib/python3.6/tarfile.py +0 -2547
- package/python3.6.2/lib/python3.6/telnetlib.py +0 -675
- package/python3.6.2/lib/python3.6/tempfile.py +0 -811
- package/python3.6.2/lib/python3.6/test/Sine-1000Hz-300ms.aif +0 -0
- package/python3.6.2/lib/python3.6/test/__init__.py +0 -1
- package/python3.6.2/lib/python3.6/test/__main__.py +0 -2
- package/python3.6.2/lib/python3.6/test/_test_multiprocessing.py +0 -4458
- package/python3.6.2/lib/python3.6/test/allsans.pem +0 -37
- package/python3.6.2/lib/python3.6/test/ann_module.py +0 -53
- package/python3.6.2/lib/python3.6/test/ann_module2.py +0 -36
- package/python3.6.2/lib/python3.6/test/ann_module3.py +0 -18
- package/python3.6.2/lib/python3.6/test/audiodata/pluck-alaw.aifc +0 -0
- package/python3.6.2/lib/python3.6/test/audiodata/pluck-pcm16.aiff +0 -0
- package/python3.6.2/lib/python3.6/test/audiodata/pluck-pcm16.au +0 -0
- package/python3.6.2/lib/python3.6/test/audiodata/pluck-pcm16.wav +0 -0
- package/python3.6.2/lib/python3.6/test/audiodata/pluck-pcm24.aiff +0 -0
- package/python3.6.2/lib/python3.6/test/audiodata/pluck-pcm24.au +0 -0
- package/python3.6.2/lib/python3.6/test/audiodata/pluck-pcm24.wav +0 -0
- package/python3.6.2/lib/python3.6/test/audiodata/pluck-pcm32.aiff +0 -0
- package/python3.6.2/lib/python3.6/test/audiodata/pluck-pcm32.au +0 -0
- package/python3.6.2/lib/python3.6/test/audiodata/pluck-pcm32.wav +0 -0
- package/python3.6.2/lib/python3.6/test/audiodata/pluck-pcm8.aiff +0 -0
- package/python3.6.2/lib/python3.6/test/audiodata/pluck-pcm8.au +0 -0
- package/python3.6.2/lib/python3.6/test/audiodata/pluck-pcm8.wav +0 -0
- package/python3.6.2/lib/python3.6/test/audiodata/pluck-ulaw.aifc +0 -0
- package/python3.6.2/lib/python3.6/test/audiodata/pluck-ulaw.au +0 -0
- package/python3.6.2/lib/python3.6/test/audiotest.au +0 -0
- package/python3.6.2/lib/python3.6/test/audiotests.py +0 -329
- package/python3.6.2/lib/python3.6/test/autotest.py +0 -5
- package/python3.6.2/lib/python3.6/test/bad_coding.py +0 -1
- package/python3.6.2/lib/python3.6/test/bad_coding2.py +0 -2
- package/python3.6.2/lib/python3.6/test/badcert.pem +0 -36
- package/python3.6.2/lib/python3.6/test/badkey.pem +0 -40
- package/python3.6.2/lib/python3.6/test/badsyntax_3131.py +0 -2
- package/python3.6.2/lib/python3.6/test/badsyntax_future10.py +0 -3
- package/python3.6.2/lib/python3.6/test/badsyntax_future3.py +0 -10
- package/python3.6.2/lib/python3.6/test/badsyntax_future4.py +0 -10
- package/python3.6.2/lib/python3.6/test/badsyntax_future5.py +0 -12
- package/python3.6.2/lib/python3.6/test/badsyntax_future6.py +0 -10
- package/python3.6.2/lib/python3.6/test/badsyntax_future7.py +0 -11
- package/python3.6.2/lib/python3.6/test/badsyntax_future8.py +0 -10
- package/python3.6.2/lib/python3.6/test/badsyntax_future9.py +0 -10
- package/python3.6.2/lib/python3.6/test/badsyntax_pep3120.py +0 -1
- package/python3.6.2/lib/python3.6/test/bisect.py +0 -167
- package/python3.6.2/lib/python3.6/test/bytecode_helper.py +0 -41
- package/python3.6.2/lib/python3.6/test/capath/4e1295a3.0 +0 -14
- package/python3.6.2/lib/python3.6/test/capath/5ed36f99.0 +0 -41
- package/python3.6.2/lib/python3.6/test/capath/6e88d7b8.0 +0 -14
- package/python3.6.2/lib/python3.6/test/capath/99d0fa06.0 +0 -41
- package/python3.6.2/lib/python3.6/test/capath/b1930218.0 +0 -21
- package/python3.6.2/lib/python3.6/test/capath/ceff1710.0 +0 -21
- package/python3.6.2/lib/python3.6/test/cfgparser.1 +0 -3
- package/python3.6.2/lib/python3.6/test/cfgparser.2 +0 -537
- package/python3.6.2/lib/python3.6/test/cfgparser.3 +0 -69
- package/python3.6.2/lib/python3.6/test/cjkencodings/big5-utf8.txt +0 -9
- package/python3.6.2/lib/python3.6/test/cjkencodings/big5.txt +0 -9
- package/python3.6.2/lib/python3.6/test/cjkencodings/big5hkscs-utf8.txt +0 -2
- package/python3.6.2/lib/python3.6/test/cjkencodings/big5hkscs.txt +0 -2
- package/python3.6.2/lib/python3.6/test/cjkencodings/cp949-utf8.txt +0 -9
- package/python3.6.2/lib/python3.6/test/cjkencodings/cp949.txt +0 -9
- package/python3.6.2/lib/python3.6/test/cjkencodings/euc_jisx0213-utf8.txt +0 -8
- package/python3.6.2/lib/python3.6/test/cjkencodings/euc_jisx0213.txt +0 -8
- package/python3.6.2/lib/python3.6/test/cjkencodings/euc_jp-utf8.txt +0 -7
- package/python3.6.2/lib/python3.6/test/cjkencodings/euc_jp.txt +0 -7
- package/python3.6.2/lib/python3.6/test/cjkencodings/euc_kr-utf8.txt +0 -7
- package/python3.6.2/lib/python3.6/test/cjkencodings/euc_kr.txt +0 -7
- package/python3.6.2/lib/python3.6/test/cjkencodings/gb18030-utf8.txt +0 -15
- package/python3.6.2/lib/python3.6/test/cjkencodings/gb18030.txt +0 -15
- package/python3.6.2/lib/python3.6/test/cjkencodings/gb2312-utf8.txt +0 -6
- package/python3.6.2/lib/python3.6/test/cjkencodings/gb2312.txt +0 -6
- package/python3.6.2/lib/python3.6/test/cjkencodings/gbk-utf8.txt +0 -14
- package/python3.6.2/lib/python3.6/test/cjkencodings/gbk.txt +0 -14
- package/python3.6.2/lib/python3.6/test/cjkencodings/hz-utf8.txt +0 -2
- package/python3.6.2/lib/python3.6/test/cjkencodings/hz.txt +0 -2
- package/python3.6.2/lib/python3.6/test/cjkencodings/iso2022_jp-utf8.txt +0 -7
- package/python3.6.2/lib/python3.6/test/cjkencodings/iso2022_jp.txt +0 -7
- package/python3.6.2/lib/python3.6/test/cjkencodings/iso2022_kr-utf8.txt +0 -7
- package/python3.6.2/lib/python3.6/test/cjkencodings/iso2022_kr.txt +0 -7
- package/python3.6.2/lib/python3.6/test/cjkencodings/johab-utf8.txt +0 -9
- package/python3.6.2/lib/python3.6/test/cjkencodings/johab.txt +0 -9
- package/python3.6.2/lib/python3.6/test/cjkencodings/shift_jis-utf8.txt +0 -7
- package/python3.6.2/lib/python3.6/test/cjkencodings/shift_jis.txt +0 -7
- package/python3.6.2/lib/python3.6/test/cjkencodings/shift_jisx0213-utf8.txt +0 -8
- package/python3.6.2/lib/python3.6/test/cjkencodings/shift_jisx0213.txt +0 -8
- package/python3.6.2/lib/python3.6/test/cmath_testcases.txt +0 -2511
- package/python3.6.2/lib/python3.6/test/coding20731.py +0 -4
- package/python3.6.2/lib/python3.6/test/crashers/README +0 -20
- package/python3.6.2/lib/python3.6/test/crashers/bogus_code_obj.py +0 -19
- package/python3.6.2/lib/python3.6/test/crashers/gc_inspection.py +0 -32
- package/python3.6.2/lib/python3.6/test/crashers/infinite_loop_re.py +0 -16
- package/python3.6.2/lib/python3.6/test/crashers/mutation_inside_cyclegc.py +0 -31
- package/python3.6.2/lib/python3.6/test/crashers/recursive_call.py +0 -15
- package/python3.6.2/lib/python3.6/test/crashers/trace_at_recursion_limit.py +0 -27
- package/python3.6.2/lib/python3.6/test/crashers/underlying_dict.py +0 -20
- package/python3.6.2/lib/python3.6/test/curses_tests.py +0 -46
- package/python3.6.2/lib/python3.6/test/data/README +0 -2
- package/python3.6.2/lib/python3.6/test/datetimetester.py +0 -4929
- package/python3.6.2/lib/python3.6/test/decimaltestdata/abs.decTest +0 -161
- package/python3.6.2/lib/python3.6/test/decimaltestdata/add.decTest +0 -2716
- package/python3.6.2/lib/python3.6/test/decimaltestdata/and.decTest +0 -338
- package/python3.6.2/lib/python3.6/test/decimaltestdata/base.decTest +0 -1411
- package/python3.6.2/lib/python3.6/test/decimaltestdata/clamp.decTest +0 -211
- package/python3.6.2/lib/python3.6/test/decimaltestdata/class.decTest +0 -131
- package/python3.6.2/lib/python3.6/test/decimaltestdata/compare.decTest +0 -758
- package/python3.6.2/lib/python3.6/test/decimaltestdata/comparetotal.decTest +0 -798
- package/python3.6.2/lib/python3.6/test/decimaltestdata/comparetotmag.decTest +0 -790
- package/python3.6.2/lib/python3.6/test/decimaltestdata/copy.decTest +0 -86
- package/python3.6.2/lib/python3.6/test/decimaltestdata/copyabs.decTest +0 -86
- package/python3.6.2/lib/python3.6/test/decimaltestdata/copynegate.decTest +0 -86
- package/python3.6.2/lib/python3.6/test/decimaltestdata/copysign.decTest +0 -177
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ddAbs.decTest +0 -126
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ddAdd.decTest +0 -1328
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ddAnd.decTest +0 -347
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ddBase.decTest +0 -1104
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ddCanonical.decTest +0 -357
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ddClass.decTest +0 -76
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ddCompare.decTest +0 -744
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ddCompareSig.decTest +0 -647
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ddCompareTotal.decTest +0 -706
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ddCompareTotalMag.decTest +0 -706
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ddCopy.decTest +0 -88
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ddCopyAbs.decTest +0 -88
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ddCopyNegate.decTest +0 -88
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ddCopySign.decTest +0 -175
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ddDivide.decTest +0 -863
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ddDivideInt.decTest +0 -449
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ddEncode.decTest +0 -495
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ddFMA.decTest +0 -1698
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ddInvert.decTest +0 -202
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ddLogB.decTest +0 -159
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ddMax.decTest +0 -322
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ddMaxMag.decTest +0 -304
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ddMin.decTest +0 -309
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ddMinMag.decTest +0 -293
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ddMinus.decTest +0 -88
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ddMultiply.decTest +0 -553
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ddNextMinus.decTest +0 -126
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ddNextPlus.decTest +0 -124
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ddNextToward.decTest +0 -374
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ddOr.decTest +0 -292
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ddPlus.decTest +0 -88
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ddQuantize.decTest +0 -833
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ddReduce.decTest +0 -182
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ddRemainder.decTest +0 -600
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ddRemainderNear.decTest +0 -629
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ddRotate.decTest +0 -262
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ddSameQuantum.decTest +0 -389
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ddScaleB.decTest +0 -243
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ddShift.decTest +0 -262
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ddSubtract.decTest +0 -629
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ddToIntegral.decTest +0 -257
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ddXor.decTest +0 -337
- package/python3.6.2/lib/python3.6/test/decimaltestdata/decDouble.decTest +0 -65
- package/python3.6.2/lib/python3.6/test/decimaltestdata/decQuad.decTest +0 -65
- package/python3.6.2/lib/python3.6/test/decimaltestdata/decSingle.decTest +0 -25
- package/python3.6.2/lib/python3.6/test/decimaltestdata/divide.decTest +0 -854
- package/python3.6.2/lib/python3.6/test/decimaltestdata/divideint.decTest +0 -486
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dqAbs.decTest +0 -126
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dqAdd.decTest +0 -1215
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dqAnd.decTest +0 -420
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dqBase.decTest +0 -1081
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dqCanonical.decTest +0 -372
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dqClass.decTest +0 -77
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dqCompare.decTest +0 -753
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dqCompareSig.decTest +0 -647
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dqCompareTotal.decTest +0 -706
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dqCompareTotalMag.decTest +0 -706
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dqCopy.decTest +0 -88
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dqCopyAbs.decTest +0 -88
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dqCopyNegate.decTest +0 -88
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dqCopySign.decTest +0 -175
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dqDivide.decTest +0 -808
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dqDivideInt.decTest +0 -453
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dqEncode.decTest +0 -477
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dqFMA.decTest +0 -1786
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dqInvert.decTest +0 -245
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dqLogB.decTest +0 -160
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dqMax.decTest +0 -322
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dqMaxMag.decTest +0 -304
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dqMin.decTest +0 -309
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dqMinMag.decTest +0 -293
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dqMinus.decTest +0 -88
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dqMultiply.decTest +0 -589
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dqNextMinus.decTest +0 -126
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dqNextPlus.decTest +0 -124
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dqNextToward.decTest +0 -375
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dqOr.decTest +0 -401
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dqPlus.decTest +0 -88
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dqQuantize.decTest +0 -836
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dqReduce.decTest +0 -183
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dqRemainder.decTest +0 -597
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dqRemainderNear.decTest +0 -631
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dqRotate.decTest +0 -298
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dqSameQuantum.decTest +0 -389
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dqScaleB.decTest +0 -260
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dqShift.decTest +0 -298
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dqSubtract.decTest +0 -635
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dqToIntegral.decTest +0 -257
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dqXor.decTest +0 -410
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dsBase.decTest +0 -1062
- package/python3.6.2/lib/python3.6/test/decimaltestdata/dsEncode.decTest +0 -372
- package/python3.6.2/lib/python3.6/test/decimaltestdata/exp.decTest +0 -674
- package/python3.6.2/lib/python3.6/test/decimaltestdata/extra.decTest +0 -2830
- package/python3.6.2/lib/python3.6/test/decimaltestdata/fma.decTest +0 -3426
- package/python3.6.2/lib/python3.6/test/decimaltestdata/inexact.decTest +0 -215
- package/python3.6.2/lib/python3.6/test/decimaltestdata/invert.decTest +0 -176
- package/python3.6.2/lib/python3.6/test/decimaltestdata/ln.decTest +0 -611
- package/python3.6.2/lib/python3.6/test/decimaltestdata/log10.decTest +0 -551
- package/python3.6.2/lib/python3.6/test/decimaltestdata/logb.decTest +0 -188
- package/python3.6.2/lib/python3.6/test/decimaltestdata/max.decTest +0 -424
- package/python3.6.2/lib/python3.6/test/decimaltestdata/maxmag.decTest +0 -404
- package/python3.6.2/lib/python3.6/test/decimaltestdata/min.decTest +0 -407
- package/python3.6.2/lib/python3.6/test/decimaltestdata/minmag.decTest +0 -390
- package/python3.6.2/lib/python3.6/test/decimaltestdata/minus.decTest +0 -182
- package/python3.6.2/lib/python3.6/test/decimaltestdata/multiply.decTest +0 -731
- package/python3.6.2/lib/python3.6/test/decimaltestdata/nextminus.decTest +0 -148
- package/python3.6.2/lib/python3.6/test/decimaltestdata/nextplus.decTest +0 -150
- package/python3.6.2/lib/python3.6/test/decimaltestdata/nexttoward.decTest +0 -426
- package/python3.6.2/lib/python3.6/test/decimaltestdata/or.decTest +0 -334
- package/python3.6.2/lib/python3.6/test/decimaltestdata/plus.decTest +0 -195
- package/python3.6.2/lib/python3.6/test/decimaltestdata/power.decTest +0 -1624
- package/python3.6.2/lib/python3.6/test/decimaltestdata/powersqrt.decTest +0 -2970
- package/python3.6.2/lib/python3.6/test/decimaltestdata/quantize.decTest +0 -948
- package/python3.6.2/lib/python3.6/test/decimaltestdata/randomBound32.decTest +0 -2443
- package/python3.6.2/lib/python3.6/test/decimaltestdata/randoms.decTest +0 -4030
- package/python3.6.2/lib/python3.6/test/decimaltestdata/reduce.decTest +0 -234
- package/python3.6.2/lib/python3.6/test/decimaltestdata/remainder.decTest +0 -640
- package/python3.6.2/lib/python3.6/test/decimaltestdata/remainderNear.decTest +0 -572
- package/python3.6.2/lib/python3.6/test/decimaltestdata/rescale.decTest +0 -764
- package/python3.6.2/lib/python3.6/test/decimaltestdata/rotate.decTest +0 -247
- package/python3.6.2/lib/python3.6/test/decimaltestdata/rounding.decTest +0 -1303
- package/python3.6.2/lib/python3.6/test/decimaltestdata/samequantum.decTest +0 -389
- package/python3.6.2/lib/python3.6/test/decimaltestdata/scaleb.decTest +0 -209
- package/python3.6.2/lib/python3.6/test/decimaltestdata/shift.decTest +0 -250
- package/python3.6.2/lib/python3.6/test/decimaltestdata/squareroot.decTest +0 -3834
- package/python3.6.2/lib/python3.6/test/decimaltestdata/subtract.decTest +0 -873
- package/python3.6.2/lib/python3.6/test/decimaltestdata/testall.decTest +0 -87
- package/python3.6.2/lib/python3.6/test/decimaltestdata/tointegral.decTest +0 -241
- package/python3.6.2/lib/python3.6/test/decimaltestdata/tointegralx.decTest +0 -255
- package/python3.6.2/lib/python3.6/test/decimaltestdata/xor.decTest +0 -335
- package/python3.6.2/lib/python3.6/test/dh1024.pem +0 -7
- package/python3.6.2/lib/python3.6/test/dis_module.py +0 -5
- package/python3.6.2/lib/python3.6/test/doctest_aliases.py +0 -13
- package/python3.6.2/lib/python3.6/test/double_const.py +0 -30
- package/python3.6.2/lib/python3.6/test/dtracedata/assert_usable.d +0 -5
- package/python3.6.2/lib/python3.6/test/dtracedata/assert_usable.stp +0 -5
- package/python3.6.2/lib/python3.6/test/dtracedata/call_stack.d +0 -31
- package/python3.6.2/lib/python3.6/test/dtracedata/call_stack.d.expected +0 -18
- package/python3.6.2/lib/python3.6/test/dtracedata/call_stack.py +0 -30
- package/python3.6.2/lib/python3.6/test/dtracedata/call_stack.stp +0 -41
- package/python3.6.2/lib/python3.6/test/dtracedata/call_stack.stp.expected +0 -14
- package/python3.6.2/lib/python3.6/test/dtracedata/gc.d +0 -18
- package/python3.6.2/lib/python3.6/test/dtracedata/gc.d.expected +0 -8
- package/python3.6.2/lib/python3.6/test/dtracedata/gc.py +0 -13
- package/python3.6.2/lib/python3.6/test/dtracedata/gc.stp +0 -26
- package/python3.6.2/lib/python3.6/test/dtracedata/gc.stp.expected +0 -8
- package/python3.6.2/lib/python3.6/test/dtracedata/instance.py +0 -24
- package/python3.6.2/lib/python3.6/test/dtracedata/line.d +0 -7
- package/python3.6.2/lib/python3.6/test/dtracedata/line.d.expected +0 -20
- package/python3.6.2/lib/python3.6/test/dtracedata/line.py +0 -17
- package/python3.6.2/lib/python3.6/test/eintrdata/eintr_tester.py +0 -493
- package/python3.6.2/lib/python3.6/test/empty.vbs +0 -1
- package/python3.6.2/lib/python3.6/test/encoded_modules/__init__.py +0 -23
- package/python3.6.2/lib/python3.6/test/encoded_modules/module_iso_8859_1.py +0 -5
- package/python3.6.2/lib/python3.6/test/encoded_modules/module_koi8_r.py +0 -3
- package/python3.6.2/lib/python3.6/test/exception_hierarchy.txt +0 -64
- package/python3.6.2/lib/python3.6/test/final_a.py +0 -19
- package/python3.6.2/lib/python3.6/test/final_b.py +0 -19
- package/python3.6.2/lib/python3.6/test/floating_points.txt +0 -1028
- package/python3.6.2/lib/python3.6/test/fork_wait.py +0 -91
- package/python3.6.2/lib/python3.6/test/formatfloat_testcases.txt +0 -355
- package/python3.6.2/lib/python3.6/test/future_test1.py +0 -11
- package/python3.6.2/lib/python3.6/test/future_test2.py +0 -10
- package/python3.6.2/lib/python3.6/test/gdb_sample.py +0 -12
- package/python3.6.2/lib/python3.6/test/ieee754.txt +0 -185
- package/python3.6.2/lib/python3.6/test/imghdrdata/python.bmp +0 -0
- package/python3.6.2/lib/python3.6/test/imghdrdata/python.exr +0 -0
- package/python3.6.2/lib/python3.6/test/imghdrdata/python.gif +0 -0
- package/python3.6.2/lib/python3.6/test/imghdrdata/python.jpg +0 -0
- package/python3.6.2/lib/python3.6/test/imghdrdata/python.pbm +0 -3
- package/python3.6.2/lib/python3.6/test/imghdrdata/python.pgm +0 -0
- package/python3.6.2/lib/python3.6/test/imghdrdata/python.png +0 -0
- package/python3.6.2/lib/python3.6/test/imghdrdata/python.ppm +0 -0
- package/python3.6.2/lib/python3.6/test/imghdrdata/python.ras +0 -0
- package/python3.6.2/lib/python3.6/test/imghdrdata/python.sgi +0 -0
- package/python3.6.2/lib/python3.6/test/imghdrdata/python.tiff +0 -0
- package/python3.6.2/lib/python3.6/test/imghdrdata/python.webp +0 -0
- package/python3.6.2/lib/python3.6/test/imghdrdata/python.xbm +0 -6
- package/python3.6.2/lib/python3.6/test/imp_dummy.py +0 -3
- package/python3.6.2/lib/python3.6/test/inspect_fodder.py +0 -76
- package/python3.6.2/lib/python3.6/test/inspect_fodder2.py +0 -139
- package/python3.6.2/lib/python3.6/test/keycert.passwd.pem +0 -33
- package/python3.6.2/lib/python3.6/test/keycert.pem +0 -31
- package/python3.6.2/lib/python3.6/test/keycert2.pem +0 -31
- package/python3.6.2/lib/python3.6/test/keycert3.pem +0 -73
- package/python3.6.2/lib/python3.6/test/keycert4.pem +0 -73
- package/python3.6.2/lib/python3.6/test/leakers/README.txt +0 -32
- package/python3.6.2/lib/python3.6/test/leakers/__init__.py +0 -0
- package/python3.6.2/lib/python3.6/test/leakers/test_ctypes.py +0 -15
- package/python3.6.2/lib/python3.6/test/leakers/test_selftype.py +0 -13
- package/python3.6.2/lib/python3.6/test/libregrtest/__init__.py +0 -5
- package/python3.6.2/lib/python3.6/test/libregrtest/cmdline.py +0 -387
- package/python3.6.2/lib/python3.6/test/libregrtest/main.py +0 -584
- package/python3.6.2/lib/python3.6/test/libregrtest/refleak.py +0 -294
- package/python3.6.2/lib/python3.6/test/libregrtest/runtest.py +0 -254
- package/python3.6.2/lib/python3.6/test/libregrtest/runtest_mp.py +0 -244
- package/python3.6.2/lib/python3.6/test/libregrtest/save_env.py +0 -284
- package/python3.6.2/lib/python3.6/test/libregrtest/setup.py +0 -140
- package/python3.6.2/lib/python3.6/test/list_tests.py +0 -618
- package/python3.6.2/lib/python3.6/test/lock_tests.py +0 -936
- package/python3.6.2/lib/python3.6/test/mailcap.txt +0 -39
- package/python3.6.2/lib/python3.6/test/make_ssl_certs.py +0 -216
- package/python3.6.2/lib/python3.6/test/mapping_tests.py +0 -657
- package/python3.6.2/lib/python3.6/test/math_testcases.txt +0 -633
- package/python3.6.2/lib/python3.6/test/memory_watchdog.py +0 -28
- package/python3.6.2/lib/python3.6/test/mime.types +0 -1445
- package/python3.6.2/lib/python3.6/test/mock_socket.py +0 -159
- package/python3.6.2/lib/python3.6/test/mod_generics_cache.py +0 -53
- package/python3.6.2/lib/python3.6/test/mp_fork_bomb.py +0 -18
- package/python3.6.2/lib/python3.6/test/mp_preload.py +0 -18
- package/python3.6.2/lib/python3.6/test/multibytecodec_support.py +0 -384
- package/python3.6.2/lib/python3.6/test/nokia.pem +0 -31
- package/python3.6.2/lib/python3.6/test/nullbytecert.pem +0 -90
- package/python3.6.2/lib/python3.6/test/nullcert.pem +0 -0
- package/python3.6.2/lib/python3.6/test/outstanding_bugs.py +0 -18
- package/python3.6.2/lib/python3.6/test/pickletester.py +0 -2922
- package/python3.6.2/lib/python3.6/test/profilee.py +0 -115
- package/python3.6.2/lib/python3.6/test/pstats.pck +0 -0
- package/python3.6.2/lib/python3.6/test/pycacert.pem +0 -78
- package/python3.6.2/lib/python3.6/test/pycakey.pem +0 -28
- package/python3.6.2/lib/python3.6/test/pyclbr_input.py +0 -33
- package/python3.6.2/lib/python3.6/test/pydoc_mod.py +0 -37
- package/python3.6.2/lib/python3.6/test/pydocfodder.py +0 -216
- package/python3.6.2/lib/python3.6/test/pystone.py +0 -277
- package/python3.6.2/lib/python3.6/test/pythoninfo.py +0 -486
- package/python3.6.2/lib/python3.6/test/randv2_32.pck +0 -633
- package/python3.6.2/lib/python3.6/test/randv2_64.pck +0 -633
- package/python3.6.2/lib/python3.6/test/randv3.pck +0 -633
- package/python3.6.2/lib/python3.6/test/re_tests.py +0 -670
- package/python3.6.2/lib/python3.6/test/regrtest.py +0 -50
- package/python3.6.2/lib/python3.6/test/relimport.py +0 -1
- package/python3.6.2/lib/python3.6/test/reperf.py +0 -23
- package/python3.6.2/lib/python3.6/test/revocation.crl +0 -11
- package/python3.6.2/lib/python3.6/test/sample_doctest.py +0 -76
- package/python3.6.2/lib/python3.6/test/sample_doctest_no_docstrings.py +0 -12
- package/python3.6.2/lib/python3.6/test/sample_doctest_no_doctests.py +0 -15
- package/python3.6.2/lib/python3.6/test/selfsigned_pythontestdotnet.pem +0 -16
- package/python3.6.2/lib/python3.6/test/seq_tests.py +0 -414
- package/python3.6.2/lib/python3.6/test/sgml_input.html +0 -212
- package/python3.6.2/lib/python3.6/test/signalinterproctester.py +0 -84
- package/python3.6.2/lib/python3.6/test/sndhdrdata/README +0 -5
- package/python3.6.2/lib/python3.6/test/sndhdrdata/sndhdr.8svx +0 -0
- package/python3.6.2/lib/python3.6/test/sndhdrdata/sndhdr.aifc +0 -0
- package/python3.6.2/lib/python3.6/test/sndhdrdata/sndhdr.aiff +0 -0
- package/python3.6.2/lib/python3.6/test/sndhdrdata/sndhdr.au +0 -0
- package/python3.6.2/lib/python3.6/test/sndhdrdata/sndhdr.hcom +0 -0
- package/python3.6.2/lib/python3.6/test/sndhdrdata/sndhdr.sndt +0 -0
- package/python3.6.2/lib/python3.6/test/sndhdrdata/sndhdr.voc +0 -0
- package/python3.6.2/lib/python3.6/test/sndhdrdata/sndhdr.wav +0 -0
- package/python3.6.2/lib/python3.6/test/sortperf.py +0 -169
- package/python3.6.2/lib/python3.6/test/ssl_cert.pem +0 -15
- package/python3.6.2/lib/python3.6/test/ssl_key.passwd.pem +0 -18
- package/python3.6.2/lib/python3.6/test/ssl_key.pem +0 -16
- package/python3.6.2/lib/python3.6/test/ssl_servers.py +0 -209
- package/python3.6.2/lib/python3.6/test/ssltests.py +0 -37
- package/python3.6.2/lib/python3.6/test/string_tests.py +0 -1383
- package/python3.6.2/lib/python3.6/test/subprocessdata/fd_status.py +0 -34
- package/python3.6.2/lib/python3.6/test/subprocessdata/input_reader.py +0 -7
- package/python3.6.2/lib/python3.6/test/subprocessdata/qcat.py +0 -7
- package/python3.6.2/lib/python3.6/test/subprocessdata/qgrep.py +0 -10
- package/python3.6.2/lib/python3.6/test/subprocessdata/sigchild_ignore.py +0 -15
- package/python3.6.2/lib/python3.6/test/support/__init__.py +0 -2706
- package/python3.6.2/lib/python3.6/test/support/script_helper.py +0 -259
- package/python3.6.2/lib/python3.6/test/test___all__.py +0 -109
- package/python3.6.2/lib/python3.6/test/test___future__.py +0 -61
- package/python3.6.2/lib/python3.6/test/test__locale.py +0 -193
- package/python3.6.2/lib/python3.6/test/test__opcode.py +0 -20
- package/python3.6.2/lib/python3.6/test/test__osx_support.py +0 -276
- package/python3.6.2/lib/python3.6/test/test_abc.py +0 -420
- package/python3.6.2/lib/python3.6/test/test_abstract_numbers.py +0 -44
- package/python3.6.2/lib/python3.6/test/test_aifc.py +0 -399
- package/python3.6.2/lib/python3.6/test/test_argparse.py +0 -5006
- package/python3.6.2/lib/python3.6/test/test_array.py +0 -1388
- package/python3.6.2/lib/python3.6/test/test_asdl_parser.py +0 -122
- package/python3.6.2/lib/python3.6/test/test_ast.py +0 -1170
- package/python3.6.2/lib/python3.6/test/test_asyncgen.py +0 -1044
- package/python3.6.2/lib/python3.6/test/test_asynchat.py +0 -308
- package/python3.6.2/lib/python3.6/test/test_asyncio/__init__.py +0 -10
- package/python3.6.2/lib/python3.6/test/test_asyncio/__main__.py +0 -4
- package/python3.6.2/lib/python3.6/test/test_asyncio/echo.py +0 -8
- package/python3.6.2/lib/python3.6/test/test_asyncio/echo2.py +0 -6
- package/python3.6.2/lib/python3.6/test/test_asyncio/echo3.py +0 -11
- package/python3.6.2/lib/python3.6/test/test_asyncio/keycert3.pem +0 -73
- package/python3.6.2/lib/python3.6/test/test_asyncio/pycacert.pem +0 -78
- package/python3.6.2/lib/python3.6/test/test_asyncio/ssl_cert.pem +0 -15
- package/python3.6.2/lib/python3.6/test/test_asyncio/ssl_key.pem +0 -16
- package/python3.6.2/lib/python3.6/test/test_asyncio/test_base_events.py +0 -1761
- package/python3.6.2/lib/python3.6/test/test_asyncio/test_events.py +0 -2791
- package/python3.6.2/lib/python3.6/test/test_asyncio/test_futures.py +0 -692
- package/python3.6.2/lib/python3.6/test/test_asyncio/test_locks.py +0 -943
- package/python3.6.2/lib/python3.6/test/test_asyncio/test_pep492.py +0 -232
- package/python3.6.2/lib/python3.6/test/test_asyncio/test_proactor_events.py +0 -593
- package/python3.6.2/lib/python3.6/test/test_asyncio/test_queues.py +0 -643
- package/python3.6.2/lib/python3.6/test/test_asyncio/test_selector_events.py +0 -1833
- package/python3.6.2/lib/python3.6/test/test_asyncio/test_sslproto.py +0 -134
- package/python3.6.2/lib/python3.6/test/test_asyncio/test_streams.py +0 -868
- package/python3.6.2/lib/python3.6/test/test_asyncio/test_subprocess.py +0 -532
- package/python3.6.2/lib/python3.6/test/test_asyncio/test_tasks.py +0 -2598
- package/python3.6.2/lib/python3.6/test/test_asyncio/test_transports.py +0 -91
- package/python3.6.2/lib/python3.6/test/test_asyncio/test_unix_events.py +0 -1621
- package/python3.6.2/lib/python3.6/test/test_asyncio/test_windows_events.py +0 -164
- package/python3.6.2/lib/python3.6/test/test_asyncio/test_windows_utils.py +0 -182
- package/python3.6.2/lib/python3.6/test/test_asyncore.py +0 -847
- package/python3.6.2/lib/python3.6/test/test_atexit.py +0 -192
- package/python3.6.2/lib/python3.6/test/test_audioop.py +0 -565
- package/python3.6.2/lib/python3.6/test/test_augassign.py +0 -326
- package/python3.6.2/lib/python3.6/test/test_base64.py +0 -681
- package/python3.6.2/lib/python3.6/test/test_baseexception.py +0 -183
- package/python3.6.2/lib/python3.6/test/test_bigaddrspace.py +0 -101
- package/python3.6.2/lib/python3.6/test/test_bigmem.py +0 -1256
- package/python3.6.2/lib/python3.6/test/test_binascii.py +0 -373
- package/python3.6.2/lib/python3.6/test/test_binhex.py +0 -55
- package/python3.6.2/lib/python3.6/test/test_binop.py +0 -441
- package/python3.6.2/lib/python3.6/test/test_bisect.py +0 -328
- package/python3.6.2/lib/python3.6/test/test_bool.py +0 -368
- package/python3.6.2/lib/python3.6/test/test_buffer.py +0 -4396
- package/python3.6.2/lib/python3.6/test/test_bufio.py +0 -73
- package/python3.6.2/lib/python3.6/test/test_builtin.py +0 -1851
- package/python3.6.2/lib/python3.6/test/test_bytes.py +0 -1759
- package/python3.6.2/lib/python3.6/test/test_bz2.py +0 -1002
- package/python3.6.2/lib/python3.6/test/test_calendar.py +0 -848
- package/python3.6.2/lib/python3.6/test/test_call.py +0 -302
- package/python3.6.2/lib/python3.6/test/test_capi.py +0 -753
- package/python3.6.2/lib/python3.6/test/test_cgi.py +0 -539
- package/python3.6.2/lib/python3.6/test/test_cgitb.py +0 -67
- package/python3.6.2/lib/python3.6/test/test_charmapcodec.py +0 -53
- package/python3.6.2/lib/python3.6/test/test_class.py +0 -599
- package/python3.6.2/lib/python3.6/test/test_cmath.py +0 -643
- package/python3.6.2/lib/python3.6/test/test_cmd.py +0 -243
- package/python3.6.2/lib/python3.6/test/test_cmd_line.py +0 -494
- package/python3.6.2/lib/python3.6/test/test_cmd_line_script.py +0 -648
- package/python3.6.2/lib/python3.6/test/test_code.py +0 -367
- package/python3.6.2/lib/python3.6/test/test_code_module.py +0 -154
- package/python3.6.2/lib/python3.6/test/test_codeccallbacks.py +0 -1074
- package/python3.6.2/lib/python3.6/test/test_codecencodings_cn.py +0 -96
- package/python3.6.2/lib/python3.6/test/test_codecencodings_hk.py +0 -22
- package/python3.6.2/lib/python3.6/test/test_codecencodings_iso2022.py +0 -41
- package/python3.6.2/lib/python3.6/test/test_codecencodings_jp.py +0 -126
- package/python3.6.2/lib/python3.6/test/test_codecencodings_kr.py +0 -69
- package/python3.6.2/lib/python3.6/test/test_codecencodings_tw.py +0 -22
- package/python3.6.2/lib/python3.6/test/test_codecmaps_cn.py +0 -26
- package/python3.6.2/lib/python3.6/test/test_codecmaps_hk.py +0 -15
- package/python3.6.2/lib/python3.6/test/test_codecmaps_jp.py +0 -60
- package/python3.6.2/lib/python3.6/test/test_codecmaps_kr.py +0 -37
- package/python3.6.2/lib/python3.6/test/test_codecmaps_tw.py +0 -27
- package/python3.6.2/lib/python3.6/test/test_codecs.py +0 -3272
- package/python3.6.2/lib/python3.6/test/test_codeop.py +0 -299
- package/python3.6.2/lib/python3.6/test/test_collections.py +0 -1926
- package/python3.6.2/lib/python3.6/test/test_colorsys.py +0 -100
- package/python3.6.2/lib/python3.6/test/test_compare.py +0 -124
- package/python3.6.2/lib/python3.6/test/test_compile.py +0 -720
- package/python3.6.2/lib/python3.6/test/test_compileall.py +0 -547
- package/python3.6.2/lib/python3.6/test/test_complex.py +0 -688
- package/python3.6.2/lib/python3.6/test/test_concurrent_futures.py +0 -836
- package/python3.6.2/lib/python3.6/test/test_configparser.py +0 -2096
- package/python3.6.2/lib/python3.6/test/test_contains.py +0 -114
- package/python3.6.2/lib/python3.6/test/test_contextlib.py +0 -990
- package/python3.6.2/lib/python3.6/test/test_copy.py +0 -888
- package/python3.6.2/lib/python3.6/test/test_copyreg.py +0 -126
- package/python3.6.2/lib/python3.6/test/test_coroutines.py +0 -2151
- package/python3.6.2/lib/python3.6/test/test_cprofile.py +0 -98
- package/python3.6.2/lib/python3.6/test/test_crashers.py +0 -37
- package/python3.6.2/lib/python3.6/test/test_crypt.py +0 -45
- package/python3.6.2/lib/python3.6/test/test_csv.py +0 -1175
- package/python3.6.2/lib/python3.6/test/test_ctypes.py +0 -9
- package/python3.6.2/lib/python3.6/test/test_curses.py +0 -549
- package/python3.6.2/lib/python3.6/test/test_datetime.py +0 -57
- package/python3.6.2/lib/python3.6/test/test_dbm.py +0 -192
- package/python3.6.2/lib/python3.6/test/test_dbm_dumb.py +0 -286
- package/python3.6.2/lib/python3.6/test/test_dbm_gnu.py +0 -97
- package/python3.6.2/lib/python3.6/test/test_dbm_ndbm.py +0 -52
- package/python3.6.2/lib/python3.6/test/test_decimal.py +0 -5707
- package/python3.6.2/lib/python3.6/test/test_decorators.py +0 -304
- package/python3.6.2/lib/python3.6/test/test_defaultdict.py +0 -187
- package/python3.6.2/lib/python3.6/test/test_deque.py +0 -1059
- package/python3.6.2/lib/python3.6/test/test_descr.py +0 -5452
- package/python3.6.2/lib/python3.6/test/test_descrtut.py +0 -486
- package/python3.6.2/lib/python3.6/test/test_devpoll.py +0 -145
- package/python3.6.2/lib/python3.6/test/test_dict.py +0 -1217
- package/python3.6.2/lib/python3.6/test/test_dict_version.py +0 -186
- package/python3.6.2/lib/python3.6/test/test_dictcomps.py +0 -86
- package/python3.6.2/lib/python3.6/test/test_dictviews.py +0 -272
- package/python3.6.2/lib/python3.6/test/test_difflib.py +0 -478
- package/python3.6.2/lib/python3.6/test/test_difflib_expect.html +0 -526
- package/python3.6.2/lib/python3.6/test/test_dis.py +0 -960
- package/python3.6.2/lib/python3.6/test/test_distutils.py +0 -18
- package/python3.6.2/lib/python3.6/test/test_doctest.py +0 -2962
- package/python3.6.2/lib/python3.6/test/test_doctest.txt +0 -17
- package/python3.6.2/lib/python3.6/test/test_doctest2.py +0 -123
- package/python3.6.2/lib/python3.6/test/test_doctest2.txt +0 -14
- package/python3.6.2/lib/python3.6/test/test_doctest3.txt +0 -5
- package/python3.6.2/lib/python3.6/test/test_doctest4.txt +0 -11
- package/python3.6.2/lib/python3.6/test/test_docxmlrpc.py +0 -198
- package/python3.6.2/lib/python3.6/test/test_dtrace.py +0 -178
- package/python3.6.2/lib/python3.6/test/test_dummy_thread.py +0 -256
- package/python3.6.2/lib/python3.6/test/test_dummy_threading.py +0 -60
- package/python3.6.2/lib/python3.6/test/test_dynamic.py +0 -138
- package/python3.6.2/lib/python3.6/test/test_dynamicclassattribute.py +0 -300
- package/python3.6.2/lib/python3.6/test/test_eintr.py +0 -22
- package/python3.6.2/lib/python3.6/test/test_email/__init__.py +0 -166
- package/python3.6.2/lib/python3.6/test/test_email/__main__.py +0 -4
- package/python3.6.2/lib/python3.6/test/test_email/data/PyBanner048.gif +0 -0
- package/python3.6.2/lib/python3.6/test/test_email/data/audiotest.au +0 -0
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_01.txt +0 -19
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_02.txt +0 -136
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_03.txt +0 -16
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_04.txt +0 -37
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_05.txt +0 -28
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_06.txt +0 -33
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_07.txt +0 -83
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_08.txt +0 -24
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_09.txt +0 -24
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_10.txt +0 -39
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_11.txt +0 -7
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_12.txt +0 -36
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_12a.txt +0 -38
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_13.txt +0 -94
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_14.txt +0 -23
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_15.txt +0 -52
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_16.txt +0 -123
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_17.txt +0 -12
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_18.txt +0 -6
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_19.txt +0 -43
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_20.txt +0 -22
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_21.txt +0 -20
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_22.txt +0 -46
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_23.txt +0 -8
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_24.txt +0 -10
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_25.txt +0 -117
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_26.txt +0 -46
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_27.txt +0 -15
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_28.txt +0 -25
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_29.txt +0 -22
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_30.txt +0 -23
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_31.txt +0 -15
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_32.txt +0 -14
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_33.txt +0 -29
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_34.txt +0 -19
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_35.txt +0 -4
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_36.txt +0 -40
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_37.txt +0 -22
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_38.txt +0 -101
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_39.txt +0 -83
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_40.txt +0 -10
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_41.txt +0 -8
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_42.txt +0 -20
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_43.txt +0 -217
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_44.txt +0 -33
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_45.txt +0 -33
- package/python3.6.2/lib/python3.6/test/test_email/data/msg_46.txt +0 -23
- package/python3.6.2/lib/python3.6/test/test_email/test__encoded_words.py +0 -192
- package/python3.6.2/lib/python3.6/test/test_email/test__header_value_parser.py +0 -2723
- package/python3.6.2/lib/python3.6/test/test_email/test_asian_codecs.py +0 -81
- package/python3.6.2/lib/python3.6/test/test_email/test_contentmanager.py +0 -796
- package/python3.6.2/lib/python3.6/test/test_email/test_defect_handling.py +0 -320
- package/python3.6.2/lib/python3.6/test/test_email/test_email.py +0 -5402
- package/python3.6.2/lib/python3.6/test/test_email/test_generator.py +0 -296
- package/python3.6.2/lib/python3.6/test/test_email/test_headerregistry.py +0 -1653
- package/python3.6.2/lib/python3.6/test/test_email/test_inversion.py +0 -70
- package/python3.6.2/lib/python3.6/test/test_email/test_message.py +0 -803
- package/python3.6.2/lib/python3.6/test/test_email/test_parser.py +0 -110
- package/python3.6.2/lib/python3.6/test/test_email/test_pickleable.py +0 -76
- package/python3.6.2/lib/python3.6/test/test_email/test_policy.py +0 -346
- package/python3.6.2/lib/python3.6/test/test_email/test_utils.py +0 -163
- package/python3.6.2/lib/python3.6/test/test_email/torture_test.py +0 -133
- package/python3.6.2/lib/python3.6/test/test_ensurepip.py +0 -310
- package/python3.6.2/lib/python3.6/test/test_enum.py +0 -2618
- package/python3.6.2/lib/python3.6/test/test_enumerate.py +0 -269
- package/python3.6.2/lib/python3.6/test/test_eof.py +0 -28
- package/python3.6.2/lib/python3.6/test/test_epoll.py +0 -255
- package/python3.6.2/lib/python3.6/test/test_errno.py +0 -35
- package/python3.6.2/lib/python3.6/test/test_exception_hierarchy.py +0 -204
- package/python3.6.2/lib/python3.6/test/test_exception_variations.py +0 -176
- package/python3.6.2/lib/python3.6/test/test_exceptions.py +0 -1288
- package/python3.6.2/lib/python3.6/test/test_extcall.py +0 -465
- package/python3.6.2/lib/python3.6/test/test_faulthandler.py +0 -817
- package/python3.6.2/lib/python3.6/test/test_fcntl.py +0 -152
- package/python3.6.2/lib/python3.6/test/test_file.py +0 -329
- package/python3.6.2/lib/python3.6/test/test_file_eintr.py +0 -252
- package/python3.6.2/lib/python3.6/test/test_filecmp.py +0 -217
- package/python3.6.2/lib/python3.6/test/test_fileinput.py +0 -1015
- package/python3.6.2/lib/python3.6/test/test_fileio.py +0 -595
- package/python3.6.2/lib/python3.6/test/test_finalization.py +0 -519
- package/python3.6.2/lib/python3.6/test/test_float.py +0 -1422
- package/python3.6.2/lib/python3.6/test/test_flufl.py +0 -22
- package/python3.6.2/lib/python3.6/test/test_fnmatch.py +0 -128
- package/python3.6.2/lib/python3.6/test/test_fork1.py +0 -112
- package/python3.6.2/lib/python3.6/test/test_format.py +0 -494
- package/python3.6.2/lib/python3.6/test/test_fractions.py +0 -635
- package/python3.6.2/lib/python3.6/test/test_frame.py +0 -165
- package/python3.6.2/lib/python3.6/test/test_fstring.py +0 -1038
- package/python3.6.2/lib/python3.6/test/test_ftplib.py +0 -1091
- package/python3.6.2/lib/python3.6/test/test_funcattrs.py +0 -377
- package/python3.6.2/lib/python3.6/test/test_functools.py +0 -2083
- package/python3.6.2/lib/python3.6/test/test_future.py +0 -108
- package/python3.6.2/lib/python3.6/test/test_future3.py +0 -26
- package/python3.6.2/lib/python3.6/test/test_future4.py +0 -6
- package/python3.6.2/lib/python3.6/test/test_future5.py +0 -21
- package/python3.6.2/lib/python3.6/test/test_gc.py +0 -1031
- package/python3.6.2/lib/python3.6/test/test_gdb.py +0 -936
- package/python3.6.2/lib/python3.6/test/test_generator_stop.py +0 -34
- package/python3.6.2/lib/python3.6/test/test_generators.py +0 -2232
- package/python3.6.2/lib/python3.6/test/test_genericpath.py +0 -537
- package/python3.6.2/lib/python3.6/test/test_genexps.py +0 -285
- package/python3.6.2/lib/python3.6/test/test_getargs2.py +0 -958
- package/python3.6.2/lib/python3.6/test/test_getopt.py +0 -184
- package/python3.6.2/lib/python3.6/test/test_getpass.py +0 -163
- package/python3.6.2/lib/python3.6/test/test_gettext.py +0 -770
- package/python3.6.2/lib/python3.6/test/test_glob.py +0 -317
- package/python3.6.2/lib/python3.6/test/test_global.py +0 -61
- package/python3.6.2/lib/python3.6/test/test_grammar.py +0 -1417
- package/python3.6.2/lib/python3.6/test/test_grp.py +0 -108
- package/python3.6.2/lib/python3.6/test/test_gzip.py +0 -672
- package/python3.6.2/lib/python3.6/test/test_hash.py +0 -346
- package/python3.6.2/lib/python3.6/test/test_hashlib.py +0 -954
- package/python3.6.2/lib/python3.6/test/test_heapq.py +0 -427
- package/python3.6.2/lib/python3.6/test/test_hmac.py +0 -496
- package/python3.6.2/lib/python3.6/test/test_html.py +0 -103
- package/python3.6.2/lib/python3.6/test/test_htmlparser.py +0 -778
- package/python3.6.2/lib/python3.6/test/test_http_cookiejar.py +0 -1772
- package/python3.6.2/lib/python3.6/test/test_http_cookies.py +0 -472
- package/python3.6.2/lib/python3.6/test/test_httplib.py +0 -1903
- package/python3.6.2/lib/python3.6/test/test_httpservers.py +0 -1060
- package/python3.6.2/lib/python3.6/test/test_idle.py +0 -23
- package/python3.6.2/lib/python3.6/test/test_imaplib.py +0 -998
- package/python3.6.2/lib/python3.6/test/test_imghdr.py +0 -140
- package/python3.6.2/lib/python3.6/test/test_imp.py +0 -416
- package/python3.6.2/lib/python3.6/test/test_import/__init__.py +0 -1199
- package/python3.6.2/lib/python3.6/test/test_import/__main__.py +0 -3
- package/python3.6.2/lib/python3.6/test/test_import/data/circular_imports/basic.py +0 -2
- package/python3.6.2/lib/python3.6/test/test_import/data/circular_imports/basic2.py +0 -1
- package/python3.6.2/lib/python3.6/test/test_import/data/circular_imports/indirect.py +0 -1
- package/python3.6.2/lib/python3.6/test/test_import/data/circular_imports/rebinding.py +0 -3
- package/python3.6.2/lib/python3.6/test/test_import/data/circular_imports/rebinding2.py +0 -3
- package/python3.6.2/lib/python3.6/test/test_import/data/circular_imports/subpackage.py +0 -2
- package/python3.6.2/lib/python3.6/test/test_import/data/circular_imports/subpkg/subpackage2.py +0 -2
- package/python3.6.2/lib/python3.6/test/test_import/data/circular_imports/subpkg/util.py +0 -2
- package/python3.6.2/lib/python3.6/test/test_import/data/circular_imports/util.py +0 -2
- package/python3.6.2/lib/python3.6/test/test_import/data/package/__init__.py +0 -2
- package/python3.6.2/lib/python3.6/test/test_import/data/package/submodule.py +0 -0
- package/python3.6.2/lib/python3.6/test/test_import/data/package2/submodule1.py +0 -3
- package/python3.6.2/lib/python3.6/test/test_import/data/package2/submodule2.py +0 -0
- package/python3.6.2/lib/python3.6/test/test_importlib/__init__.py +0 -5
- package/python3.6.2/lib/python3.6/test/test_importlib/__main__.py +0 -4
- package/python3.6.2/lib/python3.6/test/test_importlib/abc.py +0 -94
- package/python3.6.2/lib/python3.6/test/test_importlib/builtin/__init__.py +0 -5
- package/python3.6.2/lib/python3.6/test/test_importlib/builtin/__main__.py +0 -4
- package/python3.6.2/lib/python3.6/test/test_importlib/builtin/test_finder.py +0 -90
- package/python3.6.2/lib/python3.6/test/test_importlib/builtin/test_loader.py +0 -108
- package/python3.6.2/lib/python3.6/test/test_importlib/extension/__init__.py +0 -5
- package/python3.6.2/lib/python3.6/test/test_importlib/extension/__main__.py +0 -4
- package/python3.6.2/lib/python3.6/test/test_importlib/extension/test_case_sensitivity.py +0 -46
- package/python3.6.2/lib/python3.6/test/test_importlib/extension/test_finder.py +0 -44
- package/python3.6.2/lib/python3.6/test/test_importlib/extension/test_loader.py +0 -277
- package/python3.6.2/lib/python3.6/test/test_importlib/extension/test_path_hook.py +0 -31
- package/python3.6.2/lib/python3.6/test/test_importlib/frozen/__init__.py +0 -5
- package/python3.6.2/lib/python3.6/test/test_importlib/frozen/__main__.py +0 -4
- package/python3.6.2/lib/python3.6/test/test_importlib/frozen/test_finder.py +0 -84
- package/python3.6.2/lib/python3.6/test/test_importlib/frozen/test_loader.py +0 -225
- package/python3.6.2/lib/python3.6/test/test_importlib/import_/__init__.py +0 -5
- package/python3.6.2/lib/python3.6/test/test_importlib/import_/__main__.py +0 -4
- package/python3.6.2/lib/python3.6/test/test_importlib/import_/test___loader__.py +0 -75
- package/python3.6.2/lib/python3.6/test/test_importlib/import_/test___package__.py +0 -163
- package/python3.6.2/lib/python3.6/test/test_importlib/import_/test_api.py +0 -119
- package/python3.6.2/lib/python3.6/test/test_importlib/import_/test_caching.py +0 -93
- package/python3.6.2/lib/python3.6/test/test_importlib/import_/test_fromlist.py +0 -175
- package/python3.6.2/lib/python3.6/test/test_importlib/import_/test_meta_path.py +0 -125
- package/python3.6.2/lib/python3.6/test/test_importlib/import_/test_packages.py +0 -110
- package/python3.6.2/lib/python3.6/test/test_importlib/import_/test_path.py +0 -257
- package/python3.6.2/lib/python3.6/test/test_importlib/import_/test_relative_imports.py +0 -232
- package/python3.6.2/lib/python3.6/test/test_importlib/namespace_pkgs/both_portions/foo/one.py +0 -1
- package/python3.6.2/lib/python3.6/test/test_importlib/namespace_pkgs/both_portions/foo/two.py +0 -1
- package/python3.6.2/lib/python3.6/test/test_importlib/namespace_pkgs/missing_directory.zip +0 -0
- package/python3.6.2/lib/python3.6/test/test_importlib/namespace_pkgs/module_and_namespace_package/a_test/empty +0 -0
- package/python3.6.2/lib/python3.6/test/test_importlib/namespace_pkgs/module_and_namespace_package/a_test.py +0 -1
- package/python3.6.2/lib/python3.6/test/test_importlib/namespace_pkgs/nested_portion1.zip +0 -0
- package/python3.6.2/lib/python3.6/test/test_importlib/namespace_pkgs/not_a_namespace_pkg/foo/__init__.py +0 -0
- package/python3.6.2/lib/python3.6/test/test_importlib/namespace_pkgs/not_a_namespace_pkg/foo/one.py +0 -1
- package/python3.6.2/lib/python3.6/test/test_importlib/namespace_pkgs/portion1/foo/one.py +0 -1
- package/python3.6.2/lib/python3.6/test/test_importlib/namespace_pkgs/portion2/foo/two.py +0 -1
- package/python3.6.2/lib/python3.6/test/test_importlib/namespace_pkgs/project1/parent/child/one.py +0 -1
- package/python3.6.2/lib/python3.6/test/test_importlib/namespace_pkgs/project2/parent/child/two.py +0 -1
- package/python3.6.2/lib/python3.6/test/test_importlib/namespace_pkgs/project3/parent/child/three.py +0 -1
- package/python3.6.2/lib/python3.6/test/test_importlib/namespace_pkgs/top_level_portion1.zip +0 -0
- package/python3.6.2/lib/python3.6/test/test_importlib/source/__init__.py +0 -5
- package/python3.6.2/lib/python3.6/test/test_importlib/source/__main__.py +0 -4
- package/python3.6.2/lib/python3.6/test/test_importlib/source/test_case_sensitivity.py +0 -85
- package/python3.6.2/lib/python3.6/test/test_importlib/source/test_file_loader.py +0 -602
- package/python3.6.2/lib/python3.6/test/test_importlib/source/test_finder.py +0 -236
- package/python3.6.2/lib/python3.6/test/test_importlib/source/test_path_hook.py +0 -41
- package/python3.6.2/lib/python3.6/test/test_importlib/source/test_source_encoding.py +0 -175
- package/python3.6.2/lib/python3.6/test/test_importlib/test_abc.py +0 -953
- package/python3.6.2/lib/python3.6/test/test_importlib/test_api.py +0 -449
- package/python3.6.2/lib/python3.6/test/test_importlib/test_lazy.py +0 -145
- package/python3.6.2/lib/python3.6/test/test_importlib/test_locks.py +0 -175
- package/python3.6.2/lib/python3.6/test/test_importlib/test_namespace_pkgs.py +0 -321
- package/python3.6.2/lib/python3.6/test/test_importlib/test_spec.py +0 -819
- package/python3.6.2/lib/python3.6/test/test_importlib/test_util.py +0 -805
- package/python3.6.2/lib/python3.6/test/test_importlib/test_windows.py +0 -109
- package/python3.6.2/lib/python3.6/test/test_importlib/util.py +0 -388
- package/python3.6.2/lib/python3.6/test/test_index.py +0 -275
- package/python3.6.2/lib/python3.6/test/test_inspect.py +0 -3725
- package/python3.6.2/lib/python3.6/test/test_int.py +0 -518
- package/python3.6.2/lib/python3.6/test/test_int_literal.py +0 -143
- package/python3.6.2/lib/python3.6/test/test_io.py +0 -4054
- package/python3.6.2/lib/python3.6/test/test_ioctl.py +0 -91
- package/python3.6.2/lib/python3.6/test/test_ipaddress.py +0 -1972
- package/python3.6.2/lib/python3.6/test/test_isinstance.py +0 -280
- package/python3.6.2/lib/python3.6/test/test_iter.py +0 -1016
- package/python3.6.2/lib/python3.6/test/test_iterlen.py +0 -228
- package/python3.6.2/lib/python3.6/test/test_itertools.py +0 -2340
- package/python3.6.2/lib/python3.6/test/test_json/__init__.py +0 -56
- package/python3.6.2/lib/python3.6/test/test_json/__main__.py +0 -4
- package/python3.6.2/lib/python3.6/test/test_json/test_decode.py +0 -97
- package/python3.6.2/lib/python3.6/test/test_json/test_default.py +0 -12
- package/python3.6.2/lib/python3.6/test/test_json/test_dump.py +0 -68
- package/python3.6.2/lib/python3.6/test/test_json/test_encode_basestring_ascii.py +0 -48
- package/python3.6.2/lib/python3.6/test/test_json/test_enum.py +0 -120
- package/python3.6.2/lib/python3.6/test/test_json/test_fail.py +0 -216
- package/python3.6.2/lib/python3.6/test/test_json/test_float.py +0 -33
- package/python3.6.2/lib/python3.6/test/test_json/test_indent.py +0 -67
- package/python3.6.2/lib/python3.6/test/test_json/test_pass1.py +0 -75
- package/python3.6.2/lib/python3.6/test/test_json/test_pass2.py +0 -18
- package/python3.6.2/lib/python3.6/test/test_json/test_pass3.py +0 -24
- package/python3.6.2/lib/python3.6/test/test_json/test_recursion.py +0 -100
- package/python3.6.2/lib/python3.6/test/test_json/test_scanstring.py +0 -141
- package/python3.6.2/lib/python3.6/test/test_json/test_separators.py +0 -50
- package/python3.6.2/lib/python3.6/test/test_json/test_speedups.py +0 -71
- package/python3.6.2/lib/python3.6/test/test_json/test_tool.py +0 -107
- package/python3.6.2/lib/python3.6/test/test_json/test_unicode.py +0 -98
- package/python3.6.2/lib/python3.6/test/test_keyword.py +0 -138
- package/python3.6.2/lib/python3.6/test/test_keywordonlyarg.py +0 -189
- package/python3.6.2/lib/python3.6/test/test_kqueue.py +0 -263
- package/python3.6.2/lib/python3.6/test/test_largefile.py +0 -180
- package/python3.6.2/lib/python3.6/test/test_lib2to3.py +0 -5
- package/python3.6.2/lib/python3.6/test/test_linecache.py +0 -242
- package/python3.6.2/lib/python3.6/test/test_list.py +0 -155
- package/python3.6.2/lib/python3.6/test/test_listcomps.py +0 -148
- package/python3.6.2/lib/python3.6/test/test_locale.py +0 -587
- package/python3.6.2/lib/python3.6/test/test_logging.py +0 -4442
- package/python3.6.2/lib/python3.6/test/test_long.py +0 -1322
- package/python3.6.2/lib/python3.6/test/test_longexp.py +0 -10
- package/python3.6.2/lib/python3.6/test/test_lzma.py +0 -1764
- package/python3.6.2/lib/python3.6/test/test_macpath.py +0 -149
- package/python3.6.2/lib/python3.6/test/test_macurl2path.py +0 -31
- package/python3.6.2/lib/python3.6/test/test_mailbox.py +0 -2288
- package/python3.6.2/lib/python3.6/test/test_mailcap.py +0 -239
- package/python3.6.2/lib/python3.6/test/test_marshal.py +0 -556
- package/python3.6.2/lib/python3.6/test/test_math.py +0 -1422
- package/python3.6.2/lib/python3.6/test/test_memoryio.py +0 -842
- package/python3.6.2/lib/python3.6/test/test_memoryview.py +0 -537
- package/python3.6.2/lib/python3.6/test/test_metaclass.py +0 -265
- package/python3.6.2/lib/python3.6/test/test_mimetypes.py +0 -111
- package/python3.6.2/lib/python3.6/test/test_minidom.py +0 -1574
- package/python3.6.2/lib/python3.6/test/test_mmap.py +0 -803
- package/python3.6.2/lib/python3.6/test/test_module.py +0 -244
- package/python3.6.2/lib/python3.6/test/test_modulefinder.py +0 -337
- package/python3.6.2/lib/python3.6/test/test_msilib.py +0 -99
- package/python3.6.2/lib/python3.6/test/test_multibytecodec.py +0 -270
- package/python3.6.2/lib/python3.6/test/test_multiprocessing_fork.py +0 -13
- package/python3.6.2/lib/python3.6/test/test_multiprocessing_forkserver.py +0 -12
- package/python3.6.2/lib/python3.6/test/test_multiprocessing_main_handling.py +0 -290
- package/python3.6.2/lib/python3.6/test/test_multiprocessing_spawn.py +0 -12
- package/python3.6.2/lib/python3.6/test/test_netrc.py +0 -133
- package/python3.6.2/lib/python3.6/test/test_nis.py +0 -39
- package/python3.6.2/lib/python3.6/test/test_nntplib.py +0 -1581
- package/python3.6.2/lib/python3.6/test/test_normalization.py +0 -108
- package/python3.6.2/lib/python3.6/test/test_ntpath.py +0 -539
- package/python3.6.2/lib/python3.6/test/test_numeric_tower.py +0 -202
- package/python3.6.2/lib/python3.6/test/test_opcodes.py +0 -135
- package/python3.6.2/lib/python3.6/test/test_openpty.py +0 -21
- package/python3.6.2/lib/python3.6/test/test_operator.py +0 -609
- package/python3.6.2/lib/python3.6/test/test_optparse.py +0 -1664
- package/python3.6.2/lib/python3.6/test/test_ordered_dict.py +0 -787
- package/python3.6.2/lib/python3.6/test/test_os.py +0 -3548
- package/python3.6.2/lib/python3.6/test/test_ossaudiodev.py +0 -202
- package/python3.6.2/lib/python3.6/test/test_osx_env.py +0 -34
- package/python3.6.2/lib/python3.6/test/test_parser.py +0 -905
- package/python3.6.2/lib/python3.6/test/test_pathlib.py +0 -2252
- package/python3.6.2/lib/python3.6/test/test_pdb.py +0 -1124
- package/python3.6.2/lib/python3.6/test/test_peepholer.py +0 -325
- package/python3.6.2/lib/python3.6/test/test_pickle.py +0 -514
- package/python3.6.2/lib/python3.6/test/test_pickletools.py +0 -99
- package/python3.6.2/lib/python3.6/test/test_pipes.py +0 -203
- package/python3.6.2/lib/python3.6/test/test_pkg.py +0 -295
- package/python3.6.2/lib/python3.6/test/test_pkgimport.py +0 -80
- package/python3.6.2/lib/python3.6/test/test_pkgutil.py +0 -491
- package/python3.6.2/lib/python3.6/test/test_platform.py +0 -370
- package/python3.6.2/lib/python3.6/test/test_plistlib.py +0 -662
- package/python3.6.2/lib/python3.6/test/test_poll.py +0 -238
- package/python3.6.2/lib/python3.6/test/test_popen.py +0 -65
- package/python3.6.2/lib/python3.6/test/test_poplib.py +0 -520
- package/python3.6.2/lib/python3.6/test/test_posix.py +0 -1298
- package/python3.6.2/lib/python3.6/test/test_posixpath.py +0 -680
- package/python3.6.2/lib/python3.6/test/test_pow.py +0 -123
- package/python3.6.2/lib/python3.6/test/test_pprint.py +0 -1012
- package/python3.6.2/lib/python3.6/test/test_print.py +0 -193
- package/python3.6.2/lib/python3.6/test/test_profile.py +0 -187
- package/python3.6.2/lib/python3.6/test/test_property.py +0 -272
- package/python3.6.2/lib/python3.6/test/test_pstats.py +0 -38
- package/python3.6.2/lib/python3.6/test/test_pty.py +0 -316
- package/python3.6.2/lib/python3.6/test/test_pulldom.py +0 -342
- package/python3.6.2/lib/python3.6/test/test_pwd.py +0 -125
- package/python3.6.2/lib/python3.6/test/test_py_compile.py +0 -127
- package/python3.6.2/lib/python3.6/test/test_pyclbr.py +0 -176
- package/python3.6.2/lib/python3.6/test/test_pydoc.py +0 -1107
- package/python3.6.2/lib/python3.6/test/test_pyexpat.py +0 -733
- package/python3.6.2/lib/python3.6/test/test_queue.py +0 -362
- package/python3.6.2/lib/python3.6/test/test_quopri.py +0 -210
- package/python3.6.2/lib/python3.6/test/test_raise.py +0 -419
- package/python3.6.2/lib/python3.6/test/test_random.py +0 -939
- package/python3.6.2/lib/python3.6/test/test_range.py +0 -693
- package/python3.6.2/lib/python3.6/test/test_re.py +0 -2087
- package/python3.6.2/lib/python3.6/test/test_readline.py +0 -309
- package/python3.6.2/lib/python3.6/test/test_regrtest.py +0 -967
- package/python3.6.2/lib/python3.6/test/test_repl.py +0 -62
- package/python3.6.2/lib/python3.6/test/test_reprlib.py +0 -405
- package/python3.6.2/lib/python3.6/test/test_resource.py +0 -180
- package/python3.6.2/lib/python3.6/test/test_richcmp.py +0 -355
- package/python3.6.2/lib/python3.6/test/test_rlcompleter.py +0 -141
- package/python3.6.2/lib/python3.6/test/test_robotparser.py +0 -335
- package/python3.6.2/lib/python3.6/test/test_runpy.py +0 -749
- package/python3.6.2/lib/python3.6/test/test_sax.py +0 -1273
- package/python3.6.2/lib/python3.6/test/test_sched.py +0 -204
- package/python3.6.2/lib/python3.6/test/test_scope.py +0 -761
- package/python3.6.2/lib/python3.6/test/test_script_helper.py +0 -110
- package/python3.6.2/lib/python3.6/test/test_secrets.py +0 -124
- package/python3.6.2/lib/python3.6/test/test_select.py +0 -82
- package/python3.6.2/lib/python3.6/test/test_selectors.py +0 -526
- package/python3.6.2/lib/python3.6/test/test_set.py +0 -1903
- package/python3.6.2/lib/python3.6/test/test_setcomps.py +0 -151
- package/python3.6.2/lib/python3.6/test/test_shelve.py +0 -228
- package/python3.6.2/lib/python3.6/test/test_shlex.py +0 -318
- package/python3.6.2/lib/python3.6/test/test_shutil.py +0 -1925
- package/python3.6.2/lib/python3.6/test/test_signal.py +0 -1093
- package/python3.6.2/lib/python3.6/test/test_site.py +0 -595
- package/python3.6.2/lib/python3.6/test/test_slice.py +0 -255
- package/python3.6.2/lib/python3.6/test/test_smtpd.py +0 -1013
- package/python3.6.2/lib/python3.6/test/test_smtplib.py +0 -1292
- package/python3.6.2/lib/python3.6/test/test_smtpnet.py +0 -83
- package/python3.6.2/lib/python3.6/test/test_sndhdr.py +0 -37
- package/python3.6.2/lib/python3.6/test/test_socket.py +0 -5648
- package/python3.6.2/lib/python3.6/test/test_socketserver.py +0 -505
- package/python3.6.2/lib/python3.6/test/test_sort.py +0 -265
- package/python3.6.2/lib/python3.6/test/test_source_encoding.py +0 -225
- package/python3.6.2/lib/python3.6/test/test_spwd.py +0 -75
- package/python3.6.2/lib/python3.6/test/test_sqlite.py +0 -24
- package/python3.6.2/lib/python3.6/test/test_ssl.py +0 -3663
- package/python3.6.2/lib/python3.6/test/test_startfile.py +0 -34
- package/python3.6.2/lib/python3.6/test/test_stat.py +0 -234
- package/python3.6.2/lib/python3.6/test/test_statistics.py +0 -1992
- package/python3.6.2/lib/python3.6/test/test_strftime.py +0 -206
- package/python3.6.2/lib/python3.6/test/test_string.py +0 -439
- package/python3.6.2/lib/python3.6/test/test_string_literals.py +0 -249
- package/python3.6.2/lib/python3.6/test/test_stringprep.py +0 -92
- package/python3.6.2/lib/python3.6/test/test_strptime.py +0 -673
- package/python3.6.2/lib/python3.6/test/test_strtod.py +0 -433
- package/python3.6.2/lib/python3.6/test/test_struct.py +0 -756
- package/python3.6.2/lib/python3.6/test/test_structmembers.py +0 -144
- package/python3.6.2/lib/python3.6/test/test_structseq.py +0 -126
- package/python3.6.2/lib/python3.6/test/test_subclassinit.py +0 -284
- package/python3.6.2/lib/python3.6/test/test_subprocess.py +0 -3005
- package/python3.6.2/lib/python3.6/test/test_sunau.py +0 -121
- package/python3.6.2/lib/python3.6/test/test_sundry.py +0 -57
- package/python3.6.2/lib/python3.6/test/test_super.py +0 -347
- package/python3.6.2/lib/python3.6/test/test_support.py +0 -459
- package/python3.6.2/lib/python3.6/test/test_symbol.py +0 -54
- package/python3.6.2/lib/python3.6/test/test_symtable.py +0 -193
- package/python3.6.2/lib/python3.6/test/test_syntax.py +0 -618
- package/python3.6.2/lib/python3.6/test/test_sys.py +0 -1270
- package/python3.6.2/lib/python3.6/test/test_sys_setprofile.py +0 -376
- package/python3.6.2/lib/python3.6/test/test_sys_settrace.py +0 -854
- package/python3.6.2/lib/python3.6/test/test_sysconfig.py +0 -445
- package/python3.6.2/lib/python3.6/test/test_syslog.py +0 -40
- package/python3.6.2/lib/python3.6/test/test_tarfile.py +0 -2635
- package/python3.6.2/lib/python3.6/test/test_tcl.py +0 -715
- package/python3.6.2/lib/python3.6/test/test_telnetlib.py +0 -401
- package/python3.6.2/lib/python3.6/test/test_tempfile.py +0 -1458
- package/python3.6.2/lib/python3.6/test/test_textwrap.py +0 -981
- package/python3.6.2/lib/python3.6/test/test_thread.py +0 -269
- package/python3.6.2/lib/python3.6/test/test_threaded_import.py +0 -254
- package/python3.6.2/lib/python3.6/test/test_threadedtempfile.py +0 -62
- package/python3.6.2/lib/python3.6/test/test_threading.py +0 -1170
- package/python3.6.2/lib/python3.6/test/test_threading_local.py +0 -220
- package/python3.6.2/lib/python3.6/test/test_threadsignals.py +0 -227
- package/python3.6.2/lib/python3.6/test/test_time.py +0 -1000
- package/python3.6.2/lib/python3.6/test/test_timeit.py +0 -381
- package/python3.6.2/lib/python3.6/test/test_timeout.py +0 -303
- package/python3.6.2/lib/python3.6/test/test_tix.py +0 -32
- package/python3.6.2/lib/python3.6/test/test_tk.py +0 -15
- package/python3.6.2/lib/python3.6/test/test_tokenize.py +0 -1590
- package/python3.6.2/lib/python3.6/test/test_tools/__init__.py +0 -24
- package/python3.6.2/lib/python3.6/test/test_tools/__main__.py +0 -4
- package/python3.6.2/lib/python3.6/test/test_tools/test_fixcid.py +0 -92
- package/python3.6.2/lib/python3.6/test/test_tools/test_gprof2html.py +0 -35
- package/python3.6.2/lib/python3.6/test/test_tools/test_i18n.py +0 -72
- package/python3.6.2/lib/python3.6/test/test_tools/test_md5sum.py +0 -76
- package/python3.6.2/lib/python3.6/test/test_tools/test_pdeps.py +0 -32
- package/python3.6.2/lib/python3.6/test/test_tools/test_pindent.py +0 -339
- package/python3.6.2/lib/python3.6/test/test_tools/test_reindent.py +0 -35
- package/python3.6.2/lib/python3.6/test/test_tools/test_sundry.py +0 -53
- package/python3.6.2/lib/python3.6/test/test_tools/test_unparse.py +0 -313
- package/python3.6.2/lib/python3.6/test/test_trace.py +0 -391
- package/python3.6.2/lib/python3.6/test/test_traceback.py +0 -1111
- package/python3.6.2/lib/python3.6/test/test_tracemalloc.py +0 -994
- package/python3.6.2/lib/python3.6/test/test_ttk_guionly.py +0 -34
- package/python3.6.2/lib/python3.6/test/test_ttk_textonly.py +0 -13
- package/python3.6.2/lib/python3.6/test/test_tuple.py +0 -221
- package/python3.6.2/lib/python3.6/test/test_turtle.py +0 -436
- package/python3.6.2/lib/python3.6/test/test_typechecks.py +0 -71
- package/python3.6.2/lib/python3.6/test/test_types.py +0 -1550
- package/python3.6.2/lib/python3.6/test/test_typing.py +0 -2577
- package/python3.6.2/lib/python3.6/test/test_ucn.py +0 -237
- package/python3.6.2/lib/python3.6/test/test_unary.py +0 -53
- package/python3.6.2/lib/python3.6/test/test_unicode.py +0 -2894
- package/python3.6.2/lib/python3.6/test/test_unicode_file.py +0 -140
- package/python3.6.2/lib/python3.6/test/test_unicode_file_functions.py +0 -195
- package/python3.6.2/lib/python3.6/test/test_unicode_identifiers.py +0 -31
- package/python3.6.2/lib/python3.6/test/test_unicodedata.py +0 -316
- package/python3.6.2/lib/python3.6/test/test_unittest.py +0 -16
- package/python3.6.2/lib/python3.6/test/test_univnewlines.py +0 -123
- package/python3.6.2/lib/python3.6/test/test_unpack.py +0 -151
- package/python3.6.2/lib/python3.6/test/test_unpack_ex.py +0 -365
- package/python3.6.2/lib/python3.6/test/test_urllib.py +0 -1572
- package/python3.6.2/lib/python3.6/test/test_urllib2.py +0 -1930
- package/python3.6.2/lib/python3.6/test/test_urllib2_localnet.py +0 -679
- package/python3.6.2/lib/python3.6/test/test_urllib2net.py +0 -329
- package/python3.6.2/lib/python3.6/test/test_urllib_response.py +0 -59
- package/python3.6.2/lib/python3.6/test/test_urllibnet.py +0 -218
- package/python3.6.2/lib/python3.6/test/test_urlparse.py +0 -1122
- package/python3.6.2/lib/python3.6/test/test_userdict.py +0 -220
- package/python3.6.2/lib/python3.6/test/test_userlist.py +0 -63
- package/python3.6.2/lib/python3.6/test/test_userstring.py +0 -44
- package/python3.6.2/lib/python3.6/test/test_utf8source.py +0 -43
- package/python3.6.2/lib/python3.6/test/test_uu.py +0 -260
- package/python3.6.2/lib/python3.6/test/test_uuid.py +0 -511
- package/python3.6.2/lib/python3.6/test/test_venv.py +0 -433
- package/python3.6.2/lib/python3.6/test/test_wait3.py +0 -38
- package/python3.6.2/lib/python3.6/test/test_wait4.py +0 -39
- package/python3.6.2/lib/python3.6/test/test_warnings/__init__.py +0 -1216
- package/python3.6.2/lib/python3.6/test/test_warnings/__main__.py +0 -3
- package/python3.6.2/lib/python3.6/test/test_warnings/data/import_warning.py +0 -3
- package/python3.6.2/lib/python3.6/test/test_warnings/data/stacklevel.py +0 -9
- package/python3.6.2/lib/python3.6/test/test_wave.py +0 -113
- package/python3.6.2/lib/python3.6/test/test_weakref.py +0 -1952
- package/python3.6.2/lib/python3.6/test/test_weakset.py +0 -439
- package/python3.6.2/lib/python3.6/test/test_webbrowser.py +0 -217
- package/python3.6.2/lib/python3.6/test/test_winconsoleio.py +0 -191
- package/python3.6.2/lib/python3.6/test/test_winreg.py +0 -498
- package/python3.6.2/lib/python3.6/test/test_winsound.py +0 -150
- package/python3.6.2/lib/python3.6/test/test_with.py +0 -746
- package/python3.6.2/lib/python3.6/test/test_wsgiref.py +0 -785
- package/python3.6.2/lib/python3.6/test/test_xdrlib.py +0 -77
- package/python3.6.2/lib/python3.6/test/test_xml_dom_minicompat.py +0 -138
- package/python3.6.2/lib/python3.6/test/test_xml_etree.py +0 -3166
- package/python3.6.2/lib/python3.6/test/test_xml_etree_c.py +0 -188
- package/python3.6.2/lib/python3.6/test/test_xmlrpc.py +0 -1415
- package/python3.6.2/lib/python3.6/test/test_xmlrpc_net.py +0 -32
- package/python3.6.2/lib/python3.6/test/test_yield_from.py +0 -1052
- package/python3.6.2/lib/python3.6/test/test_zipapp.py +0 -349
- package/python3.6.2/lib/python3.6/test/test_zipfile.py +0 -2241
- package/python3.6.2/lib/python3.6/test/test_zipfile64.py +0 -155
- package/python3.6.2/lib/python3.6/test/test_zipimport.py +0 -759
- package/python3.6.2/lib/python3.6/test/test_zipimport_support.py +0 -244
- package/python3.6.2/lib/python3.6/test/test_zlib.py +0 -898
- package/python3.6.2/lib/python3.6/test/testcodec.py +0 -48
- package/python3.6.2/lib/python3.6/test/testtar.tar +0 -0
- package/python3.6.2/lib/python3.6/test/tf_inherit_check.py +0 -27
- package/python3.6.2/lib/python3.6/test/threaded_import_hangers.py +0 -45
- package/python3.6.2/lib/python3.6/test/time_hashlib.py +0 -88
- package/python3.6.2/lib/python3.6/test/tokenize_tests-latin1-coding-cookie-and-utf8-bom-sig.txt +0 -13
- package/python3.6.2/lib/python3.6/test/tokenize_tests-no-coding-cookie-and-utf8-bom-sig-only.txt +0 -11
- package/python3.6.2/lib/python3.6/test/tokenize_tests-utf8-coding-cookie-and-no-utf8-bom-sig.txt +0 -13
- package/python3.6.2/lib/python3.6/test/tokenize_tests-utf8-coding-cookie-and-utf8-bom-sig.txt +0 -12
- package/python3.6.2/lib/python3.6/test/tokenize_tests.txt +0 -189
- package/python3.6.2/lib/python3.6/test/tracedmodules/__init__.py +0 -4
- package/python3.6.2/lib/python3.6/test/tracedmodules/testmod.py +0 -9
- package/python3.6.2/lib/python3.6/test/win_console_handler.py +0 -49
- package/python3.6.2/lib/python3.6/test/wrongcert.pem +0 -32
- package/python3.6.2/lib/python3.6/test/xmltestdata/expat224_utf8_bug.xml +0 -2
- package/python3.6.2/lib/python3.6/test/xmltestdata/simple-ns.xml +0 -7
- package/python3.6.2/lib/python3.6/test/xmltestdata/simple.xml +0 -6
- package/python3.6.2/lib/python3.6/test/xmltestdata/test.xml +0 -115
- package/python3.6.2/lib/python3.6/test/xmltestdata/test.xml.out +0 -115
- package/python3.6.2/lib/python3.6/test/xmltests.py +0 -21
- package/python3.6.2/lib/python3.6/test/zip_cp437_header.zip +0 -0
- package/python3.6.2/lib/python3.6/test/zipdir.zip +0 -0
- package/python3.6.2/lib/python3.6/textwrap.py +0 -488
- package/python3.6.2/lib/python3.6/this.py +0 -28
- package/python3.6.2/lib/python3.6/threading.py +0 -1357
- package/python3.6.2/lib/python3.6/timeit.py +0 -362
- package/python3.6.2/lib/python3.6/tkinter/__init__.py +0 -4002
- package/python3.6.2/lib/python3.6/tkinter/__main__.py +0 -7
- package/python3.6.2/lib/python3.6/tkinter/colorchooser.py +0 -72
- package/python3.6.2/lib/python3.6/tkinter/commondialog.py +0 -55
- package/python3.6.2/lib/python3.6/tkinter/constants.py +0 -110
- package/python3.6.2/lib/python3.6/tkinter/dialog.py +0 -46
- package/python3.6.2/lib/python3.6/tkinter/dnd.py +0 -321
- package/python3.6.2/lib/python3.6/tkinter/filedialog.py +0 -479
- package/python3.6.2/lib/python3.6/tkinter/font.py +0 -232
- package/python3.6.2/lib/python3.6/tkinter/messagebox.py +0 -134
- package/python3.6.2/lib/python3.6/tkinter/scrolledtext.py +0 -54
- package/python3.6.2/lib/python3.6/tkinter/simpledialog.py +0 -423
- package/python3.6.2/lib/python3.6/tkinter/test/README +0 -14
- package/python3.6.2/lib/python3.6/tkinter/test/__init__.py +0 -0
- package/python3.6.2/lib/python3.6/tkinter/test/runtktests.py +0 -69
- package/python3.6.2/lib/python3.6/tkinter/test/support.py +0 -105
- package/python3.6.2/lib/python3.6/tkinter/test/test_tkinter/__init__.py +0 -0
- package/python3.6.2/lib/python3.6/tkinter/test/test_tkinter/test_font.py +0 -96
- package/python3.6.2/lib/python3.6/tkinter/test/test_tkinter/test_geometry_managers.py +0 -906
- package/python3.6.2/lib/python3.6/tkinter/test/test_tkinter/test_images.py +0 -327
- package/python3.6.2/lib/python3.6/tkinter/test/test_tkinter/test_loadtk.py +0 -46
- package/python3.6.2/lib/python3.6/tkinter/test/test_tkinter/test_misc.py +0 -55
- package/python3.6.2/lib/python3.6/tkinter/test/test_tkinter/test_text.py +0 -47
- package/python3.6.2/lib/python3.6/tkinter/test/test_tkinter/test_variables.py +0 -310
- package/python3.6.2/lib/python3.6/tkinter/test/test_tkinter/test_widgets.py +0 -1204
- package/python3.6.2/lib/python3.6/tkinter/test/test_ttk/__init__.py +0 -0
- package/python3.6.2/lib/python3.6/tkinter/test/test_ttk/test_extensions.py +0 -323
- package/python3.6.2/lib/python3.6/tkinter/test/test_ttk/test_functions.py +0 -461
- package/python3.6.2/lib/python3.6/tkinter/test/test_ttk/test_style.py +0 -92
- package/python3.6.2/lib/python3.6/tkinter/test/test_ttk/test_widgets.py +0 -1707
- package/python3.6.2/lib/python3.6/tkinter/test/widget_tests.py +0 -548
- package/python3.6.2/lib/python3.6/tkinter/tix.py +0 -1946
- package/python3.6.2/lib/python3.6/tkinter/ttk.py +0 -1655
- package/python3.6.2/lib/python3.6/token.py +0 -143
- package/python3.6.2/lib/python3.6/tokenize.py +0 -793
- package/python3.6.2/lib/python3.6/trace.py +0 -742
- package/python3.6.2/lib/python3.6/traceback.py +0 -600
- package/python3.6.2/lib/python3.6/tracemalloc.py +0 -524
- package/python3.6.2/lib/python3.6/tty.py +0 -36
- package/python3.6.2/lib/python3.6/turtle.py +0 -4139
- package/python3.6.2/lib/python3.6/turtledemo/__init__.py +0 -14
- package/python3.6.2/lib/python3.6/turtledemo/__main__.py +0 -386
- package/python3.6.2/lib/python3.6/turtledemo/bytedesign.py +0 -161
- package/python3.6.2/lib/python3.6/turtledemo/chaos.py +0 -59
- package/python3.6.2/lib/python3.6/turtledemo/clock.py +0 -132
- package/python3.6.2/lib/python3.6/turtledemo/colormixer.py +0 -58
- package/python3.6.2/lib/python3.6/turtledemo/forest.py +0 -108
- package/python3.6.2/lib/python3.6/turtledemo/fractalcurves.py +0 -138
- package/python3.6.2/lib/python3.6/turtledemo/lindenmayer.py +0 -119
- package/python3.6.2/lib/python3.6/turtledemo/minimal_hanoi.py +0 -79
- package/python3.6.2/lib/python3.6/turtledemo/nim.py +0 -226
- package/python3.6.2/lib/python3.6/turtledemo/paint.py +0 -54
- package/python3.6.2/lib/python3.6/turtledemo/peace.py +0 -61
- package/python3.6.2/lib/python3.6/turtledemo/penrose.py +0 -181
- package/python3.6.2/lib/python3.6/turtledemo/planet_and_moon.py +0 -111
- package/python3.6.2/lib/python3.6/turtledemo/round_dance.py +0 -86
- package/python3.6.2/lib/python3.6/turtledemo/sorting_animate.py +0 -204
- package/python3.6.2/lib/python3.6/turtledemo/tree.py +0 -63
- package/python3.6.2/lib/python3.6/turtledemo/turtle.cfg +0 -10
- package/python3.6.2/lib/python3.6/turtledemo/two_canvases.py +0 -54
- package/python3.6.2/lib/python3.6/turtledemo/wikipedia.py +0 -65
- package/python3.6.2/lib/python3.6/turtledemo/yinyang.py +0 -49
- package/python3.6.2/lib/python3.6/types.py +0 -266
- package/python3.6.2/lib/python3.6/typing.py +0 -2403
- package/python3.6.2/lib/python3.6/unittest/__init__.py +0 -78
- package/python3.6.2/lib/python3.6/unittest/__main__.py +0 -18
- package/python3.6.2/lib/python3.6/unittest/case.py +0 -1429
- package/python3.6.2/lib/python3.6/unittest/loader.py +0 -508
- package/python3.6.2/lib/python3.6/unittest/main.py +0 -260
- package/python3.6.2/lib/python3.6/unittest/mock.py +0 -2407
- package/python3.6.2/lib/python3.6/unittest/result.py +0 -216
- package/python3.6.2/lib/python3.6/unittest/runner.py +0 -221
- package/python3.6.2/lib/python3.6/unittest/signals.py +0 -71
- package/python3.6.2/lib/python3.6/unittest/suite.py +0 -321
- package/python3.6.2/lib/python3.6/unittest/test/__init__.py +0 -22
- package/python3.6.2/lib/python3.6/unittest/test/__main__.py +0 -18
- package/python3.6.2/lib/python3.6/unittest/test/_test_warnings.py +0 -73
- package/python3.6.2/lib/python3.6/unittest/test/dummy.py +0 -1
- package/python3.6.2/lib/python3.6/unittest/test/support.py +0 -138
- package/python3.6.2/lib/python3.6/unittest/test/test_assertions.py +0 -411
- package/python3.6.2/lib/python3.6/unittest/test/test_break.py +0 -291
- package/python3.6.2/lib/python3.6/unittest/test/test_case.py +0 -1833
- package/python3.6.2/lib/python3.6/unittest/test/test_discovery.py +0 -872
- package/python3.6.2/lib/python3.6/unittest/test/test_functiontestcase.py +0 -148
- package/python3.6.2/lib/python3.6/unittest/test/test_loader.py +0 -1529
- package/python3.6.2/lib/python3.6/unittest/test/test_program.py +0 -414
- package/python3.6.2/lib/python3.6/unittest/test/test_result.py +0 -695
- package/python3.6.2/lib/python3.6/unittest/test/test_runner.py +0 -353
- package/python3.6.2/lib/python3.6/unittest/test/test_setups.py +0 -507
- package/python3.6.2/lib/python3.6/unittest/test/test_skipping.py +0 -260
- package/python3.6.2/lib/python3.6/unittest/test/test_suite.py +0 -447
- package/python3.6.2/lib/python3.6/unittest/test/testmock/__init__.py +0 -17
- package/python3.6.2/lib/python3.6/unittest/test/testmock/__main__.py +0 -18
- package/python3.6.2/lib/python3.6/unittest/test/testmock/support.py +0 -21
- package/python3.6.2/lib/python3.6/unittest/test/testmock/testcallable.py +0 -151
- package/python3.6.2/lib/python3.6/unittest/test/testmock/testhelpers.py +0 -946
- package/python3.6.2/lib/python3.6/unittest/test/testmock/testmagicmethods.py +0 -468
- package/python3.6.2/lib/python3.6/unittest/test/testmock/testmock.py +0 -1569
- package/python3.6.2/lib/python3.6/unittest/test/testmock/testpatch.py +0 -1853
- package/python3.6.2/lib/python3.6/unittest/test/testmock/testsentinel.py +0 -28
- package/python3.6.2/lib/python3.6/unittest/test/testmock/testwith.py +0 -301
- package/python3.6.2/lib/python3.6/unittest/util.py +0 -177
- package/python3.6.2/lib/python3.6/urllib/__init__.py +0 -0
- package/python3.6.2/lib/python3.6/urllib/error.py +0 -77
- package/python3.6.2/lib/python3.6/urllib/parse.py +0 -1021
- package/python3.6.2/lib/python3.6/urllib/request.py +0 -2739
- package/python3.6.2/lib/python3.6/urllib/response.py +0 -80
- package/python3.6.2/lib/python3.6/urllib/robotparser.py +0 -250
- package/python3.6.2/lib/python3.6/uu.py +0 -199
- package/python3.6.2/lib/python3.6/uuid.py +0 -629
- package/python3.6.2/lib/python3.6/venv/__init__.py +0 -425
- package/python3.6.2/lib/python3.6/venv/__main__.py +0 -10
- package/python3.6.2/lib/python3.6/venv/scripts/nt/Activate.ps1 +0 -51
- package/python3.6.2/lib/python3.6/venv/scripts/nt/activate.bat +0 -32
- package/python3.6.2/lib/python3.6/venv/scripts/nt/deactivate.bat +0 -21
- package/python3.6.2/lib/python3.6/warnings.py +0 -526
- package/python3.6.2/lib/python3.6/wave.py +0 -505
- package/python3.6.2/lib/python3.6/weakref.py +0 -632
- package/python3.6.2/lib/python3.6/webbrowser.py +0 -664
- package/python3.6.2/lib/python3.6/wsgiref/__init__.py +0 -23
- package/python3.6.2/lib/python3.6/wsgiref/handlers.py +0 -557
- package/python3.6.2/lib/python3.6/wsgiref/headers.py +0 -184
- package/python3.6.2/lib/python3.6/wsgiref/simple_server.py +0 -164
- package/python3.6.2/lib/python3.6/wsgiref/util.py +0 -165
- package/python3.6.2/lib/python3.6/wsgiref/validate.py +0 -443
- package/python3.6.2/lib/python3.6/xdrlib.py +0 -241
- package/python3.6.2/lib/python3.6/xml/__init__.py +0 -20
- package/python3.6.2/lib/python3.6/xml/dom/NodeFilter.py +0 -27
- package/python3.6.2/lib/python3.6/xml/dom/__init__.py +0 -140
- package/python3.6.2/lib/python3.6/xml/dom/domreg.py +0 -97
- package/python3.6.2/lib/python3.6/xml/dom/expatbuilder.py +0 -965
- package/python3.6.2/lib/python3.6/xml/dom/minicompat.py +0 -109
- package/python3.6.2/lib/python3.6/xml/dom/minidom.py +0 -1981
- package/python3.6.2/lib/python3.6/xml/dom/pulldom.py +0 -342
- package/python3.6.2/lib/python3.6/xml/dom/xmlbuilder.py +0 -410
- package/python3.6.2/lib/python3.6/xml/etree/ElementInclude.py +0 -143
- package/python3.6.2/lib/python3.6/xml/etree/ElementPath.py +0 -314
- package/python3.6.2/lib/python3.6/xml/etree/ElementTree.py +0 -1656
- package/python3.6.2/lib/python3.6/xml/etree/__init__.py +0 -33
- package/python3.6.2/lib/python3.6/xml/etree/cElementTree.py +0 -3
- package/python3.6.2/lib/python3.6/xml/parsers/__init__.py +0 -8
- package/python3.6.2/lib/python3.6/xml/parsers/expat.py +0 -8
- package/python3.6.2/lib/python3.6/xml/sax/__init__.py +0 -107
- package/python3.6.2/lib/python3.6/xml/sax/_exceptions.py +0 -131
- package/python3.6.2/lib/python3.6/xml/sax/expatreader.py +0 -446
- package/python3.6.2/lib/python3.6/xml/sax/handler.py +0 -342
- package/python3.6.2/lib/python3.6/xml/sax/saxutils.py +0 -368
- package/python3.6.2/lib/python3.6/xml/sax/xmlreader.py +0 -380
- package/python3.6.2/lib/python3.6/xmlrpc/__init__.py +0 -1
- package/python3.6.2/lib/python3.6/xmlrpc/client.py +0 -1518
- package/python3.6.2/lib/python3.6/xmlrpc/server.py +0 -1002
- package/python3.6.2/lib/python3.6/zipapp.py +0 -201
- package/python3.6.2/lib/python3.6/zipfile.py +0 -2036
|
@@ -1,4929 +0,0 @@
|
|
|
1
|
-
"""Test date/time type.
|
|
2
|
-
|
|
3
|
-
See http://www.zope.org/Members/fdrake/DateTimeWiki/TestCases
|
|
4
|
-
"""
|
|
5
|
-
from test.support import is_resource_enabled
|
|
6
|
-
|
|
7
|
-
import itertools
|
|
8
|
-
import bisect
|
|
9
|
-
|
|
10
|
-
import copy
|
|
11
|
-
import decimal
|
|
12
|
-
import sys
|
|
13
|
-
import os
|
|
14
|
-
import pickle
|
|
15
|
-
import random
|
|
16
|
-
import struct
|
|
17
|
-
import unittest
|
|
18
|
-
|
|
19
|
-
from array import array
|
|
20
|
-
|
|
21
|
-
from operator import lt, le, gt, ge, eq, ne, truediv, floordiv, mod
|
|
22
|
-
|
|
23
|
-
from test import support
|
|
24
|
-
|
|
25
|
-
import datetime as datetime_module
|
|
26
|
-
from datetime import MINYEAR, MAXYEAR
|
|
27
|
-
from datetime import timedelta
|
|
28
|
-
from datetime import tzinfo
|
|
29
|
-
from datetime import time
|
|
30
|
-
from datetime import timezone
|
|
31
|
-
from datetime import date, datetime
|
|
32
|
-
import time as _time
|
|
33
|
-
|
|
34
|
-
# Needed by test_datetime
|
|
35
|
-
import _strptime
|
|
36
|
-
#
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
pickle_choices = [(pickle, pickle, proto)
|
|
40
|
-
for proto in range(pickle.HIGHEST_PROTOCOL + 1)]
|
|
41
|
-
assert len(pickle_choices) == pickle.HIGHEST_PROTOCOL + 1
|
|
42
|
-
|
|
43
|
-
# An arbitrary collection of objects of non-datetime types, for testing
|
|
44
|
-
# mixed-type comparisons.
|
|
45
|
-
OTHERSTUFF = (10, 34.5, "abc", {}, [], ())
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
# XXX Copied from test_float.
|
|
49
|
-
INF = float("inf")
|
|
50
|
-
NAN = float("nan")
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
#############################################################################
|
|
54
|
-
# module tests
|
|
55
|
-
|
|
56
|
-
class TestModule(unittest.TestCase):
|
|
57
|
-
|
|
58
|
-
def test_constants(self):
|
|
59
|
-
datetime = datetime_module
|
|
60
|
-
self.assertEqual(datetime.MINYEAR, 1)
|
|
61
|
-
self.assertEqual(datetime.MAXYEAR, 9999)
|
|
62
|
-
|
|
63
|
-
def test_name_cleanup(self):
|
|
64
|
-
if '_Pure' in self.__class__.__name__:
|
|
65
|
-
self.skipTest('Only run for Fast C implementation')
|
|
66
|
-
|
|
67
|
-
datetime = datetime_module
|
|
68
|
-
names = set(name for name in dir(datetime)
|
|
69
|
-
if not name.startswith('__') and not name.endswith('__'))
|
|
70
|
-
allowed = set(['MAXYEAR', 'MINYEAR', 'date', 'datetime',
|
|
71
|
-
'datetime_CAPI', 'time', 'timedelta', 'timezone',
|
|
72
|
-
'tzinfo'])
|
|
73
|
-
self.assertEqual(names - allowed, set([]))
|
|
74
|
-
|
|
75
|
-
def test_divide_and_round(self):
|
|
76
|
-
if '_Fast' in self.__class__.__name__:
|
|
77
|
-
self.skipTest('Only run for Pure Python implementation')
|
|
78
|
-
|
|
79
|
-
dar = datetime_module._divide_and_round
|
|
80
|
-
|
|
81
|
-
self.assertEqual(dar(-10, -3), 3)
|
|
82
|
-
self.assertEqual(dar(5, -2), -2)
|
|
83
|
-
|
|
84
|
-
# four cases: (2 signs of a) x (2 signs of b)
|
|
85
|
-
self.assertEqual(dar(7, 3), 2)
|
|
86
|
-
self.assertEqual(dar(-7, 3), -2)
|
|
87
|
-
self.assertEqual(dar(7, -3), -2)
|
|
88
|
-
self.assertEqual(dar(-7, -3), 2)
|
|
89
|
-
|
|
90
|
-
# ties to even - eight cases:
|
|
91
|
-
# (2 signs of a) x (2 signs of b) x (even / odd quotient)
|
|
92
|
-
self.assertEqual(dar(10, 4), 2)
|
|
93
|
-
self.assertEqual(dar(-10, 4), -2)
|
|
94
|
-
self.assertEqual(dar(10, -4), -2)
|
|
95
|
-
self.assertEqual(dar(-10, -4), 2)
|
|
96
|
-
|
|
97
|
-
self.assertEqual(dar(6, 4), 2)
|
|
98
|
-
self.assertEqual(dar(-6, 4), -2)
|
|
99
|
-
self.assertEqual(dar(6, -4), -2)
|
|
100
|
-
self.assertEqual(dar(-6, -4), 2)
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
#############################################################################
|
|
104
|
-
# tzinfo tests
|
|
105
|
-
|
|
106
|
-
class FixedOffset(tzinfo):
|
|
107
|
-
|
|
108
|
-
def __init__(self, offset, name, dstoffset=42):
|
|
109
|
-
if isinstance(offset, int):
|
|
110
|
-
offset = timedelta(minutes=offset)
|
|
111
|
-
if isinstance(dstoffset, int):
|
|
112
|
-
dstoffset = timedelta(minutes=dstoffset)
|
|
113
|
-
self.__offset = offset
|
|
114
|
-
self.__name = name
|
|
115
|
-
self.__dstoffset = dstoffset
|
|
116
|
-
def __repr__(self):
|
|
117
|
-
return self.__name.lower()
|
|
118
|
-
def utcoffset(self, dt):
|
|
119
|
-
return self.__offset
|
|
120
|
-
def tzname(self, dt):
|
|
121
|
-
return self.__name
|
|
122
|
-
def dst(self, dt):
|
|
123
|
-
return self.__dstoffset
|
|
124
|
-
|
|
125
|
-
class PicklableFixedOffset(FixedOffset):
|
|
126
|
-
|
|
127
|
-
def __init__(self, offset=None, name=None, dstoffset=None):
|
|
128
|
-
FixedOffset.__init__(self, offset, name, dstoffset)
|
|
129
|
-
|
|
130
|
-
def __getstate__(self):
|
|
131
|
-
return self.__dict__
|
|
132
|
-
|
|
133
|
-
class _TZInfo(tzinfo):
|
|
134
|
-
def utcoffset(self, datetime_module):
|
|
135
|
-
return random.random()
|
|
136
|
-
|
|
137
|
-
class TestTZInfo(unittest.TestCase):
|
|
138
|
-
|
|
139
|
-
def test_refcnt_crash_bug_22044(self):
|
|
140
|
-
tz1 = _TZInfo()
|
|
141
|
-
dt1 = datetime(2014, 7, 21, 11, 32, 3, 0, tz1)
|
|
142
|
-
with self.assertRaises(TypeError):
|
|
143
|
-
dt1.utcoffset()
|
|
144
|
-
|
|
145
|
-
def test_non_abstractness(self):
|
|
146
|
-
# In order to allow subclasses to get pickled, the C implementation
|
|
147
|
-
# wasn't able to get away with having __init__ raise
|
|
148
|
-
# NotImplementedError.
|
|
149
|
-
useless = tzinfo()
|
|
150
|
-
dt = datetime.max
|
|
151
|
-
self.assertRaises(NotImplementedError, useless.tzname, dt)
|
|
152
|
-
self.assertRaises(NotImplementedError, useless.utcoffset, dt)
|
|
153
|
-
self.assertRaises(NotImplementedError, useless.dst, dt)
|
|
154
|
-
|
|
155
|
-
def test_subclass_must_override(self):
|
|
156
|
-
class NotEnough(tzinfo):
|
|
157
|
-
def __init__(self, offset, name):
|
|
158
|
-
self.__offset = offset
|
|
159
|
-
self.__name = name
|
|
160
|
-
self.assertTrue(issubclass(NotEnough, tzinfo))
|
|
161
|
-
ne = NotEnough(3, "NotByALongShot")
|
|
162
|
-
self.assertIsInstance(ne, tzinfo)
|
|
163
|
-
|
|
164
|
-
dt = datetime.now()
|
|
165
|
-
self.assertRaises(NotImplementedError, ne.tzname, dt)
|
|
166
|
-
self.assertRaises(NotImplementedError, ne.utcoffset, dt)
|
|
167
|
-
self.assertRaises(NotImplementedError, ne.dst, dt)
|
|
168
|
-
|
|
169
|
-
def test_normal(self):
|
|
170
|
-
fo = FixedOffset(3, "Three")
|
|
171
|
-
self.assertIsInstance(fo, tzinfo)
|
|
172
|
-
for dt in datetime.now(), None:
|
|
173
|
-
self.assertEqual(fo.utcoffset(dt), timedelta(minutes=3))
|
|
174
|
-
self.assertEqual(fo.tzname(dt), "Three")
|
|
175
|
-
self.assertEqual(fo.dst(dt), timedelta(minutes=42))
|
|
176
|
-
|
|
177
|
-
def test_pickling_base(self):
|
|
178
|
-
# There's no point to pickling tzinfo objects on their own (they
|
|
179
|
-
# carry no data), but they need to be picklable anyway else
|
|
180
|
-
# concrete subclasses can't be pickled.
|
|
181
|
-
orig = tzinfo.__new__(tzinfo)
|
|
182
|
-
self.assertIs(type(orig), tzinfo)
|
|
183
|
-
for pickler, unpickler, proto in pickle_choices:
|
|
184
|
-
green = pickler.dumps(orig, proto)
|
|
185
|
-
derived = unpickler.loads(green)
|
|
186
|
-
self.assertIs(type(derived), tzinfo)
|
|
187
|
-
|
|
188
|
-
def test_pickling_subclass(self):
|
|
189
|
-
# Make sure we can pickle/unpickle an instance of a subclass.
|
|
190
|
-
offset = timedelta(minutes=-300)
|
|
191
|
-
for otype, args in [
|
|
192
|
-
(PicklableFixedOffset, (offset, 'cookie')),
|
|
193
|
-
(timezone, (offset,)),
|
|
194
|
-
(timezone, (offset, "EST"))]:
|
|
195
|
-
orig = otype(*args)
|
|
196
|
-
oname = orig.tzname(None)
|
|
197
|
-
self.assertIsInstance(orig, tzinfo)
|
|
198
|
-
self.assertIs(type(orig), otype)
|
|
199
|
-
self.assertEqual(orig.utcoffset(None), offset)
|
|
200
|
-
self.assertEqual(orig.tzname(None), oname)
|
|
201
|
-
for pickler, unpickler, proto in pickle_choices:
|
|
202
|
-
green = pickler.dumps(orig, proto)
|
|
203
|
-
derived = unpickler.loads(green)
|
|
204
|
-
self.assertIsInstance(derived, tzinfo)
|
|
205
|
-
self.assertIs(type(derived), otype)
|
|
206
|
-
self.assertEqual(derived.utcoffset(None), offset)
|
|
207
|
-
self.assertEqual(derived.tzname(None), oname)
|
|
208
|
-
|
|
209
|
-
def test_issue23600(self):
|
|
210
|
-
DSTDIFF = DSTOFFSET = timedelta(hours=1)
|
|
211
|
-
|
|
212
|
-
class UKSummerTime(tzinfo):
|
|
213
|
-
"""Simple time zone which pretends to always be in summer time, since
|
|
214
|
-
that's what shows the failure.
|
|
215
|
-
"""
|
|
216
|
-
|
|
217
|
-
def utcoffset(self, dt):
|
|
218
|
-
return DSTOFFSET
|
|
219
|
-
|
|
220
|
-
def dst(self, dt):
|
|
221
|
-
return DSTDIFF
|
|
222
|
-
|
|
223
|
-
def tzname(self, dt):
|
|
224
|
-
return 'UKSummerTime'
|
|
225
|
-
|
|
226
|
-
tz = UKSummerTime()
|
|
227
|
-
u = datetime(2014, 4, 26, 12, 1, tzinfo=tz)
|
|
228
|
-
t = tz.fromutc(u)
|
|
229
|
-
self.assertEqual(t - t.utcoffset(), u)
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
class TestTimeZone(unittest.TestCase):
|
|
233
|
-
|
|
234
|
-
def setUp(self):
|
|
235
|
-
self.ACDT = timezone(timedelta(hours=9.5), 'ACDT')
|
|
236
|
-
self.EST = timezone(-timedelta(hours=5), 'EST')
|
|
237
|
-
self.DT = datetime(2010, 1, 1)
|
|
238
|
-
|
|
239
|
-
def test_str(self):
|
|
240
|
-
for tz in [self.ACDT, self.EST, timezone.utc,
|
|
241
|
-
timezone.min, timezone.max]:
|
|
242
|
-
self.assertEqual(str(tz), tz.tzname(None))
|
|
243
|
-
|
|
244
|
-
def test_repr(self):
|
|
245
|
-
datetime = datetime_module
|
|
246
|
-
for tz in [self.ACDT, self.EST, timezone.utc,
|
|
247
|
-
timezone.min, timezone.max]:
|
|
248
|
-
# test round-trip
|
|
249
|
-
tzrep = repr(tz)
|
|
250
|
-
self.assertEqual(tz, eval(tzrep))
|
|
251
|
-
|
|
252
|
-
def test_class_members(self):
|
|
253
|
-
limit = timedelta(hours=23, minutes=59)
|
|
254
|
-
self.assertEqual(timezone.utc.utcoffset(None), ZERO)
|
|
255
|
-
self.assertEqual(timezone.min.utcoffset(None), -limit)
|
|
256
|
-
self.assertEqual(timezone.max.utcoffset(None), limit)
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
def test_constructor(self):
|
|
260
|
-
self.assertIs(timezone.utc, timezone(timedelta(0)))
|
|
261
|
-
self.assertIsNot(timezone.utc, timezone(timedelta(0), 'UTC'))
|
|
262
|
-
self.assertEqual(timezone.utc, timezone(timedelta(0), 'UTC'))
|
|
263
|
-
# invalid offsets
|
|
264
|
-
for invalid in [timedelta(microseconds=1), timedelta(1, 1),
|
|
265
|
-
timedelta(seconds=1), timedelta(1), -timedelta(1)]:
|
|
266
|
-
self.assertRaises(ValueError, timezone, invalid)
|
|
267
|
-
self.assertRaises(ValueError, timezone, -invalid)
|
|
268
|
-
|
|
269
|
-
with self.assertRaises(TypeError): timezone(None)
|
|
270
|
-
with self.assertRaises(TypeError): timezone(42)
|
|
271
|
-
with self.assertRaises(TypeError): timezone(ZERO, None)
|
|
272
|
-
with self.assertRaises(TypeError): timezone(ZERO, 42)
|
|
273
|
-
with self.assertRaises(TypeError): timezone(ZERO, 'ABC', 'extra')
|
|
274
|
-
|
|
275
|
-
def test_inheritance(self):
|
|
276
|
-
self.assertIsInstance(timezone.utc, tzinfo)
|
|
277
|
-
self.assertIsInstance(self.EST, tzinfo)
|
|
278
|
-
|
|
279
|
-
def test_utcoffset(self):
|
|
280
|
-
dummy = self.DT
|
|
281
|
-
for h in [0, 1.5, 12]:
|
|
282
|
-
offset = h * HOUR
|
|
283
|
-
self.assertEqual(offset, timezone(offset).utcoffset(dummy))
|
|
284
|
-
self.assertEqual(-offset, timezone(-offset).utcoffset(dummy))
|
|
285
|
-
|
|
286
|
-
with self.assertRaises(TypeError): self.EST.utcoffset('')
|
|
287
|
-
with self.assertRaises(TypeError): self.EST.utcoffset(5)
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
def test_dst(self):
|
|
291
|
-
self.assertIsNone(timezone.utc.dst(self.DT))
|
|
292
|
-
|
|
293
|
-
with self.assertRaises(TypeError): self.EST.dst('')
|
|
294
|
-
with self.assertRaises(TypeError): self.EST.dst(5)
|
|
295
|
-
|
|
296
|
-
def test_tzname(self):
|
|
297
|
-
self.assertEqual('UTC', timezone.utc.tzname(None))
|
|
298
|
-
self.assertEqual('UTC', timezone(ZERO).tzname(None))
|
|
299
|
-
self.assertEqual('UTC-05:00', timezone(-5 * HOUR).tzname(None))
|
|
300
|
-
self.assertEqual('UTC+09:30', timezone(9.5 * HOUR).tzname(None))
|
|
301
|
-
self.assertEqual('UTC-00:01', timezone(timedelta(minutes=-1)).tzname(None))
|
|
302
|
-
self.assertEqual('XYZ', timezone(-5 * HOUR, 'XYZ').tzname(None))
|
|
303
|
-
|
|
304
|
-
with self.assertRaises(TypeError): self.EST.tzname('')
|
|
305
|
-
with self.assertRaises(TypeError): self.EST.tzname(5)
|
|
306
|
-
|
|
307
|
-
def test_fromutc(self):
|
|
308
|
-
with self.assertRaises(ValueError):
|
|
309
|
-
timezone.utc.fromutc(self.DT)
|
|
310
|
-
with self.assertRaises(TypeError):
|
|
311
|
-
timezone.utc.fromutc('not datetime')
|
|
312
|
-
for tz in [self.EST, self.ACDT, Eastern]:
|
|
313
|
-
utctime = self.DT.replace(tzinfo=tz)
|
|
314
|
-
local = tz.fromutc(utctime)
|
|
315
|
-
self.assertEqual(local - utctime, tz.utcoffset(local))
|
|
316
|
-
self.assertEqual(local,
|
|
317
|
-
self.DT.replace(tzinfo=timezone.utc))
|
|
318
|
-
|
|
319
|
-
def test_comparison(self):
|
|
320
|
-
self.assertNotEqual(timezone(ZERO), timezone(HOUR))
|
|
321
|
-
self.assertEqual(timezone(HOUR), timezone(HOUR))
|
|
322
|
-
self.assertEqual(timezone(-5 * HOUR), timezone(-5 * HOUR, 'EST'))
|
|
323
|
-
with self.assertRaises(TypeError): timezone(ZERO) < timezone(ZERO)
|
|
324
|
-
self.assertIn(timezone(ZERO), {timezone(ZERO)})
|
|
325
|
-
self.assertTrue(timezone(ZERO) != None)
|
|
326
|
-
self.assertFalse(timezone(ZERO) == None)
|
|
327
|
-
|
|
328
|
-
def test_aware_datetime(self):
|
|
329
|
-
# test that timezone instances can be used by datetime
|
|
330
|
-
t = datetime(1, 1, 1)
|
|
331
|
-
for tz in [timezone.min, timezone.max, timezone.utc]:
|
|
332
|
-
self.assertEqual(tz.tzname(t),
|
|
333
|
-
t.replace(tzinfo=tz).tzname())
|
|
334
|
-
self.assertEqual(tz.utcoffset(t),
|
|
335
|
-
t.replace(tzinfo=tz).utcoffset())
|
|
336
|
-
self.assertEqual(tz.dst(t),
|
|
337
|
-
t.replace(tzinfo=tz).dst())
|
|
338
|
-
|
|
339
|
-
def test_pickle(self):
|
|
340
|
-
for tz in self.ACDT, self.EST, timezone.min, timezone.max:
|
|
341
|
-
for pickler, unpickler, proto in pickle_choices:
|
|
342
|
-
tz_copy = unpickler.loads(pickler.dumps(tz, proto))
|
|
343
|
-
self.assertEqual(tz_copy, tz)
|
|
344
|
-
tz = timezone.utc
|
|
345
|
-
for pickler, unpickler, proto in pickle_choices:
|
|
346
|
-
tz_copy = unpickler.loads(pickler.dumps(tz, proto))
|
|
347
|
-
self.assertIs(tz_copy, tz)
|
|
348
|
-
|
|
349
|
-
def test_copy(self):
|
|
350
|
-
for tz in self.ACDT, self.EST, timezone.min, timezone.max:
|
|
351
|
-
tz_copy = copy.copy(tz)
|
|
352
|
-
self.assertEqual(tz_copy, tz)
|
|
353
|
-
tz = timezone.utc
|
|
354
|
-
tz_copy = copy.copy(tz)
|
|
355
|
-
self.assertIs(tz_copy, tz)
|
|
356
|
-
|
|
357
|
-
def test_deepcopy(self):
|
|
358
|
-
for tz in self.ACDT, self.EST, timezone.min, timezone.max:
|
|
359
|
-
tz_copy = copy.deepcopy(tz)
|
|
360
|
-
self.assertEqual(tz_copy, tz)
|
|
361
|
-
tz = timezone.utc
|
|
362
|
-
tz_copy = copy.deepcopy(tz)
|
|
363
|
-
self.assertIs(tz_copy, tz)
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
#############################################################################
|
|
367
|
-
# Base class for testing a particular aspect of timedelta, time, date and
|
|
368
|
-
# datetime comparisons.
|
|
369
|
-
|
|
370
|
-
class HarmlessMixedComparison:
|
|
371
|
-
# Test that __eq__ and __ne__ don't complain for mixed-type comparisons.
|
|
372
|
-
|
|
373
|
-
# Subclasses must define 'theclass', and theclass(1, 1, 1) must be a
|
|
374
|
-
# legit constructor.
|
|
375
|
-
|
|
376
|
-
def test_harmless_mixed_comparison(self):
|
|
377
|
-
me = self.theclass(1, 1, 1)
|
|
378
|
-
|
|
379
|
-
self.assertFalse(me == ())
|
|
380
|
-
self.assertTrue(me != ())
|
|
381
|
-
self.assertFalse(() == me)
|
|
382
|
-
self.assertTrue(() != me)
|
|
383
|
-
|
|
384
|
-
self.assertIn(me, [1, 20, [], me])
|
|
385
|
-
self.assertIn([], [me, 1, 20, []])
|
|
386
|
-
|
|
387
|
-
def test_harmful_mixed_comparison(self):
|
|
388
|
-
me = self.theclass(1, 1, 1)
|
|
389
|
-
|
|
390
|
-
self.assertRaises(TypeError, lambda: me < ())
|
|
391
|
-
self.assertRaises(TypeError, lambda: me <= ())
|
|
392
|
-
self.assertRaises(TypeError, lambda: me > ())
|
|
393
|
-
self.assertRaises(TypeError, lambda: me >= ())
|
|
394
|
-
|
|
395
|
-
self.assertRaises(TypeError, lambda: () < me)
|
|
396
|
-
self.assertRaises(TypeError, lambda: () <= me)
|
|
397
|
-
self.assertRaises(TypeError, lambda: () > me)
|
|
398
|
-
self.assertRaises(TypeError, lambda: () >= me)
|
|
399
|
-
|
|
400
|
-
#############################################################################
|
|
401
|
-
# timedelta tests
|
|
402
|
-
|
|
403
|
-
class TestTimeDelta(HarmlessMixedComparison, unittest.TestCase):
|
|
404
|
-
|
|
405
|
-
theclass = timedelta
|
|
406
|
-
|
|
407
|
-
def test_constructor(self):
|
|
408
|
-
eq = self.assertEqual
|
|
409
|
-
td = timedelta
|
|
410
|
-
|
|
411
|
-
# Check keyword args to constructor
|
|
412
|
-
eq(td(), td(weeks=0, days=0, hours=0, minutes=0, seconds=0,
|
|
413
|
-
milliseconds=0, microseconds=0))
|
|
414
|
-
eq(td(1), td(days=1))
|
|
415
|
-
eq(td(0, 1), td(seconds=1))
|
|
416
|
-
eq(td(0, 0, 1), td(microseconds=1))
|
|
417
|
-
eq(td(weeks=1), td(days=7))
|
|
418
|
-
eq(td(days=1), td(hours=24))
|
|
419
|
-
eq(td(hours=1), td(minutes=60))
|
|
420
|
-
eq(td(minutes=1), td(seconds=60))
|
|
421
|
-
eq(td(seconds=1), td(milliseconds=1000))
|
|
422
|
-
eq(td(milliseconds=1), td(microseconds=1000))
|
|
423
|
-
|
|
424
|
-
# Check float args to constructor
|
|
425
|
-
eq(td(weeks=1.0/7), td(days=1))
|
|
426
|
-
eq(td(days=1.0/24), td(hours=1))
|
|
427
|
-
eq(td(hours=1.0/60), td(minutes=1))
|
|
428
|
-
eq(td(minutes=1.0/60), td(seconds=1))
|
|
429
|
-
eq(td(seconds=0.001), td(milliseconds=1))
|
|
430
|
-
eq(td(milliseconds=0.001), td(microseconds=1))
|
|
431
|
-
|
|
432
|
-
def test_computations(self):
|
|
433
|
-
eq = self.assertEqual
|
|
434
|
-
td = timedelta
|
|
435
|
-
|
|
436
|
-
a = td(7) # One week
|
|
437
|
-
b = td(0, 60) # One minute
|
|
438
|
-
c = td(0, 0, 1000) # One millisecond
|
|
439
|
-
eq(a+b+c, td(7, 60, 1000))
|
|
440
|
-
eq(a-b, td(6, 24*3600 - 60))
|
|
441
|
-
eq(b.__rsub__(a), td(6, 24*3600 - 60))
|
|
442
|
-
eq(-a, td(-7))
|
|
443
|
-
eq(+a, td(7))
|
|
444
|
-
eq(-b, td(-1, 24*3600 - 60))
|
|
445
|
-
eq(-c, td(-1, 24*3600 - 1, 999000))
|
|
446
|
-
eq(abs(a), a)
|
|
447
|
-
eq(abs(-a), a)
|
|
448
|
-
eq(td(6, 24*3600), a)
|
|
449
|
-
eq(td(0, 0, 60*1000000), b)
|
|
450
|
-
eq(a*10, td(70))
|
|
451
|
-
eq(a*10, 10*a)
|
|
452
|
-
eq(a*10, 10*a)
|
|
453
|
-
eq(b*10, td(0, 600))
|
|
454
|
-
eq(10*b, td(0, 600))
|
|
455
|
-
eq(b*10, td(0, 600))
|
|
456
|
-
eq(c*10, td(0, 0, 10000))
|
|
457
|
-
eq(10*c, td(0, 0, 10000))
|
|
458
|
-
eq(c*10, td(0, 0, 10000))
|
|
459
|
-
eq(a*-1, -a)
|
|
460
|
-
eq(b*-2, -b-b)
|
|
461
|
-
eq(c*-2, -c+-c)
|
|
462
|
-
eq(b*(60*24), (b*60)*24)
|
|
463
|
-
eq(b*(60*24), (60*b)*24)
|
|
464
|
-
eq(c*1000, td(0, 1))
|
|
465
|
-
eq(1000*c, td(0, 1))
|
|
466
|
-
eq(a//7, td(1))
|
|
467
|
-
eq(b//10, td(0, 6))
|
|
468
|
-
eq(c//1000, td(0, 0, 1))
|
|
469
|
-
eq(a//10, td(0, 7*24*360))
|
|
470
|
-
eq(a//3600000, td(0, 0, 7*24*1000))
|
|
471
|
-
eq(a/0.5, td(14))
|
|
472
|
-
eq(b/0.5, td(0, 120))
|
|
473
|
-
eq(a/7, td(1))
|
|
474
|
-
eq(b/10, td(0, 6))
|
|
475
|
-
eq(c/1000, td(0, 0, 1))
|
|
476
|
-
eq(a/10, td(0, 7*24*360))
|
|
477
|
-
eq(a/3600000, td(0, 0, 7*24*1000))
|
|
478
|
-
|
|
479
|
-
# Multiplication by float
|
|
480
|
-
us = td(microseconds=1)
|
|
481
|
-
eq((3*us) * 0.5, 2*us)
|
|
482
|
-
eq((5*us) * 0.5, 2*us)
|
|
483
|
-
eq(0.5 * (3*us), 2*us)
|
|
484
|
-
eq(0.5 * (5*us), 2*us)
|
|
485
|
-
eq((-3*us) * 0.5, -2*us)
|
|
486
|
-
eq((-5*us) * 0.5, -2*us)
|
|
487
|
-
|
|
488
|
-
# Issue #23521
|
|
489
|
-
eq(td(seconds=1) * 0.123456, td(microseconds=123456))
|
|
490
|
-
eq(td(seconds=1) * 0.6112295, td(microseconds=611229))
|
|
491
|
-
|
|
492
|
-
# Division by int and float
|
|
493
|
-
eq((3*us) / 2, 2*us)
|
|
494
|
-
eq((5*us) / 2, 2*us)
|
|
495
|
-
eq((-3*us) / 2.0, -2*us)
|
|
496
|
-
eq((-5*us) / 2.0, -2*us)
|
|
497
|
-
eq((3*us) / -2, -2*us)
|
|
498
|
-
eq((5*us) / -2, -2*us)
|
|
499
|
-
eq((3*us) / -2.0, -2*us)
|
|
500
|
-
eq((5*us) / -2.0, -2*us)
|
|
501
|
-
for i in range(-10, 10):
|
|
502
|
-
eq((i*us/3)//us, round(i/3))
|
|
503
|
-
for i in range(-10, 10):
|
|
504
|
-
eq((i*us/-3)//us, round(i/-3))
|
|
505
|
-
|
|
506
|
-
# Issue #23521
|
|
507
|
-
eq(td(seconds=1) / (1 / 0.6112295), td(microseconds=611229))
|
|
508
|
-
|
|
509
|
-
# Issue #11576
|
|
510
|
-
eq(td(999999999, 86399, 999999) - td(999999999, 86399, 999998),
|
|
511
|
-
td(0, 0, 1))
|
|
512
|
-
eq(td(999999999, 1, 1) - td(999999999, 1, 0),
|
|
513
|
-
td(0, 0, 1))
|
|
514
|
-
|
|
515
|
-
def test_disallowed_computations(self):
|
|
516
|
-
a = timedelta(42)
|
|
517
|
-
|
|
518
|
-
# Add/sub ints or floats should be illegal
|
|
519
|
-
for i in 1, 1.0:
|
|
520
|
-
self.assertRaises(TypeError, lambda: a+i)
|
|
521
|
-
self.assertRaises(TypeError, lambda: a-i)
|
|
522
|
-
self.assertRaises(TypeError, lambda: i+a)
|
|
523
|
-
self.assertRaises(TypeError, lambda: i-a)
|
|
524
|
-
|
|
525
|
-
# Division of int by timedelta doesn't make sense.
|
|
526
|
-
# Division by zero doesn't make sense.
|
|
527
|
-
zero = 0
|
|
528
|
-
self.assertRaises(TypeError, lambda: zero // a)
|
|
529
|
-
self.assertRaises(ZeroDivisionError, lambda: a // zero)
|
|
530
|
-
self.assertRaises(ZeroDivisionError, lambda: a / zero)
|
|
531
|
-
self.assertRaises(ZeroDivisionError, lambda: a / 0.0)
|
|
532
|
-
self.assertRaises(TypeError, lambda: a / '')
|
|
533
|
-
|
|
534
|
-
@support.requires_IEEE_754
|
|
535
|
-
def test_disallowed_special(self):
|
|
536
|
-
a = timedelta(42)
|
|
537
|
-
self.assertRaises(ValueError, a.__mul__, NAN)
|
|
538
|
-
self.assertRaises(ValueError, a.__truediv__, NAN)
|
|
539
|
-
|
|
540
|
-
def test_basic_attributes(self):
|
|
541
|
-
days, seconds, us = 1, 7, 31
|
|
542
|
-
td = timedelta(days, seconds, us)
|
|
543
|
-
self.assertEqual(td.days, days)
|
|
544
|
-
self.assertEqual(td.seconds, seconds)
|
|
545
|
-
self.assertEqual(td.microseconds, us)
|
|
546
|
-
|
|
547
|
-
def test_total_seconds(self):
|
|
548
|
-
td = timedelta(days=365)
|
|
549
|
-
self.assertEqual(td.total_seconds(), 31536000.0)
|
|
550
|
-
for total_seconds in [123456.789012, -123456.789012, 0.123456, 0, 1e6]:
|
|
551
|
-
td = timedelta(seconds=total_seconds)
|
|
552
|
-
self.assertEqual(td.total_seconds(), total_seconds)
|
|
553
|
-
# Issue8644: Test that td.total_seconds() has the same
|
|
554
|
-
# accuracy as td / timedelta(seconds=1).
|
|
555
|
-
for ms in [-1, -2, -123]:
|
|
556
|
-
td = timedelta(microseconds=ms)
|
|
557
|
-
self.assertEqual(td.total_seconds(), td / timedelta(seconds=1))
|
|
558
|
-
|
|
559
|
-
def test_carries(self):
|
|
560
|
-
t1 = timedelta(days=100,
|
|
561
|
-
weeks=-7,
|
|
562
|
-
hours=-24*(100-49),
|
|
563
|
-
minutes=-3,
|
|
564
|
-
seconds=12,
|
|
565
|
-
microseconds=(3*60 - 12) * 1e6 + 1)
|
|
566
|
-
t2 = timedelta(microseconds=1)
|
|
567
|
-
self.assertEqual(t1, t2)
|
|
568
|
-
|
|
569
|
-
def test_hash_equality(self):
|
|
570
|
-
t1 = timedelta(days=100,
|
|
571
|
-
weeks=-7,
|
|
572
|
-
hours=-24*(100-49),
|
|
573
|
-
minutes=-3,
|
|
574
|
-
seconds=12,
|
|
575
|
-
microseconds=(3*60 - 12) * 1000000)
|
|
576
|
-
t2 = timedelta()
|
|
577
|
-
self.assertEqual(hash(t1), hash(t2))
|
|
578
|
-
|
|
579
|
-
t1 += timedelta(weeks=7)
|
|
580
|
-
t2 += timedelta(days=7*7)
|
|
581
|
-
self.assertEqual(t1, t2)
|
|
582
|
-
self.assertEqual(hash(t1), hash(t2))
|
|
583
|
-
|
|
584
|
-
d = {t1: 1}
|
|
585
|
-
d[t2] = 2
|
|
586
|
-
self.assertEqual(len(d), 1)
|
|
587
|
-
self.assertEqual(d[t1], 2)
|
|
588
|
-
|
|
589
|
-
def test_pickling(self):
|
|
590
|
-
args = 12, 34, 56
|
|
591
|
-
orig = timedelta(*args)
|
|
592
|
-
for pickler, unpickler, proto in pickle_choices:
|
|
593
|
-
green = pickler.dumps(orig, proto)
|
|
594
|
-
derived = unpickler.loads(green)
|
|
595
|
-
self.assertEqual(orig, derived)
|
|
596
|
-
|
|
597
|
-
def test_compare(self):
|
|
598
|
-
t1 = timedelta(2, 3, 4)
|
|
599
|
-
t2 = timedelta(2, 3, 4)
|
|
600
|
-
self.assertEqual(t1, t2)
|
|
601
|
-
self.assertTrue(t1 <= t2)
|
|
602
|
-
self.assertTrue(t1 >= t2)
|
|
603
|
-
self.assertFalse(t1 != t2)
|
|
604
|
-
self.assertFalse(t1 < t2)
|
|
605
|
-
self.assertFalse(t1 > t2)
|
|
606
|
-
|
|
607
|
-
for args in (3, 3, 3), (2, 4, 4), (2, 3, 5):
|
|
608
|
-
t2 = timedelta(*args) # this is larger than t1
|
|
609
|
-
self.assertTrue(t1 < t2)
|
|
610
|
-
self.assertTrue(t2 > t1)
|
|
611
|
-
self.assertTrue(t1 <= t2)
|
|
612
|
-
self.assertTrue(t2 >= t1)
|
|
613
|
-
self.assertTrue(t1 != t2)
|
|
614
|
-
self.assertTrue(t2 != t1)
|
|
615
|
-
self.assertFalse(t1 == t2)
|
|
616
|
-
self.assertFalse(t2 == t1)
|
|
617
|
-
self.assertFalse(t1 > t2)
|
|
618
|
-
self.assertFalse(t2 < t1)
|
|
619
|
-
self.assertFalse(t1 >= t2)
|
|
620
|
-
self.assertFalse(t2 <= t1)
|
|
621
|
-
|
|
622
|
-
for badarg in OTHERSTUFF:
|
|
623
|
-
self.assertEqual(t1 == badarg, False)
|
|
624
|
-
self.assertEqual(t1 != badarg, True)
|
|
625
|
-
self.assertEqual(badarg == t1, False)
|
|
626
|
-
self.assertEqual(badarg != t1, True)
|
|
627
|
-
|
|
628
|
-
self.assertRaises(TypeError, lambda: t1 <= badarg)
|
|
629
|
-
self.assertRaises(TypeError, lambda: t1 < badarg)
|
|
630
|
-
self.assertRaises(TypeError, lambda: t1 > badarg)
|
|
631
|
-
self.assertRaises(TypeError, lambda: t1 >= badarg)
|
|
632
|
-
self.assertRaises(TypeError, lambda: badarg <= t1)
|
|
633
|
-
self.assertRaises(TypeError, lambda: badarg < t1)
|
|
634
|
-
self.assertRaises(TypeError, lambda: badarg > t1)
|
|
635
|
-
self.assertRaises(TypeError, lambda: badarg >= t1)
|
|
636
|
-
|
|
637
|
-
def test_str(self):
|
|
638
|
-
td = timedelta
|
|
639
|
-
eq = self.assertEqual
|
|
640
|
-
|
|
641
|
-
eq(str(td(1)), "1 day, 0:00:00")
|
|
642
|
-
eq(str(td(-1)), "-1 day, 0:00:00")
|
|
643
|
-
eq(str(td(2)), "2 days, 0:00:00")
|
|
644
|
-
eq(str(td(-2)), "-2 days, 0:00:00")
|
|
645
|
-
|
|
646
|
-
eq(str(td(hours=12, minutes=58, seconds=59)), "12:58:59")
|
|
647
|
-
eq(str(td(hours=2, minutes=3, seconds=4)), "2:03:04")
|
|
648
|
-
eq(str(td(weeks=-30, hours=23, minutes=12, seconds=34)),
|
|
649
|
-
"-210 days, 23:12:34")
|
|
650
|
-
|
|
651
|
-
eq(str(td(milliseconds=1)), "0:00:00.001000")
|
|
652
|
-
eq(str(td(microseconds=3)), "0:00:00.000003")
|
|
653
|
-
|
|
654
|
-
eq(str(td(days=999999999, hours=23, minutes=59, seconds=59,
|
|
655
|
-
microseconds=999999)),
|
|
656
|
-
"999999999 days, 23:59:59.999999")
|
|
657
|
-
|
|
658
|
-
def test_repr(self):
|
|
659
|
-
name = 'datetime.' + self.theclass.__name__
|
|
660
|
-
self.assertEqual(repr(self.theclass(1)),
|
|
661
|
-
"%s(1)" % name)
|
|
662
|
-
self.assertEqual(repr(self.theclass(10, 2)),
|
|
663
|
-
"%s(10, 2)" % name)
|
|
664
|
-
self.assertEqual(repr(self.theclass(-10, 2, 400000)),
|
|
665
|
-
"%s(-10, 2, 400000)" % name)
|
|
666
|
-
|
|
667
|
-
def test_roundtrip(self):
|
|
668
|
-
for td in (timedelta(days=999999999, hours=23, minutes=59,
|
|
669
|
-
seconds=59, microseconds=999999),
|
|
670
|
-
timedelta(days=-999999999),
|
|
671
|
-
timedelta(days=-999999999, seconds=1),
|
|
672
|
-
timedelta(days=1, seconds=2, microseconds=3)):
|
|
673
|
-
|
|
674
|
-
# Verify td -> string -> td identity.
|
|
675
|
-
s = repr(td)
|
|
676
|
-
self.assertTrue(s.startswith('datetime.'))
|
|
677
|
-
s = s[9:]
|
|
678
|
-
td2 = eval(s)
|
|
679
|
-
self.assertEqual(td, td2)
|
|
680
|
-
|
|
681
|
-
# Verify identity via reconstructing from pieces.
|
|
682
|
-
td2 = timedelta(td.days, td.seconds, td.microseconds)
|
|
683
|
-
self.assertEqual(td, td2)
|
|
684
|
-
|
|
685
|
-
def test_resolution_info(self):
|
|
686
|
-
self.assertIsInstance(timedelta.min, timedelta)
|
|
687
|
-
self.assertIsInstance(timedelta.max, timedelta)
|
|
688
|
-
self.assertIsInstance(timedelta.resolution, timedelta)
|
|
689
|
-
self.assertTrue(timedelta.max > timedelta.min)
|
|
690
|
-
self.assertEqual(timedelta.min, timedelta(-999999999))
|
|
691
|
-
self.assertEqual(timedelta.max, timedelta(999999999, 24*3600-1, 1e6-1))
|
|
692
|
-
self.assertEqual(timedelta.resolution, timedelta(0, 0, 1))
|
|
693
|
-
|
|
694
|
-
def test_overflow(self):
|
|
695
|
-
tiny = timedelta.resolution
|
|
696
|
-
|
|
697
|
-
td = timedelta.min + tiny
|
|
698
|
-
td -= tiny # no problem
|
|
699
|
-
self.assertRaises(OverflowError, td.__sub__, tiny)
|
|
700
|
-
self.assertRaises(OverflowError, td.__add__, -tiny)
|
|
701
|
-
|
|
702
|
-
td = timedelta.max - tiny
|
|
703
|
-
td += tiny # no problem
|
|
704
|
-
self.assertRaises(OverflowError, td.__add__, tiny)
|
|
705
|
-
self.assertRaises(OverflowError, td.__sub__, -tiny)
|
|
706
|
-
|
|
707
|
-
self.assertRaises(OverflowError, lambda: -timedelta.max)
|
|
708
|
-
|
|
709
|
-
day = timedelta(1)
|
|
710
|
-
self.assertRaises(OverflowError, day.__mul__, 10**9)
|
|
711
|
-
self.assertRaises(OverflowError, day.__mul__, 1e9)
|
|
712
|
-
self.assertRaises(OverflowError, day.__truediv__, 1e-20)
|
|
713
|
-
self.assertRaises(OverflowError, day.__truediv__, 1e-10)
|
|
714
|
-
self.assertRaises(OverflowError, day.__truediv__, 9e-10)
|
|
715
|
-
|
|
716
|
-
@support.requires_IEEE_754
|
|
717
|
-
def _test_overflow_special(self):
|
|
718
|
-
day = timedelta(1)
|
|
719
|
-
self.assertRaises(OverflowError, day.__mul__, INF)
|
|
720
|
-
self.assertRaises(OverflowError, day.__mul__, -INF)
|
|
721
|
-
|
|
722
|
-
def test_microsecond_rounding(self):
|
|
723
|
-
td = timedelta
|
|
724
|
-
eq = self.assertEqual
|
|
725
|
-
|
|
726
|
-
# Single-field rounding.
|
|
727
|
-
eq(td(milliseconds=0.4/1000), td(0)) # rounds to 0
|
|
728
|
-
eq(td(milliseconds=-0.4/1000), td(0)) # rounds to 0
|
|
729
|
-
eq(td(milliseconds=0.5/1000), td(microseconds=0))
|
|
730
|
-
eq(td(milliseconds=-0.5/1000), td(microseconds=-0))
|
|
731
|
-
eq(td(milliseconds=0.6/1000), td(microseconds=1))
|
|
732
|
-
eq(td(milliseconds=-0.6/1000), td(microseconds=-1))
|
|
733
|
-
eq(td(milliseconds=1.5/1000), td(microseconds=2))
|
|
734
|
-
eq(td(milliseconds=-1.5/1000), td(microseconds=-2))
|
|
735
|
-
eq(td(seconds=0.5/10**6), td(microseconds=0))
|
|
736
|
-
eq(td(seconds=-0.5/10**6), td(microseconds=-0))
|
|
737
|
-
eq(td(seconds=1/2**7), td(microseconds=7812))
|
|
738
|
-
eq(td(seconds=-1/2**7), td(microseconds=-7812))
|
|
739
|
-
|
|
740
|
-
# Rounding due to contributions from more than one field.
|
|
741
|
-
us_per_hour = 3600e6
|
|
742
|
-
us_per_day = us_per_hour * 24
|
|
743
|
-
eq(td(days=.4/us_per_day), td(0))
|
|
744
|
-
eq(td(hours=.2/us_per_hour), td(0))
|
|
745
|
-
eq(td(days=.4/us_per_day, hours=.2/us_per_hour), td(microseconds=1))
|
|
746
|
-
|
|
747
|
-
eq(td(days=-.4/us_per_day), td(0))
|
|
748
|
-
eq(td(hours=-.2/us_per_hour), td(0))
|
|
749
|
-
eq(td(days=-.4/us_per_day, hours=-.2/us_per_hour), td(microseconds=-1))
|
|
750
|
-
|
|
751
|
-
# Test for a patch in Issue 8860
|
|
752
|
-
eq(td(microseconds=0.5), 0.5*td(microseconds=1.0))
|
|
753
|
-
eq(td(microseconds=0.5)//td.resolution, 0.5*td.resolution//td.resolution)
|
|
754
|
-
|
|
755
|
-
def test_massive_normalization(self):
|
|
756
|
-
td = timedelta(microseconds=-1)
|
|
757
|
-
self.assertEqual((td.days, td.seconds, td.microseconds),
|
|
758
|
-
(-1, 24*3600-1, 999999))
|
|
759
|
-
|
|
760
|
-
def test_bool(self):
|
|
761
|
-
self.assertTrue(timedelta(1))
|
|
762
|
-
self.assertTrue(timedelta(0, 1))
|
|
763
|
-
self.assertTrue(timedelta(0, 0, 1))
|
|
764
|
-
self.assertTrue(timedelta(microseconds=1))
|
|
765
|
-
self.assertFalse(timedelta(0))
|
|
766
|
-
|
|
767
|
-
def test_subclass_timedelta(self):
|
|
768
|
-
|
|
769
|
-
class T(timedelta):
|
|
770
|
-
@staticmethod
|
|
771
|
-
def from_td(td):
|
|
772
|
-
return T(td.days, td.seconds, td.microseconds)
|
|
773
|
-
|
|
774
|
-
def as_hours(self):
|
|
775
|
-
sum = (self.days * 24 +
|
|
776
|
-
self.seconds / 3600.0 +
|
|
777
|
-
self.microseconds / 3600e6)
|
|
778
|
-
return round(sum)
|
|
779
|
-
|
|
780
|
-
t1 = T(days=1)
|
|
781
|
-
self.assertIs(type(t1), T)
|
|
782
|
-
self.assertEqual(t1.as_hours(), 24)
|
|
783
|
-
|
|
784
|
-
t2 = T(days=-1, seconds=-3600)
|
|
785
|
-
self.assertIs(type(t2), T)
|
|
786
|
-
self.assertEqual(t2.as_hours(), -25)
|
|
787
|
-
|
|
788
|
-
t3 = t1 + t2
|
|
789
|
-
self.assertIs(type(t3), timedelta)
|
|
790
|
-
t4 = T.from_td(t3)
|
|
791
|
-
self.assertIs(type(t4), T)
|
|
792
|
-
self.assertEqual(t3.days, t4.days)
|
|
793
|
-
self.assertEqual(t3.seconds, t4.seconds)
|
|
794
|
-
self.assertEqual(t3.microseconds, t4.microseconds)
|
|
795
|
-
self.assertEqual(str(t3), str(t4))
|
|
796
|
-
self.assertEqual(t4.as_hours(), -1)
|
|
797
|
-
|
|
798
|
-
def test_division(self):
|
|
799
|
-
t = timedelta(hours=1, minutes=24, seconds=19)
|
|
800
|
-
second = timedelta(seconds=1)
|
|
801
|
-
self.assertEqual(t / second, 5059.0)
|
|
802
|
-
self.assertEqual(t // second, 5059)
|
|
803
|
-
|
|
804
|
-
t = timedelta(minutes=2, seconds=30)
|
|
805
|
-
minute = timedelta(minutes=1)
|
|
806
|
-
self.assertEqual(t / minute, 2.5)
|
|
807
|
-
self.assertEqual(t // minute, 2)
|
|
808
|
-
|
|
809
|
-
zerotd = timedelta(0)
|
|
810
|
-
self.assertRaises(ZeroDivisionError, truediv, t, zerotd)
|
|
811
|
-
self.assertRaises(ZeroDivisionError, floordiv, t, zerotd)
|
|
812
|
-
|
|
813
|
-
# self.assertRaises(TypeError, truediv, t, 2)
|
|
814
|
-
# note: floor division of a timedelta by an integer *is*
|
|
815
|
-
# currently permitted.
|
|
816
|
-
|
|
817
|
-
def test_remainder(self):
|
|
818
|
-
t = timedelta(minutes=2, seconds=30)
|
|
819
|
-
minute = timedelta(minutes=1)
|
|
820
|
-
r = t % minute
|
|
821
|
-
self.assertEqual(r, timedelta(seconds=30))
|
|
822
|
-
|
|
823
|
-
t = timedelta(minutes=-2, seconds=30)
|
|
824
|
-
r = t % minute
|
|
825
|
-
self.assertEqual(r, timedelta(seconds=30))
|
|
826
|
-
|
|
827
|
-
zerotd = timedelta(0)
|
|
828
|
-
self.assertRaises(ZeroDivisionError, mod, t, zerotd)
|
|
829
|
-
|
|
830
|
-
self.assertRaises(TypeError, mod, t, 10)
|
|
831
|
-
|
|
832
|
-
def test_divmod(self):
|
|
833
|
-
t = timedelta(minutes=2, seconds=30)
|
|
834
|
-
minute = timedelta(minutes=1)
|
|
835
|
-
q, r = divmod(t, minute)
|
|
836
|
-
self.assertEqual(q, 2)
|
|
837
|
-
self.assertEqual(r, timedelta(seconds=30))
|
|
838
|
-
|
|
839
|
-
t = timedelta(minutes=-2, seconds=30)
|
|
840
|
-
q, r = divmod(t, minute)
|
|
841
|
-
self.assertEqual(q, -2)
|
|
842
|
-
self.assertEqual(r, timedelta(seconds=30))
|
|
843
|
-
|
|
844
|
-
zerotd = timedelta(0)
|
|
845
|
-
self.assertRaises(ZeroDivisionError, divmod, t, zerotd)
|
|
846
|
-
|
|
847
|
-
self.assertRaises(TypeError, divmod, t, 10)
|
|
848
|
-
|
|
849
|
-
def test_issue31293(self):
|
|
850
|
-
# The interpreter shouldn't crash in case a timedelta is divided or
|
|
851
|
-
# multiplied by a float with a bad as_integer_ratio() method.
|
|
852
|
-
def get_bad_float(bad_ratio):
|
|
853
|
-
class BadFloat(float):
|
|
854
|
-
def as_integer_ratio(self):
|
|
855
|
-
return bad_ratio
|
|
856
|
-
return BadFloat()
|
|
857
|
-
|
|
858
|
-
with self.assertRaises(TypeError):
|
|
859
|
-
timedelta() / get_bad_float(1 << 1000)
|
|
860
|
-
with self.assertRaises(TypeError):
|
|
861
|
-
timedelta() * get_bad_float(1 << 1000)
|
|
862
|
-
|
|
863
|
-
for bad_ratio in [(), (42, ), (1, 2, 3)]:
|
|
864
|
-
with self.assertRaises(ValueError):
|
|
865
|
-
timedelta() / get_bad_float(bad_ratio)
|
|
866
|
-
with self.assertRaises(ValueError):
|
|
867
|
-
timedelta() * get_bad_float(bad_ratio)
|
|
868
|
-
|
|
869
|
-
def test_issue31752(self):
|
|
870
|
-
# The interpreter shouldn't crash because divmod() returns negative
|
|
871
|
-
# remainder.
|
|
872
|
-
class BadInt(int):
|
|
873
|
-
def __mul__(self, other):
|
|
874
|
-
return Prod()
|
|
875
|
-
|
|
876
|
-
class Prod:
|
|
877
|
-
def __radd__(self, other):
|
|
878
|
-
return Sum()
|
|
879
|
-
|
|
880
|
-
class Sum(int):
|
|
881
|
-
def __divmod__(self, other):
|
|
882
|
-
# negative remainder
|
|
883
|
-
return (0, -1)
|
|
884
|
-
|
|
885
|
-
timedelta(microseconds=BadInt(1))
|
|
886
|
-
timedelta(hours=BadInt(1))
|
|
887
|
-
timedelta(weeks=BadInt(1))
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
#############################################################################
|
|
891
|
-
# date tests
|
|
892
|
-
|
|
893
|
-
class TestDateOnly(unittest.TestCase):
|
|
894
|
-
# Tests here won't pass if also run on datetime objects, so don't
|
|
895
|
-
# subclass this to test datetimes too.
|
|
896
|
-
|
|
897
|
-
def test_delta_non_days_ignored(self):
|
|
898
|
-
dt = date(2000, 1, 2)
|
|
899
|
-
delta = timedelta(days=1, hours=2, minutes=3, seconds=4,
|
|
900
|
-
microseconds=5)
|
|
901
|
-
days = timedelta(delta.days)
|
|
902
|
-
self.assertEqual(days, timedelta(1))
|
|
903
|
-
|
|
904
|
-
dt2 = dt + delta
|
|
905
|
-
self.assertEqual(dt2, dt + days)
|
|
906
|
-
|
|
907
|
-
dt2 = delta + dt
|
|
908
|
-
self.assertEqual(dt2, dt + days)
|
|
909
|
-
|
|
910
|
-
dt2 = dt - delta
|
|
911
|
-
self.assertEqual(dt2, dt - days)
|
|
912
|
-
|
|
913
|
-
delta = -delta
|
|
914
|
-
days = timedelta(delta.days)
|
|
915
|
-
self.assertEqual(days, timedelta(-2))
|
|
916
|
-
|
|
917
|
-
dt2 = dt + delta
|
|
918
|
-
self.assertEqual(dt2, dt + days)
|
|
919
|
-
|
|
920
|
-
dt2 = delta + dt
|
|
921
|
-
self.assertEqual(dt2, dt + days)
|
|
922
|
-
|
|
923
|
-
dt2 = dt - delta
|
|
924
|
-
self.assertEqual(dt2, dt - days)
|
|
925
|
-
|
|
926
|
-
class SubclassDate(date):
|
|
927
|
-
sub_var = 1
|
|
928
|
-
|
|
929
|
-
class TestDate(HarmlessMixedComparison, unittest.TestCase):
|
|
930
|
-
# Tests here should pass for both dates and datetimes, except for a
|
|
931
|
-
# few tests that TestDateTime overrides.
|
|
932
|
-
|
|
933
|
-
theclass = date
|
|
934
|
-
|
|
935
|
-
def test_basic_attributes(self):
|
|
936
|
-
dt = self.theclass(2002, 3, 1)
|
|
937
|
-
self.assertEqual(dt.year, 2002)
|
|
938
|
-
self.assertEqual(dt.month, 3)
|
|
939
|
-
self.assertEqual(dt.day, 1)
|
|
940
|
-
|
|
941
|
-
def test_roundtrip(self):
|
|
942
|
-
for dt in (self.theclass(1, 2, 3),
|
|
943
|
-
self.theclass.today()):
|
|
944
|
-
# Verify dt -> string -> date identity.
|
|
945
|
-
s = repr(dt)
|
|
946
|
-
self.assertTrue(s.startswith('datetime.'))
|
|
947
|
-
s = s[9:]
|
|
948
|
-
dt2 = eval(s)
|
|
949
|
-
self.assertEqual(dt, dt2)
|
|
950
|
-
|
|
951
|
-
# Verify identity via reconstructing from pieces.
|
|
952
|
-
dt2 = self.theclass(dt.year, dt.month, dt.day)
|
|
953
|
-
self.assertEqual(dt, dt2)
|
|
954
|
-
|
|
955
|
-
def test_ordinal_conversions(self):
|
|
956
|
-
# Check some fixed values.
|
|
957
|
-
for y, m, d, n in [(1, 1, 1, 1), # calendar origin
|
|
958
|
-
(1, 12, 31, 365),
|
|
959
|
-
(2, 1, 1, 366),
|
|
960
|
-
# first example from "Calendrical Calculations"
|
|
961
|
-
(1945, 11, 12, 710347)]:
|
|
962
|
-
d = self.theclass(y, m, d)
|
|
963
|
-
self.assertEqual(n, d.toordinal())
|
|
964
|
-
fromord = self.theclass.fromordinal(n)
|
|
965
|
-
self.assertEqual(d, fromord)
|
|
966
|
-
if hasattr(fromord, "hour"):
|
|
967
|
-
# if we're checking something fancier than a date, verify
|
|
968
|
-
# the extra fields have been zeroed out
|
|
969
|
-
self.assertEqual(fromord.hour, 0)
|
|
970
|
-
self.assertEqual(fromord.minute, 0)
|
|
971
|
-
self.assertEqual(fromord.second, 0)
|
|
972
|
-
self.assertEqual(fromord.microsecond, 0)
|
|
973
|
-
|
|
974
|
-
# Check first and last days of year spottily across the whole
|
|
975
|
-
# range of years supported.
|
|
976
|
-
for year in range(MINYEAR, MAXYEAR+1, 7):
|
|
977
|
-
# Verify (year, 1, 1) -> ordinal -> y, m, d is identity.
|
|
978
|
-
d = self.theclass(year, 1, 1)
|
|
979
|
-
n = d.toordinal()
|
|
980
|
-
d2 = self.theclass.fromordinal(n)
|
|
981
|
-
self.assertEqual(d, d2)
|
|
982
|
-
# Verify that moving back a day gets to the end of year-1.
|
|
983
|
-
if year > 1:
|
|
984
|
-
d = self.theclass.fromordinal(n-1)
|
|
985
|
-
d2 = self.theclass(year-1, 12, 31)
|
|
986
|
-
self.assertEqual(d, d2)
|
|
987
|
-
self.assertEqual(d2.toordinal(), n-1)
|
|
988
|
-
|
|
989
|
-
# Test every day in a leap-year and a non-leap year.
|
|
990
|
-
dim = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
|
|
991
|
-
for year, isleap in (2000, True), (2002, False):
|
|
992
|
-
n = self.theclass(year, 1, 1).toordinal()
|
|
993
|
-
for month, maxday in zip(range(1, 13), dim):
|
|
994
|
-
if month == 2 and isleap:
|
|
995
|
-
maxday += 1
|
|
996
|
-
for day in range(1, maxday+1):
|
|
997
|
-
d = self.theclass(year, month, day)
|
|
998
|
-
self.assertEqual(d.toordinal(), n)
|
|
999
|
-
self.assertEqual(d, self.theclass.fromordinal(n))
|
|
1000
|
-
n += 1
|
|
1001
|
-
|
|
1002
|
-
def test_extreme_ordinals(self):
|
|
1003
|
-
a = self.theclass.min
|
|
1004
|
-
a = self.theclass(a.year, a.month, a.day) # get rid of time parts
|
|
1005
|
-
aord = a.toordinal()
|
|
1006
|
-
b = a.fromordinal(aord)
|
|
1007
|
-
self.assertEqual(a, b)
|
|
1008
|
-
|
|
1009
|
-
self.assertRaises(ValueError, lambda: a.fromordinal(aord - 1))
|
|
1010
|
-
|
|
1011
|
-
b = a + timedelta(days=1)
|
|
1012
|
-
self.assertEqual(b.toordinal(), aord + 1)
|
|
1013
|
-
self.assertEqual(b, self.theclass.fromordinal(aord + 1))
|
|
1014
|
-
|
|
1015
|
-
a = self.theclass.max
|
|
1016
|
-
a = self.theclass(a.year, a.month, a.day) # get rid of time parts
|
|
1017
|
-
aord = a.toordinal()
|
|
1018
|
-
b = a.fromordinal(aord)
|
|
1019
|
-
self.assertEqual(a, b)
|
|
1020
|
-
|
|
1021
|
-
self.assertRaises(ValueError, lambda: a.fromordinal(aord + 1))
|
|
1022
|
-
|
|
1023
|
-
b = a - timedelta(days=1)
|
|
1024
|
-
self.assertEqual(b.toordinal(), aord - 1)
|
|
1025
|
-
self.assertEqual(b, self.theclass.fromordinal(aord - 1))
|
|
1026
|
-
|
|
1027
|
-
def test_bad_constructor_arguments(self):
|
|
1028
|
-
# bad years
|
|
1029
|
-
self.theclass(MINYEAR, 1, 1) # no exception
|
|
1030
|
-
self.theclass(MAXYEAR, 1, 1) # no exception
|
|
1031
|
-
self.assertRaises(ValueError, self.theclass, MINYEAR-1, 1, 1)
|
|
1032
|
-
self.assertRaises(ValueError, self.theclass, MAXYEAR+1, 1, 1)
|
|
1033
|
-
# bad months
|
|
1034
|
-
self.theclass(2000, 1, 1) # no exception
|
|
1035
|
-
self.theclass(2000, 12, 1) # no exception
|
|
1036
|
-
self.assertRaises(ValueError, self.theclass, 2000, 0, 1)
|
|
1037
|
-
self.assertRaises(ValueError, self.theclass, 2000, 13, 1)
|
|
1038
|
-
# bad days
|
|
1039
|
-
self.theclass(2000, 2, 29) # no exception
|
|
1040
|
-
self.theclass(2004, 2, 29) # no exception
|
|
1041
|
-
self.theclass(2400, 2, 29) # no exception
|
|
1042
|
-
self.assertRaises(ValueError, self.theclass, 2000, 2, 30)
|
|
1043
|
-
self.assertRaises(ValueError, self.theclass, 2001, 2, 29)
|
|
1044
|
-
self.assertRaises(ValueError, self.theclass, 2100, 2, 29)
|
|
1045
|
-
self.assertRaises(ValueError, self.theclass, 1900, 2, 29)
|
|
1046
|
-
self.assertRaises(ValueError, self.theclass, 2000, 1, 0)
|
|
1047
|
-
self.assertRaises(ValueError, self.theclass, 2000, 1, 32)
|
|
1048
|
-
|
|
1049
|
-
def test_hash_equality(self):
|
|
1050
|
-
d = self.theclass(2000, 12, 31)
|
|
1051
|
-
# same thing
|
|
1052
|
-
e = self.theclass(2000, 12, 31)
|
|
1053
|
-
self.assertEqual(d, e)
|
|
1054
|
-
self.assertEqual(hash(d), hash(e))
|
|
1055
|
-
|
|
1056
|
-
dic = {d: 1}
|
|
1057
|
-
dic[e] = 2
|
|
1058
|
-
self.assertEqual(len(dic), 1)
|
|
1059
|
-
self.assertEqual(dic[d], 2)
|
|
1060
|
-
self.assertEqual(dic[e], 2)
|
|
1061
|
-
|
|
1062
|
-
d = self.theclass(2001, 1, 1)
|
|
1063
|
-
# same thing
|
|
1064
|
-
e = self.theclass(2001, 1, 1)
|
|
1065
|
-
self.assertEqual(d, e)
|
|
1066
|
-
self.assertEqual(hash(d), hash(e))
|
|
1067
|
-
|
|
1068
|
-
dic = {d: 1}
|
|
1069
|
-
dic[e] = 2
|
|
1070
|
-
self.assertEqual(len(dic), 1)
|
|
1071
|
-
self.assertEqual(dic[d], 2)
|
|
1072
|
-
self.assertEqual(dic[e], 2)
|
|
1073
|
-
|
|
1074
|
-
def test_computations(self):
|
|
1075
|
-
a = self.theclass(2002, 1, 31)
|
|
1076
|
-
b = self.theclass(1956, 1, 31)
|
|
1077
|
-
c = self.theclass(2001,2,1)
|
|
1078
|
-
|
|
1079
|
-
diff = a-b
|
|
1080
|
-
self.assertEqual(diff.days, 46*365 + len(range(1956, 2002, 4)))
|
|
1081
|
-
self.assertEqual(diff.seconds, 0)
|
|
1082
|
-
self.assertEqual(diff.microseconds, 0)
|
|
1083
|
-
|
|
1084
|
-
day = timedelta(1)
|
|
1085
|
-
week = timedelta(7)
|
|
1086
|
-
a = self.theclass(2002, 3, 2)
|
|
1087
|
-
self.assertEqual(a + day, self.theclass(2002, 3, 3))
|
|
1088
|
-
self.assertEqual(day + a, self.theclass(2002, 3, 3))
|
|
1089
|
-
self.assertEqual(a - day, self.theclass(2002, 3, 1))
|
|
1090
|
-
self.assertEqual(-day + a, self.theclass(2002, 3, 1))
|
|
1091
|
-
self.assertEqual(a + week, self.theclass(2002, 3, 9))
|
|
1092
|
-
self.assertEqual(a - week, self.theclass(2002, 2, 23))
|
|
1093
|
-
self.assertEqual(a + 52*week, self.theclass(2003, 3, 1))
|
|
1094
|
-
self.assertEqual(a - 52*week, self.theclass(2001, 3, 3))
|
|
1095
|
-
self.assertEqual((a + week) - a, week)
|
|
1096
|
-
self.assertEqual((a + day) - a, day)
|
|
1097
|
-
self.assertEqual((a - week) - a, -week)
|
|
1098
|
-
self.assertEqual((a - day) - a, -day)
|
|
1099
|
-
self.assertEqual(a - (a + week), -week)
|
|
1100
|
-
self.assertEqual(a - (a + day), -day)
|
|
1101
|
-
self.assertEqual(a - (a - week), week)
|
|
1102
|
-
self.assertEqual(a - (a - day), day)
|
|
1103
|
-
self.assertEqual(c - (c - day), day)
|
|
1104
|
-
|
|
1105
|
-
# Add/sub ints or floats should be illegal
|
|
1106
|
-
for i in 1, 1.0:
|
|
1107
|
-
self.assertRaises(TypeError, lambda: a+i)
|
|
1108
|
-
self.assertRaises(TypeError, lambda: a-i)
|
|
1109
|
-
self.assertRaises(TypeError, lambda: i+a)
|
|
1110
|
-
self.assertRaises(TypeError, lambda: i-a)
|
|
1111
|
-
|
|
1112
|
-
# delta - date is senseless.
|
|
1113
|
-
self.assertRaises(TypeError, lambda: day - a)
|
|
1114
|
-
# mixing date and (delta or date) via * or // is senseless
|
|
1115
|
-
self.assertRaises(TypeError, lambda: day * a)
|
|
1116
|
-
self.assertRaises(TypeError, lambda: a * day)
|
|
1117
|
-
self.assertRaises(TypeError, lambda: day // a)
|
|
1118
|
-
self.assertRaises(TypeError, lambda: a // day)
|
|
1119
|
-
self.assertRaises(TypeError, lambda: a * a)
|
|
1120
|
-
self.assertRaises(TypeError, lambda: a // a)
|
|
1121
|
-
# date + date is senseless
|
|
1122
|
-
self.assertRaises(TypeError, lambda: a + a)
|
|
1123
|
-
|
|
1124
|
-
def test_overflow(self):
|
|
1125
|
-
tiny = self.theclass.resolution
|
|
1126
|
-
|
|
1127
|
-
for delta in [tiny, timedelta(1), timedelta(2)]:
|
|
1128
|
-
dt = self.theclass.min + delta
|
|
1129
|
-
dt -= delta # no problem
|
|
1130
|
-
self.assertRaises(OverflowError, dt.__sub__, delta)
|
|
1131
|
-
self.assertRaises(OverflowError, dt.__add__, -delta)
|
|
1132
|
-
|
|
1133
|
-
dt = self.theclass.max - delta
|
|
1134
|
-
dt += delta # no problem
|
|
1135
|
-
self.assertRaises(OverflowError, dt.__add__, delta)
|
|
1136
|
-
self.assertRaises(OverflowError, dt.__sub__, -delta)
|
|
1137
|
-
|
|
1138
|
-
def test_fromtimestamp(self):
|
|
1139
|
-
import time
|
|
1140
|
-
|
|
1141
|
-
# Try an arbitrary fixed value.
|
|
1142
|
-
year, month, day = 1999, 9, 19
|
|
1143
|
-
ts = time.mktime((year, month, day, 0, 0, 0, 0, 0, -1))
|
|
1144
|
-
d = self.theclass.fromtimestamp(ts)
|
|
1145
|
-
self.assertEqual(d.year, year)
|
|
1146
|
-
self.assertEqual(d.month, month)
|
|
1147
|
-
self.assertEqual(d.day, day)
|
|
1148
|
-
|
|
1149
|
-
def test_insane_fromtimestamp(self):
|
|
1150
|
-
# It's possible that some platform maps time_t to double,
|
|
1151
|
-
# and that this test will fail there. This test should
|
|
1152
|
-
# exempt such platforms (provided they return reasonable
|
|
1153
|
-
# results!).
|
|
1154
|
-
for insane in -1e200, 1e200:
|
|
1155
|
-
self.assertRaises(OverflowError, self.theclass.fromtimestamp,
|
|
1156
|
-
insane)
|
|
1157
|
-
|
|
1158
|
-
def test_today(self):
|
|
1159
|
-
import time
|
|
1160
|
-
|
|
1161
|
-
# We claim that today() is like fromtimestamp(time.time()), so
|
|
1162
|
-
# prove it.
|
|
1163
|
-
for dummy in range(3):
|
|
1164
|
-
today = self.theclass.today()
|
|
1165
|
-
ts = time.time()
|
|
1166
|
-
todayagain = self.theclass.fromtimestamp(ts)
|
|
1167
|
-
if today == todayagain:
|
|
1168
|
-
break
|
|
1169
|
-
# There are several legit reasons that could fail:
|
|
1170
|
-
# 1. It recently became midnight, between the today() and the
|
|
1171
|
-
# time() calls.
|
|
1172
|
-
# 2. The platform time() has such fine resolution that we'll
|
|
1173
|
-
# never get the same value twice.
|
|
1174
|
-
# 3. The platform time() has poor resolution, and we just
|
|
1175
|
-
# happened to call today() right before a resolution quantum
|
|
1176
|
-
# boundary.
|
|
1177
|
-
# 4. The system clock got fiddled between calls.
|
|
1178
|
-
# In any case, wait a little while and try again.
|
|
1179
|
-
time.sleep(0.1)
|
|
1180
|
-
|
|
1181
|
-
# It worked or it didn't. If it didn't, assume it's reason #2, and
|
|
1182
|
-
# let the test pass if they're within half a second of each other.
|
|
1183
|
-
if today != todayagain:
|
|
1184
|
-
self.assertAlmostEqual(todayagain, today,
|
|
1185
|
-
delta=timedelta(seconds=0.5))
|
|
1186
|
-
|
|
1187
|
-
def test_weekday(self):
|
|
1188
|
-
for i in range(7):
|
|
1189
|
-
# March 4, 2002 is a Monday
|
|
1190
|
-
self.assertEqual(self.theclass(2002, 3, 4+i).weekday(), i)
|
|
1191
|
-
self.assertEqual(self.theclass(2002, 3, 4+i).isoweekday(), i+1)
|
|
1192
|
-
# January 2, 1956 is a Monday
|
|
1193
|
-
self.assertEqual(self.theclass(1956, 1, 2+i).weekday(), i)
|
|
1194
|
-
self.assertEqual(self.theclass(1956, 1, 2+i).isoweekday(), i+1)
|
|
1195
|
-
|
|
1196
|
-
def test_isocalendar(self):
|
|
1197
|
-
# Check examples from
|
|
1198
|
-
# http://www.phys.uu.nl/~vgent/calendar/isocalendar.htm
|
|
1199
|
-
for i in range(7):
|
|
1200
|
-
d = self.theclass(2003, 12, 22+i)
|
|
1201
|
-
self.assertEqual(d.isocalendar(), (2003, 52, i+1))
|
|
1202
|
-
d = self.theclass(2003, 12, 29) + timedelta(i)
|
|
1203
|
-
self.assertEqual(d.isocalendar(), (2004, 1, i+1))
|
|
1204
|
-
d = self.theclass(2004, 1, 5+i)
|
|
1205
|
-
self.assertEqual(d.isocalendar(), (2004, 2, i+1))
|
|
1206
|
-
d = self.theclass(2009, 12, 21+i)
|
|
1207
|
-
self.assertEqual(d.isocalendar(), (2009, 52, i+1))
|
|
1208
|
-
d = self.theclass(2009, 12, 28) + timedelta(i)
|
|
1209
|
-
self.assertEqual(d.isocalendar(), (2009, 53, i+1))
|
|
1210
|
-
d = self.theclass(2010, 1, 4+i)
|
|
1211
|
-
self.assertEqual(d.isocalendar(), (2010, 1, i+1))
|
|
1212
|
-
|
|
1213
|
-
def test_iso_long_years(self):
|
|
1214
|
-
# Calculate long ISO years and compare to table from
|
|
1215
|
-
# http://www.phys.uu.nl/~vgent/calendar/isocalendar.htm
|
|
1216
|
-
ISO_LONG_YEARS_TABLE = """
|
|
1217
|
-
4 32 60 88
|
|
1218
|
-
9 37 65 93
|
|
1219
|
-
15 43 71 99
|
|
1220
|
-
20 48 76
|
|
1221
|
-
26 54 82
|
|
1222
|
-
|
|
1223
|
-
105 133 161 189
|
|
1224
|
-
111 139 167 195
|
|
1225
|
-
116 144 172
|
|
1226
|
-
122 150 178
|
|
1227
|
-
128 156 184
|
|
1228
|
-
|
|
1229
|
-
201 229 257 285
|
|
1230
|
-
207 235 263 291
|
|
1231
|
-
212 240 268 296
|
|
1232
|
-
218 246 274
|
|
1233
|
-
224 252 280
|
|
1234
|
-
|
|
1235
|
-
303 331 359 387
|
|
1236
|
-
308 336 364 392
|
|
1237
|
-
314 342 370 398
|
|
1238
|
-
320 348 376
|
|
1239
|
-
325 353 381
|
|
1240
|
-
"""
|
|
1241
|
-
iso_long_years = sorted(map(int, ISO_LONG_YEARS_TABLE.split()))
|
|
1242
|
-
L = []
|
|
1243
|
-
for i in range(400):
|
|
1244
|
-
d = self.theclass(2000+i, 12, 31)
|
|
1245
|
-
d1 = self.theclass(1600+i, 12, 31)
|
|
1246
|
-
self.assertEqual(d.isocalendar()[1:], d1.isocalendar()[1:])
|
|
1247
|
-
if d.isocalendar()[1] == 53:
|
|
1248
|
-
L.append(i)
|
|
1249
|
-
self.assertEqual(L, iso_long_years)
|
|
1250
|
-
|
|
1251
|
-
def test_isoformat(self):
|
|
1252
|
-
t = self.theclass(2, 3, 2)
|
|
1253
|
-
self.assertEqual(t.isoformat(), "0002-03-02")
|
|
1254
|
-
|
|
1255
|
-
def test_ctime(self):
|
|
1256
|
-
t = self.theclass(2002, 3, 2)
|
|
1257
|
-
self.assertEqual(t.ctime(), "Sat Mar 2 00:00:00 2002")
|
|
1258
|
-
|
|
1259
|
-
def test_strftime(self):
|
|
1260
|
-
t = self.theclass(2005, 3, 2)
|
|
1261
|
-
self.assertEqual(t.strftime("m:%m d:%d y:%y"), "m:03 d:02 y:05")
|
|
1262
|
-
self.assertEqual(t.strftime(""), "") # SF bug #761337
|
|
1263
|
-
self.assertEqual(t.strftime('x'*1000), 'x'*1000) # SF bug #1556784
|
|
1264
|
-
|
|
1265
|
-
self.assertRaises(TypeError, t.strftime) # needs an arg
|
|
1266
|
-
self.assertRaises(TypeError, t.strftime, "one", "two") # too many args
|
|
1267
|
-
self.assertRaises(TypeError, t.strftime, 42) # arg wrong type
|
|
1268
|
-
|
|
1269
|
-
# test that unicode input is allowed (issue 2782)
|
|
1270
|
-
self.assertEqual(t.strftime("%m"), "03")
|
|
1271
|
-
|
|
1272
|
-
# A naive object replaces %z and %Z w/ empty strings.
|
|
1273
|
-
self.assertEqual(t.strftime("'%z' '%Z'"), "'' ''")
|
|
1274
|
-
|
|
1275
|
-
#make sure that invalid format specifiers are handled correctly
|
|
1276
|
-
#self.assertRaises(ValueError, t.strftime, "%e")
|
|
1277
|
-
#self.assertRaises(ValueError, t.strftime, "%")
|
|
1278
|
-
#self.assertRaises(ValueError, t.strftime, "%#")
|
|
1279
|
-
|
|
1280
|
-
#oh well, some systems just ignore those invalid ones.
|
|
1281
|
-
#at least, exercise them to make sure that no crashes
|
|
1282
|
-
#are generated
|
|
1283
|
-
for f in ["%e", "%", "%#"]:
|
|
1284
|
-
try:
|
|
1285
|
-
t.strftime(f)
|
|
1286
|
-
except ValueError:
|
|
1287
|
-
pass
|
|
1288
|
-
|
|
1289
|
-
#check that this standard extension works
|
|
1290
|
-
t.strftime("%f")
|
|
1291
|
-
|
|
1292
|
-
def test_format(self):
|
|
1293
|
-
dt = self.theclass(2007, 9, 10)
|
|
1294
|
-
self.assertEqual(dt.__format__(''), str(dt))
|
|
1295
|
-
|
|
1296
|
-
with self.assertRaisesRegex(TypeError, 'must be str, not int'):
|
|
1297
|
-
dt.__format__(123)
|
|
1298
|
-
|
|
1299
|
-
# check that a derived class's __str__() gets called
|
|
1300
|
-
class A(self.theclass):
|
|
1301
|
-
def __str__(self):
|
|
1302
|
-
return 'A'
|
|
1303
|
-
a = A(2007, 9, 10)
|
|
1304
|
-
self.assertEqual(a.__format__(''), 'A')
|
|
1305
|
-
|
|
1306
|
-
# check that a derived class's strftime gets called
|
|
1307
|
-
class B(self.theclass):
|
|
1308
|
-
def strftime(self, format_spec):
|
|
1309
|
-
return 'B'
|
|
1310
|
-
b = B(2007, 9, 10)
|
|
1311
|
-
self.assertEqual(b.__format__(''), str(dt))
|
|
1312
|
-
|
|
1313
|
-
for fmt in ["m:%m d:%d y:%y",
|
|
1314
|
-
"m:%m d:%d y:%y H:%H M:%M S:%S",
|
|
1315
|
-
"%z %Z",
|
|
1316
|
-
]:
|
|
1317
|
-
self.assertEqual(dt.__format__(fmt), dt.strftime(fmt))
|
|
1318
|
-
self.assertEqual(a.__format__(fmt), dt.strftime(fmt))
|
|
1319
|
-
self.assertEqual(b.__format__(fmt), 'B')
|
|
1320
|
-
|
|
1321
|
-
def test_resolution_info(self):
|
|
1322
|
-
# XXX: Should min and max respect subclassing?
|
|
1323
|
-
if issubclass(self.theclass, datetime):
|
|
1324
|
-
expected_class = datetime
|
|
1325
|
-
else:
|
|
1326
|
-
expected_class = date
|
|
1327
|
-
self.assertIsInstance(self.theclass.min, expected_class)
|
|
1328
|
-
self.assertIsInstance(self.theclass.max, expected_class)
|
|
1329
|
-
self.assertIsInstance(self.theclass.resolution, timedelta)
|
|
1330
|
-
self.assertTrue(self.theclass.max > self.theclass.min)
|
|
1331
|
-
|
|
1332
|
-
def test_extreme_timedelta(self):
|
|
1333
|
-
big = self.theclass.max - self.theclass.min
|
|
1334
|
-
# 3652058 days, 23 hours, 59 minutes, 59 seconds, 999999 microseconds
|
|
1335
|
-
n = (big.days*24*3600 + big.seconds)*1000000 + big.microseconds
|
|
1336
|
-
# n == 315537897599999999 ~= 2**58.13
|
|
1337
|
-
justasbig = timedelta(0, 0, n)
|
|
1338
|
-
self.assertEqual(big, justasbig)
|
|
1339
|
-
self.assertEqual(self.theclass.min + big, self.theclass.max)
|
|
1340
|
-
self.assertEqual(self.theclass.max - big, self.theclass.min)
|
|
1341
|
-
|
|
1342
|
-
def test_timetuple(self):
|
|
1343
|
-
for i in range(7):
|
|
1344
|
-
# January 2, 1956 is a Monday (0)
|
|
1345
|
-
d = self.theclass(1956, 1, 2+i)
|
|
1346
|
-
t = d.timetuple()
|
|
1347
|
-
self.assertEqual(t, (1956, 1, 2+i, 0, 0, 0, i, 2+i, -1))
|
|
1348
|
-
# February 1, 1956 is a Wednesday (2)
|
|
1349
|
-
d = self.theclass(1956, 2, 1+i)
|
|
1350
|
-
t = d.timetuple()
|
|
1351
|
-
self.assertEqual(t, (1956, 2, 1+i, 0, 0, 0, (2+i)%7, 32+i, -1))
|
|
1352
|
-
# March 1, 1956 is a Thursday (3), and is the 31+29+1 = 61st day
|
|
1353
|
-
# of the year.
|
|
1354
|
-
d = self.theclass(1956, 3, 1+i)
|
|
1355
|
-
t = d.timetuple()
|
|
1356
|
-
self.assertEqual(t, (1956, 3, 1+i, 0, 0, 0, (3+i)%7, 61+i, -1))
|
|
1357
|
-
self.assertEqual(t.tm_year, 1956)
|
|
1358
|
-
self.assertEqual(t.tm_mon, 3)
|
|
1359
|
-
self.assertEqual(t.tm_mday, 1+i)
|
|
1360
|
-
self.assertEqual(t.tm_hour, 0)
|
|
1361
|
-
self.assertEqual(t.tm_min, 0)
|
|
1362
|
-
self.assertEqual(t.tm_sec, 0)
|
|
1363
|
-
self.assertEqual(t.tm_wday, (3+i)%7)
|
|
1364
|
-
self.assertEqual(t.tm_yday, 61+i)
|
|
1365
|
-
self.assertEqual(t.tm_isdst, -1)
|
|
1366
|
-
|
|
1367
|
-
def test_pickling(self):
|
|
1368
|
-
args = 6, 7, 23
|
|
1369
|
-
orig = self.theclass(*args)
|
|
1370
|
-
for pickler, unpickler, proto in pickle_choices:
|
|
1371
|
-
green = pickler.dumps(orig, proto)
|
|
1372
|
-
derived = unpickler.loads(green)
|
|
1373
|
-
self.assertEqual(orig, derived)
|
|
1374
|
-
self.assertEqual(orig.__reduce__(), orig.__reduce_ex__(2))
|
|
1375
|
-
|
|
1376
|
-
def test_compare(self):
|
|
1377
|
-
t1 = self.theclass(2, 3, 4)
|
|
1378
|
-
t2 = self.theclass(2, 3, 4)
|
|
1379
|
-
self.assertEqual(t1, t2)
|
|
1380
|
-
self.assertTrue(t1 <= t2)
|
|
1381
|
-
self.assertTrue(t1 >= t2)
|
|
1382
|
-
self.assertFalse(t1 != t2)
|
|
1383
|
-
self.assertFalse(t1 < t2)
|
|
1384
|
-
self.assertFalse(t1 > t2)
|
|
1385
|
-
|
|
1386
|
-
for args in (3, 3, 3), (2, 4, 4), (2, 3, 5):
|
|
1387
|
-
t2 = self.theclass(*args) # this is larger than t1
|
|
1388
|
-
self.assertTrue(t1 < t2)
|
|
1389
|
-
self.assertTrue(t2 > t1)
|
|
1390
|
-
self.assertTrue(t1 <= t2)
|
|
1391
|
-
self.assertTrue(t2 >= t1)
|
|
1392
|
-
self.assertTrue(t1 != t2)
|
|
1393
|
-
self.assertTrue(t2 != t1)
|
|
1394
|
-
self.assertFalse(t1 == t2)
|
|
1395
|
-
self.assertFalse(t2 == t1)
|
|
1396
|
-
self.assertFalse(t1 > t2)
|
|
1397
|
-
self.assertFalse(t2 < t1)
|
|
1398
|
-
self.assertFalse(t1 >= t2)
|
|
1399
|
-
self.assertFalse(t2 <= t1)
|
|
1400
|
-
|
|
1401
|
-
for badarg in OTHERSTUFF:
|
|
1402
|
-
self.assertEqual(t1 == badarg, False)
|
|
1403
|
-
self.assertEqual(t1 != badarg, True)
|
|
1404
|
-
self.assertEqual(badarg == t1, False)
|
|
1405
|
-
self.assertEqual(badarg != t1, True)
|
|
1406
|
-
|
|
1407
|
-
self.assertRaises(TypeError, lambda: t1 < badarg)
|
|
1408
|
-
self.assertRaises(TypeError, lambda: t1 > badarg)
|
|
1409
|
-
self.assertRaises(TypeError, lambda: t1 >= badarg)
|
|
1410
|
-
self.assertRaises(TypeError, lambda: badarg <= t1)
|
|
1411
|
-
self.assertRaises(TypeError, lambda: badarg < t1)
|
|
1412
|
-
self.assertRaises(TypeError, lambda: badarg > t1)
|
|
1413
|
-
self.assertRaises(TypeError, lambda: badarg >= t1)
|
|
1414
|
-
|
|
1415
|
-
def test_mixed_compare(self):
|
|
1416
|
-
our = self.theclass(2000, 4, 5)
|
|
1417
|
-
|
|
1418
|
-
# Our class can be compared for equality to other classes
|
|
1419
|
-
self.assertEqual(our == 1, False)
|
|
1420
|
-
self.assertEqual(1 == our, False)
|
|
1421
|
-
self.assertEqual(our != 1, True)
|
|
1422
|
-
self.assertEqual(1 != our, True)
|
|
1423
|
-
|
|
1424
|
-
# But the ordering is undefined
|
|
1425
|
-
self.assertRaises(TypeError, lambda: our < 1)
|
|
1426
|
-
self.assertRaises(TypeError, lambda: 1 < our)
|
|
1427
|
-
|
|
1428
|
-
# Repeat those tests with a different class
|
|
1429
|
-
|
|
1430
|
-
class SomeClass:
|
|
1431
|
-
pass
|
|
1432
|
-
|
|
1433
|
-
their = SomeClass()
|
|
1434
|
-
self.assertEqual(our == their, False)
|
|
1435
|
-
self.assertEqual(their == our, False)
|
|
1436
|
-
self.assertEqual(our != their, True)
|
|
1437
|
-
self.assertEqual(their != our, True)
|
|
1438
|
-
self.assertRaises(TypeError, lambda: our < their)
|
|
1439
|
-
self.assertRaises(TypeError, lambda: their < our)
|
|
1440
|
-
|
|
1441
|
-
# However, if the other class explicitly defines ordering
|
|
1442
|
-
# relative to our class, it is allowed to do so
|
|
1443
|
-
|
|
1444
|
-
class LargerThanAnything:
|
|
1445
|
-
def __lt__(self, other):
|
|
1446
|
-
return False
|
|
1447
|
-
def __le__(self, other):
|
|
1448
|
-
return isinstance(other, LargerThanAnything)
|
|
1449
|
-
def __eq__(self, other):
|
|
1450
|
-
return isinstance(other, LargerThanAnything)
|
|
1451
|
-
def __gt__(self, other):
|
|
1452
|
-
return not isinstance(other, LargerThanAnything)
|
|
1453
|
-
def __ge__(self, other):
|
|
1454
|
-
return True
|
|
1455
|
-
|
|
1456
|
-
their = LargerThanAnything()
|
|
1457
|
-
self.assertEqual(our == their, False)
|
|
1458
|
-
self.assertEqual(their == our, False)
|
|
1459
|
-
self.assertEqual(our != their, True)
|
|
1460
|
-
self.assertEqual(their != our, True)
|
|
1461
|
-
self.assertEqual(our < their, True)
|
|
1462
|
-
self.assertEqual(their < our, False)
|
|
1463
|
-
|
|
1464
|
-
def test_bool(self):
|
|
1465
|
-
# All dates are considered true.
|
|
1466
|
-
self.assertTrue(self.theclass.min)
|
|
1467
|
-
self.assertTrue(self.theclass.max)
|
|
1468
|
-
|
|
1469
|
-
def test_strftime_y2k(self):
|
|
1470
|
-
for y in (1, 49, 70, 99, 100, 999, 1000, 1970):
|
|
1471
|
-
d = self.theclass(y, 1, 1)
|
|
1472
|
-
# Issue 13305: For years < 1000, the value is not always
|
|
1473
|
-
# padded to 4 digits across platforms. The C standard
|
|
1474
|
-
# assumes year >= 1900, so it does not specify the number
|
|
1475
|
-
# of digits.
|
|
1476
|
-
if d.strftime("%Y") != '%04d' % y:
|
|
1477
|
-
# Year 42 returns '42', not padded
|
|
1478
|
-
self.assertEqual(d.strftime("%Y"), '%d' % y)
|
|
1479
|
-
# '0042' is obtained anyway
|
|
1480
|
-
self.assertEqual(d.strftime("%4Y"), '%04d' % y)
|
|
1481
|
-
|
|
1482
|
-
def test_replace(self):
|
|
1483
|
-
cls = self.theclass
|
|
1484
|
-
args = [1, 2, 3]
|
|
1485
|
-
base = cls(*args)
|
|
1486
|
-
self.assertEqual(base, base.replace())
|
|
1487
|
-
|
|
1488
|
-
i = 0
|
|
1489
|
-
for name, newval in (("year", 2),
|
|
1490
|
-
("month", 3),
|
|
1491
|
-
("day", 4)):
|
|
1492
|
-
newargs = args[:]
|
|
1493
|
-
newargs[i] = newval
|
|
1494
|
-
expected = cls(*newargs)
|
|
1495
|
-
got = base.replace(**{name: newval})
|
|
1496
|
-
self.assertEqual(expected, got)
|
|
1497
|
-
i += 1
|
|
1498
|
-
|
|
1499
|
-
# Out of bounds.
|
|
1500
|
-
base = cls(2000, 2, 29)
|
|
1501
|
-
self.assertRaises(ValueError, base.replace, year=2001)
|
|
1502
|
-
|
|
1503
|
-
def test_subclass_replace(self):
|
|
1504
|
-
class DateSubclass(self.theclass):
|
|
1505
|
-
pass
|
|
1506
|
-
|
|
1507
|
-
dt = DateSubclass(2012, 1, 1)
|
|
1508
|
-
self.assertIs(type(dt.replace(year=2013)), DateSubclass)
|
|
1509
|
-
|
|
1510
|
-
def test_subclass_date(self):
|
|
1511
|
-
|
|
1512
|
-
class C(self.theclass):
|
|
1513
|
-
theAnswer = 42
|
|
1514
|
-
|
|
1515
|
-
def __new__(cls, *args, **kws):
|
|
1516
|
-
temp = kws.copy()
|
|
1517
|
-
extra = temp.pop('extra')
|
|
1518
|
-
result = self.theclass.__new__(cls, *args, **temp)
|
|
1519
|
-
result.extra = extra
|
|
1520
|
-
return result
|
|
1521
|
-
|
|
1522
|
-
def newmeth(self, start):
|
|
1523
|
-
return start + self.year + self.month
|
|
1524
|
-
|
|
1525
|
-
args = 2003, 4, 14
|
|
1526
|
-
|
|
1527
|
-
dt1 = self.theclass(*args)
|
|
1528
|
-
dt2 = C(*args, **{'extra': 7})
|
|
1529
|
-
|
|
1530
|
-
self.assertEqual(dt2.__class__, C)
|
|
1531
|
-
self.assertEqual(dt2.theAnswer, 42)
|
|
1532
|
-
self.assertEqual(dt2.extra, 7)
|
|
1533
|
-
self.assertEqual(dt1.toordinal(), dt2.toordinal())
|
|
1534
|
-
self.assertEqual(dt2.newmeth(-7), dt1.year + dt1.month - 7)
|
|
1535
|
-
|
|
1536
|
-
def test_pickling_subclass_date(self):
|
|
1537
|
-
|
|
1538
|
-
args = 6, 7, 23
|
|
1539
|
-
orig = SubclassDate(*args)
|
|
1540
|
-
for pickler, unpickler, proto in pickle_choices:
|
|
1541
|
-
green = pickler.dumps(orig, proto)
|
|
1542
|
-
derived = unpickler.loads(green)
|
|
1543
|
-
self.assertEqual(orig, derived)
|
|
1544
|
-
|
|
1545
|
-
def test_backdoor_resistance(self):
|
|
1546
|
-
# For fast unpickling, the constructor accepts a pickle byte string.
|
|
1547
|
-
# This is a low-overhead backdoor. A user can (by intent or
|
|
1548
|
-
# mistake) pass a string directly, which (if it's the right length)
|
|
1549
|
-
# will get treated like a pickle, and bypass the normal sanity
|
|
1550
|
-
# checks in the constructor. This can create insane objects.
|
|
1551
|
-
# The constructor doesn't want to burn the time to validate all
|
|
1552
|
-
# fields, but does check the month field. This stops, e.g.,
|
|
1553
|
-
# datetime.datetime('1995-03-25') from yielding an insane object.
|
|
1554
|
-
base = b'1995-03-25'
|
|
1555
|
-
if not issubclass(self.theclass, datetime):
|
|
1556
|
-
base = base[:4]
|
|
1557
|
-
for month_byte in b'9', b'\0', b'\r', b'\xff':
|
|
1558
|
-
self.assertRaises(TypeError, self.theclass,
|
|
1559
|
-
base[:2] + month_byte + base[3:])
|
|
1560
|
-
if issubclass(self.theclass, datetime):
|
|
1561
|
-
# Good bytes, but bad tzinfo:
|
|
1562
|
-
with self.assertRaisesRegex(TypeError, '^bad tzinfo state arg$'):
|
|
1563
|
-
self.theclass(bytes([1] * len(base)), 'EST')
|
|
1564
|
-
|
|
1565
|
-
for ord_byte in range(1, 13):
|
|
1566
|
-
# This shouldn't blow up because of the month byte alone. If
|
|
1567
|
-
# the implementation changes to do more-careful checking, it may
|
|
1568
|
-
# blow up because other fields are insane.
|
|
1569
|
-
self.theclass(base[:2] + bytes([ord_byte]) + base[3:])
|
|
1570
|
-
|
|
1571
|
-
#############################################################################
|
|
1572
|
-
# datetime tests
|
|
1573
|
-
|
|
1574
|
-
class SubclassDatetime(datetime):
|
|
1575
|
-
sub_var = 1
|
|
1576
|
-
|
|
1577
|
-
class TestDateTime(TestDate):
|
|
1578
|
-
|
|
1579
|
-
theclass = datetime
|
|
1580
|
-
|
|
1581
|
-
def test_basic_attributes(self):
|
|
1582
|
-
dt = self.theclass(2002, 3, 1, 12, 0)
|
|
1583
|
-
self.assertEqual(dt.year, 2002)
|
|
1584
|
-
self.assertEqual(dt.month, 3)
|
|
1585
|
-
self.assertEqual(dt.day, 1)
|
|
1586
|
-
self.assertEqual(dt.hour, 12)
|
|
1587
|
-
self.assertEqual(dt.minute, 0)
|
|
1588
|
-
self.assertEqual(dt.second, 0)
|
|
1589
|
-
self.assertEqual(dt.microsecond, 0)
|
|
1590
|
-
|
|
1591
|
-
def test_basic_attributes_nonzero(self):
|
|
1592
|
-
# Make sure all attributes are non-zero so bugs in
|
|
1593
|
-
# bit-shifting access show up.
|
|
1594
|
-
dt = self.theclass(2002, 3, 1, 12, 59, 59, 8000)
|
|
1595
|
-
self.assertEqual(dt.year, 2002)
|
|
1596
|
-
self.assertEqual(dt.month, 3)
|
|
1597
|
-
self.assertEqual(dt.day, 1)
|
|
1598
|
-
self.assertEqual(dt.hour, 12)
|
|
1599
|
-
self.assertEqual(dt.minute, 59)
|
|
1600
|
-
self.assertEqual(dt.second, 59)
|
|
1601
|
-
self.assertEqual(dt.microsecond, 8000)
|
|
1602
|
-
|
|
1603
|
-
def test_roundtrip(self):
|
|
1604
|
-
for dt in (self.theclass(1, 2, 3, 4, 5, 6, 7),
|
|
1605
|
-
self.theclass.now()):
|
|
1606
|
-
# Verify dt -> string -> datetime identity.
|
|
1607
|
-
s = repr(dt)
|
|
1608
|
-
self.assertTrue(s.startswith('datetime.'))
|
|
1609
|
-
s = s[9:]
|
|
1610
|
-
dt2 = eval(s)
|
|
1611
|
-
self.assertEqual(dt, dt2)
|
|
1612
|
-
|
|
1613
|
-
# Verify identity via reconstructing from pieces.
|
|
1614
|
-
dt2 = self.theclass(dt.year, dt.month, dt.day,
|
|
1615
|
-
dt.hour, dt.minute, dt.second,
|
|
1616
|
-
dt.microsecond)
|
|
1617
|
-
self.assertEqual(dt, dt2)
|
|
1618
|
-
|
|
1619
|
-
def test_isoformat(self):
|
|
1620
|
-
t = self.theclass(1, 2, 3, 4, 5, 1, 123)
|
|
1621
|
-
self.assertEqual(t.isoformat(), "0001-02-03T04:05:01.000123")
|
|
1622
|
-
self.assertEqual(t.isoformat('T'), "0001-02-03T04:05:01.000123")
|
|
1623
|
-
self.assertEqual(t.isoformat(' '), "0001-02-03 04:05:01.000123")
|
|
1624
|
-
self.assertEqual(t.isoformat('\x00'), "0001-02-03\x0004:05:01.000123")
|
|
1625
|
-
self.assertEqual(t.isoformat(timespec='hours'), "0001-02-03T04")
|
|
1626
|
-
self.assertEqual(t.isoformat(timespec='minutes'), "0001-02-03T04:05")
|
|
1627
|
-
self.assertEqual(t.isoformat(timespec='seconds'), "0001-02-03T04:05:01")
|
|
1628
|
-
self.assertEqual(t.isoformat(timespec='milliseconds'), "0001-02-03T04:05:01.000")
|
|
1629
|
-
self.assertEqual(t.isoformat(timespec='microseconds'), "0001-02-03T04:05:01.000123")
|
|
1630
|
-
self.assertEqual(t.isoformat(timespec='auto'), "0001-02-03T04:05:01.000123")
|
|
1631
|
-
self.assertEqual(t.isoformat(sep=' ', timespec='minutes'), "0001-02-03 04:05")
|
|
1632
|
-
self.assertRaises(ValueError, t.isoformat, timespec='foo')
|
|
1633
|
-
# str is ISO format with the separator forced to a blank.
|
|
1634
|
-
self.assertEqual(str(t), "0001-02-03 04:05:01.000123")
|
|
1635
|
-
|
|
1636
|
-
t = self.theclass(1, 2, 3, 4, 5, 1, 999500, tzinfo=timezone.utc)
|
|
1637
|
-
self.assertEqual(t.isoformat(timespec='milliseconds'), "0001-02-03T04:05:01.999+00:00")
|
|
1638
|
-
|
|
1639
|
-
t = self.theclass(1, 2, 3, 4, 5, 1, 999500)
|
|
1640
|
-
self.assertEqual(t.isoformat(timespec='milliseconds'), "0001-02-03T04:05:01.999")
|
|
1641
|
-
|
|
1642
|
-
t = self.theclass(1, 2, 3, 4, 5, 1)
|
|
1643
|
-
self.assertEqual(t.isoformat(timespec='auto'), "0001-02-03T04:05:01")
|
|
1644
|
-
self.assertEqual(t.isoformat(timespec='milliseconds'), "0001-02-03T04:05:01.000")
|
|
1645
|
-
self.assertEqual(t.isoformat(timespec='microseconds'), "0001-02-03T04:05:01.000000")
|
|
1646
|
-
|
|
1647
|
-
t = self.theclass(2, 3, 2)
|
|
1648
|
-
self.assertEqual(t.isoformat(), "0002-03-02T00:00:00")
|
|
1649
|
-
self.assertEqual(t.isoformat('T'), "0002-03-02T00:00:00")
|
|
1650
|
-
self.assertEqual(t.isoformat(' '), "0002-03-02 00:00:00")
|
|
1651
|
-
# str is ISO format with the separator forced to a blank.
|
|
1652
|
-
self.assertEqual(str(t), "0002-03-02 00:00:00")
|
|
1653
|
-
# ISO format with timezone
|
|
1654
|
-
tz = FixedOffset(timedelta(seconds=16), 'XXX')
|
|
1655
|
-
t = self.theclass(2, 3, 2, tzinfo=tz)
|
|
1656
|
-
self.assertEqual(t.isoformat(), "0002-03-02T00:00:00+00:00:16")
|
|
1657
|
-
|
|
1658
|
-
def test_format(self):
|
|
1659
|
-
dt = self.theclass(2007, 9, 10, 4, 5, 1, 123)
|
|
1660
|
-
self.assertEqual(dt.__format__(''), str(dt))
|
|
1661
|
-
|
|
1662
|
-
with self.assertRaisesRegex(TypeError, 'must be str, not int'):
|
|
1663
|
-
dt.__format__(123)
|
|
1664
|
-
|
|
1665
|
-
# check that a derived class's __str__() gets called
|
|
1666
|
-
class A(self.theclass):
|
|
1667
|
-
def __str__(self):
|
|
1668
|
-
return 'A'
|
|
1669
|
-
a = A(2007, 9, 10, 4, 5, 1, 123)
|
|
1670
|
-
self.assertEqual(a.__format__(''), 'A')
|
|
1671
|
-
|
|
1672
|
-
# check that a derived class's strftime gets called
|
|
1673
|
-
class B(self.theclass):
|
|
1674
|
-
def strftime(self, format_spec):
|
|
1675
|
-
return 'B'
|
|
1676
|
-
b = B(2007, 9, 10, 4, 5, 1, 123)
|
|
1677
|
-
self.assertEqual(b.__format__(''), str(dt))
|
|
1678
|
-
|
|
1679
|
-
for fmt in ["m:%m d:%d y:%y",
|
|
1680
|
-
"m:%m d:%d y:%y H:%H M:%M S:%S",
|
|
1681
|
-
"%z %Z",
|
|
1682
|
-
]:
|
|
1683
|
-
self.assertEqual(dt.__format__(fmt), dt.strftime(fmt))
|
|
1684
|
-
self.assertEqual(a.__format__(fmt), dt.strftime(fmt))
|
|
1685
|
-
self.assertEqual(b.__format__(fmt), 'B')
|
|
1686
|
-
|
|
1687
|
-
def test_more_ctime(self):
|
|
1688
|
-
# Test fields that TestDate doesn't touch.
|
|
1689
|
-
import time
|
|
1690
|
-
|
|
1691
|
-
t = self.theclass(2002, 3, 2, 18, 3, 5, 123)
|
|
1692
|
-
self.assertEqual(t.ctime(), "Sat Mar 2 18:03:05 2002")
|
|
1693
|
-
# Oops! The next line fails on Win2K under MSVC 6, so it's commented
|
|
1694
|
-
# out. The difference is that t.ctime() produces " 2" for the day,
|
|
1695
|
-
# but platform ctime() produces "02" for the day. According to
|
|
1696
|
-
# C99, t.ctime() is correct here.
|
|
1697
|
-
# self.assertEqual(t.ctime(), time.ctime(time.mktime(t.timetuple())))
|
|
1698
|
-
|
|
1699
|
-
# So test a case where that difference doesn't matter.
|
|
1700
|
-
t = self.theclass(2002, 3, 22, 18, 3, 5, 123)
|
|
1701
|
-
self.assertEqual(t.ctime(), time.ctime(time.mktime(t.timetuple())))
|
|
1702
|
-
|
|
1703
|
-
def test_tz_independent_comparing(self):
|
|
1704
|
-
dt1 = self.theclass(2002, 3, 1, 9, 0, 0)
|
|
1705
|
-
dt2 = self.theclass(2002, 3, 1, 10, 0, 0)
|
|
1706
|
-
dt3 = self.theclass(2002, 3, 1, 9, 0, 0)
|
|
1707
|
-
self.assertEqual(dt1, dt3)
|
|
1708
|
-
self.assertTrue(dt2 > dt3)
|
|
1709
|
-
|
|
1710
|
-
# Make sure comparison doesn't forget microseconds, and isn't done
|
|
1711
|
-
# via comparing a float timestamp (an IEEE double doesn't have enough
|
|
1712
|
-
# precision to span microsecond resolution across years 1 thru 9999,
|
|
1713
|
-
# so comparing via timestamp necessarily calls some distinct values
|
|
1714
|
-
# equal).
|
|
1715
|
-
dt1 = self.theclass(MAXYEAR, 12, 31, 23, 59, 59, 999998)
|
|
1716
|
-
us = timedelta(microseconds=1)
|
|
1717
|
-
dt2 = dt1 + us
|
|
1718
|
-
self.assertEqual(dt2 - dt1, us)
|
|
1719
|
-
self.assertTrue(dt1 < dt2)
|
|
1720
|
-
|
|
1721
|
-
def test_strftime_with_bad_tzname_replace(self):
|
|
1722
|
-
# verify ok if tzinfo.tzname().replace() returns a non-string
|
|
1723
|
-
class MyTzInfo(FixedOffset):
|
|
1724
|
-
def tzname(self, dt):
|
|
1725
|
-
class MyStr(str):
|
|
1726
|
-
def replace(self, *args):
|
|
1727
|
-
return None
|
|
1728
|
-
return MyStr('name')
|
|
1729
|
-
t = self.theclass(2005, 3, 2, 0, 0, 0, 0, MyTzInfo(3, 'name'))
|
|
1730
|
-
self.assertRaises(TypeError, t.strftime, '%Z')
|
|
1731
|
-
|
|
1732
|
-
def test_bad_constructor_arguments(self):
|
|
1733
|
-
# bad years
|
|
1734
|
-
self.theclass(MINYEAR, 1, 1) # no exception
|
|
1735
|
-
self.theclass(MAXYEAR, 1, 1) # no exception
|
|
1736
|
-
self.assertRaises(ValueError, self.theclass, MINYEAR-1, 1, 1)
|
|
1737
|
-
self.assertRaises(ValueError, self.theclass, MAXYEAR+1, 1, 1)
|
|
1738
|
-
# bad months
|
|
1739
|
-
self.theclass(2000, 1, 1) # no exception
|
|
1740
|
-
self.theclass(2000, 12, 1) # no exception
|
|
1741
|
-
self.assertRaises(ValueError, self.theclass, 2000, 0, 1)
|
|
1742
|
-
self.assertRaises(ValueError, self.theclass, 2000, 13, 1)
|
|
1743
|
-
# bad days
|
|
1744
|
-
self.theclass(2000, 2, 29) # no exception
|
|
1745
|
-
self.theclass(2004, 2, 29) # no exception
|
|
1746
|
-
self.theclass(2400, 2, 29) # no exception
|
|
1747
|
-
self.assertRaises(ValueError, self.theclass, 2000, 2, 30)
|
|
1748
|
-
self.assertRaises(ValueError, self.theclass, 2001, 2, 29)
|
|
1749
|
-
self.assertRaises(ValueError, self.theclass, 2100, 2, 29)
|
|
1750
|
-
self.assertRaises(ValueError, self.theclass, 1900, 2, 29)
|
|
1751
|
-
self.assertRaises(ValueError, self.theclass, 2000, 1, 0)
|
|
1752
|
-
self.assertRaises(ValueError, self.theclass, 2000, 1, 32)
|
|
1753
|
-
# bad hours
|
|
1754
|
-
self.theclass(2000, 1, 31, 0) # no exception
|
|
1755
|
-
self.theclass(2000, 1, 31, 23) # no exception
|
|
1756
|
-
self.assertRaises(ValueError, self.theclass, 2000, 1, 31, -1)
|
|
1757
|
-
self.assertRaises(ValueError, self.theclass, 2000, 1, 31, 24)
|
|
1758
|
-
# bad minutes
|
|
1759
|
-
self.theclass(2000, 1, 31, 23, 0) # no exception
|
|
1760
|
-
self.theclass(2000, 1, 31, 23, 59) # no exception
|
|
1761
|
-
self.assertRaises(ValueError, self.theclass, 2000, 1, 31, 23, -1)
|
|
1762
|
-
self.assertRaises(ValueError, self.theclass, 2000, 1, 31, 23, 60)
|
|
1763
|
-
# bad seconds
|
|
1764
|
-
self.theclass(2000, 1, 31, 23, 59, 0) # no exception
|
|
1765
|
-
self.theclass(2000, 1, 31, 23, 59, 59) # no exception
|
|
1766
|
-
self.assertRaises(ValueError, self.theclass, 2000, 1, 31, 23, 59, -1)
|
|
1767
|
-
self.assertRaises(ValueError, self.theclass, 2000, 1, 31, 23, 59, 60)
|
|
1768
|
-
# bad microseconds
|
|
1769
|
-
self.theclass(2000, 1, 31, 23, 59, 59, 0) # no exception
|
|
1770
|
-
self.theclass(2000, 1, 31, 23, 59, 59, 999999) # no exception
|
|
1771
|
-
self.assertRaises(ValueError, self.theclass,
|
|
1772
|
-
2000, 1, 31, 23, 59, 59, -1)
|
|
1773
|
-
self.assertRaises(ValueError, self.theclass,
|
|
1774
|
-
2000, 1, 31, 23, 59, 59,
|
|
1775
|
-
1000000)
|
|
1776
|
-
# bad fold
|
|
1777
|
-
self.assertRaises(ValueError, self.theclass,
|
|
1778
|
-
2000, 1, 31, fold=-1)
|
|
1779
|
-
self.assertRaises(ValueError, self.theclass,
|
|
1780
|
-
2000, 1, 31, fold=2)
|
|
1781
|
-
# Positional fold:
|
|
1782
|
-
self.assertRaises(TypeError, self.theclass,
|
|
1783
|
-
2000, 1, 31, 23, 59, 59, 0, None, 1)
|
|
1784
|
-
|
|
1785
|
-
def test_hash_equality(self):
|
|
1786
|
-
d = self.theclass(2000, 12, 31, 23, 30, 17)
|
|
1787
|
-
e = self.theclass(2000, 12, 31, 23, 30, 17)
|
|
1788
|
-
self.assertEqual(d, e)
|
|
1789
|
-
self.assertEqual(hash(d), hash(e))
|
|
1790
|
-
|
|
1791
|
-
dic = {d: 1}
|
|
1792
|
-
dic[e] = 2
|
|
1793
|
-
self.assertEqual(len(dic), 1)
|
|
1794
|
-
self.assertEqual(dic[d], 2)
|
|
1795
|
-
self.assertEqual(dic[e], 2)
|
|
1796
|
-
|
|
1797
|
-
d = self.theclass(2001, 1, 1, 0, 5, 17)
|
|
1798
|
-
e = self.theclass(2001, 1, 1, 0, 5, 17)
|
|
1799
|
-
self.assertEqual(d, e)
|
|
1800
|
-
self.assertEqual(hash(d), hash(e))
|
|
1801
|
-
|
|
1802
|
-
dic = {d: 1}
|
|
1803
|
-
dic[e] = 2
|
|
1804
|
-
self.assertEqual(len(dic), 1)
|
|
1805
|
-
self.assertEqual(dic[d], 2)
|
|
1806
|
-
self.assertEqual(dic[e], 2)
|
|
1807
|
-
|
|
1808
|
-
def test_computations(self):
|
|
1809
|
-
a = self.theclass(2002, 1, 31)
|
|
1810
|
-
b = self.theclass(1956, 1, 31)
|
|
1811
|
-
diff = a-b
|
|
1812
|
-
self.assertEqual(diff.days, 46*365 + len(range(1956, 2002, 4)))
|
|
1813
|
-
self.assertEqual(diff.seconds, 0)
|
|
1814
|
-
self.assertEqual(diff.microseconds, 0)
|
|
1815
|
-
a = self.theclass(2002, 3, 2, 17, 6)
|
|
1816
|
-
millisec = timedelta(0, 0, 1000)
|
|
1817
|
-
hour = timedelta(0, 3600)
|
|
1818
|
-
day = timedelta(1)
|
|
1819
|
-
week = timedelta(7)
|
|
1820
|
-
self.assertEqual(a + hour, self.theclass(2002, 3, 2, 18, 6))
|
|
1821
|
-
self.assertEqual(hour + a, self.theclass(2002, 3, 2, 18, 6))
|
|
1822
|
-
self.assertEqual(a + 10*hour, self.theclass(2002, 3, 3, 3, 6))
|
|
1823
|
-
self.assertEqual(a - hour, self.theclass(2002, 3, 2, 16, 6))
|
|
1824
|
-
self.assertEqual(-hour + a, self.theclass(2002, 3, 2, 16, 6))
|
|
1825
|
-
self.assertEqual(a - hour, a + -hour)
|
|
1826
|
-
self.assertEqual(a - 20*hour, self.theclass(2002, 3, 1, 21, 6))
|
|
1827
|
-
self.assertEqual(a + day, self.theclass(2002, 3, 3, 17, 6))
|
|
1828
|
-
self.assertEqual(a - day, self.theclass(2002, 3, 1, 17, 6))
|
|
1829
|
-
self.assertEqual(a + week, self.theclass(2002, 3, 9, 17, 6))
|
|
1830
|
-
self.assertEqual(a - week, self.theclass(2002, 2, 23, 17, 6))
|
|
1831
|
-
self.assertEqual(a + 52*week, self.theclass(2003, 3, 1, 17, 6))
|
|
1832
|
-
self.assertEqual(a - 52*week, self.theclass(2001, 3, 3, 17, 6))
|
|
1833
|
-
self.assertEqual((a + week) - a, week)
|
|
1834
|
-
self.assertEqual((a + day) - a, day)
|
|
1835
|
-
self.assertEqual((a + hour) - a, hour)
|
|
1836
|
-
self.assertEqual((a + millisec) - a, millisec)
|
|
1837
|
-
self.assertEqual((a - week) - a, -week)
|
|
1838
|
-
self.assertEqual((a - day) - a, -day)
|
|
1839
|
-
self.assertEqual((a - hour) - a, -hour)
|
|
1840
|
-
self.assertEqual((a - millisec) - a, -millisec)
|
|
1841
|
-
self.assertEqual(a - (a + week), -week)
|
|
1842
|
-
self.assertEqual(a - (a + day), -day)
|
|
1843
|
-
self.assertEqual(a - (a + hour), -hour)
|
|
1844
|
-
self.assertEqual(a - (a + millisec), -millisec)
|
|
1845
|
-
self.assertEqual(a - (a - week), week)
|
|
1846
|
-
self.assertEqual(a - (a - day), day)
|
|
1847
|
-
self.assertEqual(a - (a - hour), hour)
|
|
1848
|
-
self.assertEqual(a - (a - millisec), millisec)
|
|
1849
|
-
self.assertEqual(a + (week + day + hour + millisec),
|
|
1850
|
-
self.theclass(2002, 3, 10, 18, 6, 0, 1000))
|
|
1851
|
-
self.assertEqual(a + (week + day + hour + millisec),
|
|
1852
|
-
(((a + week) + day) + hour) + millisec)
|
|
1853
|
-
self.assertEqual(a - (week + day + hour + millisec),
|
|
1854
|
-
self.theclass(2002, 2, 22, 16, 5, 59, 999000))
|
|
1855
|
-
self.assertEqual(a - (week + day + hour + millisec),
|
|
1856
|
-
(((a - week) - day) - hour) - millisec)
|
|
1857
|
-
# Add/sub ints or floats should be illegal
|
|
1858
|
-
for i in 1, 1.0:
|
|
1859
|
-
self.assertRaises(TypeError, lambda: a+i)
|
|
1860
|
-
self.assertRaises(TypeError, lambda: a-i)
|
|
1861
|
-
self.assertRaises(TypeError, lambda: i+a)
|
|
1862
|
-
self.assertRaises(TypeError, lambda: i-a)
|
|
1863
|
-
|
|
1864
|
-
# delta - datetime is senseless.
|
|
1865
|
-
self.assertRaises(TypeError, lambda: day - a)
|
|
1866
|
-
# mixing datetime and (delta or datetime) via * or // is senseless
|
|
1867
|
-
self.assertRaises(TypeError, lambda: day * a)
|
|
1868
|
-
self.assertRaises(TypeError, lambda: a * day)
|
|
1869
|
-
self.assertRaises(TypeError, lambda: day // a)
|
|
1870
|
-
self.assertRaises(TypeError, lambda: a // day)
|
|
1871
|
-
self.assertRaises(TypeError, lambda: a * a)
|
|
1872
|
-
self.assertRaises(TypeError, lambda: a // a)
|
|
1873
|
-
# datetime + datetime is senseless
|
|
1874
|
-
self.assertRaises(TypeError, lambda: a + a)
|
|
1875
|
-
|
|
1876
|
-
def test_pickling(self):
|
|
1877
|
-
args = 6, 7, 23, 20, 59, 1, 64**2
|
|
1878
|
-
orig = self.theclass(*args)
|
|
1879
|
-
for pickler, unpickler, proto in pickle_choices:
|
|
1880
|
-
green = pickler.dumps(orig, proto)
|
|
1881
|
-
derived = unpickler.loads(green)
|
|
1882
|
-
self.assertEqual(orig, derived)
|
|
1883
|
-
self.assertEqual(orig.__reduce__(), orig.__reduce_ex__(2))
|
|
1884
|
-
|
|
1885
|
-
def test_more_pickling(self):
|
|
1886
|
-
a = self.theclass(2003, 2, 7, 16, 48, 37, 444116)
|
|
1887
|
-
for proto in range(pickle.HIGHEST_PROTOCOL + 1):
|
|
1888
|
-
s = pickle.dumps(a, proto)
|
|
1889
|
-
b = pickle.loads(s)
|
|
1890
|
-
self.assertEqual(b.year, 2003)
|
|
1891
|
-
self.assertEqual(b.month, 2)
|
|
1892
|
-
self.assertEqual(b.day, 7)
|
|
1893
|
-
|
|
1894
|
-
def test_pickling_subclass_datetime(self):
|
|
1895
|
-
args = 6, 7, 23, 20, 59, 1, 64**2
|
|
1896
|
-
orig = SubclassDatetime(*args)
|
|
1897
|
-
for pickler, unpickler, proto in pickle_choices:
|
|
1898
|
-
green = pickler.dumps(orig, proto)
|
|
1899
|
-
derived = unpickler.loads(green)
|
|
1900
|
-
self.assertEqual(orig, derived)
|
|
1901
|
-
|
|
1902
|
-
def test_more_compare(self):
|
|
1903
|
-
# The test_compare() inherited from TestDate covers the error cases.
|
|
1904
|
-
# We just want to test lexicographic ordering on the members datetime
|
|
1905
|
-
# has that date lacks.
|
|
1906
|
-
args = [2000, 11, 29, 20, 58, 16, 999998]
|
|
1907
|
-
t1 = self.theclass(*args)
|
|
1908
|
-
t2 = self.theclass(*args)
|
|
1909
|
-
self.assertEqual(t1, t2)
|
|
1910
|
-
self.assertTrue(t1 <= t2)
|
|
1911
|
-
self.assertTrue(t1 >= t2)
|
|
1912
|
-
self.assertFalse(t1 != t2)
|
|
1913
|
-
self.assertFalse(t1 < t2)
|
|
1914
|
-
self.assertFalse(t1 > t2)
|
|
1915
|
-
|
|
1916
|
-
for i in range(len(args)):
|
|
1917
|
-
newargs = args[:]
|
|
1918
|
-
newargs[i] = args[i] + 1
|
|
1919
|
-
t2 = self.theclass(*newargs) # this is larger than t1
|
|
1920
|
-
self.assertTrue(t1 < t2)
|
|
1921
|
-
self.assertTrue(t2 > t1)
|
|
1922
|
-
self.assertTrue(t1 <= t2)
|
|
1923
|
-
self.assertTrue(t2 >= t1)
|
|
1924
|
-
self.assertTrue(t1 != t2)
|
|
1925
|
-
self.assertTrue(t2 != t1)
|
|
1926
|
-
self.assertFalse(t1 == t2)
|
|
1927
|
-
self.assertFalse(t2 == t1)
|
|
1928
|
-
self.assertFalse(t1 > t2)
|
|
1929
|
-
self.assertFalse(t2 < t1)
|
|
1930
|
-
self.assertFalse(t1 >= t2)
|
|
1931
|
-
self.assertFalse(t2 <= t1)
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
# A helper for timestamp constructor tests.
|
|
1935
|
-
def verify_field_equality(self, expected, got):
|
|
1936
|
-
self.assertEqual(expected.tm_year, got.year)
|
|
1937
|
-
self.assertEqual(expected.tm_mon, got.month)
|
|
1938
|
-
self.assertEqual(expected.tm_mday, got.day)
|
|
1939
|
-
self.assertEqual(expected.tm_hour, got.hour)
|
|
1940
|
-
self.assertEqual(expected.tm_min, got.minute)
|
|
1941
|
-
self.assertEqual(expected.tm_sec, got.second)
|
|
1942
|
-
|
|
1943
|
-
def test_fromtimestamp(self):
|
|
1944
|
-
import time
|
|
1945
|
-
|
|
1946
|
-
ts = time.time()
|
|
1947
|
-
expected = time.localtime(ts)
|
|
1948
|
-
got = self.theclass.fromtimestamp(ts)
|
|
1949
|
-
self.verify_field_equality(expected, got)
|
|
1950
|
-
|
|
1951
|
-
def test_utcfromtimestamp(self):
|
|
1952
|
-
import time
|
|
1953
|
-
|
|
1954
|
-
ts = time.time()
|
|
1955
|
-
expected = time.gmtime(ts)
|
|
1956
|
-
got = self.theclass.utcfromtimestamp(ts)
|
|
1957
|
-
self.verify_field_equality(expected, got)
|
|
1958
|
-
|
|
1959
|
-
# Run with US-style DST rules: DST begins 2 a.m. on second Sunday in
|
|
1960
|
-
# March (M3.2.0) and ends 2 a.m. on first Sunday in November (M11.1.0).
|
|
1961
|
-
@support.run_with_tz('EST+05EDT,M3.2.0,M11.1.0')
|
|
1962
|
-
def test_timestamp_naive(self):
|
|
1963
|
-
t = self.theclass(1970, 1, 1)
|
|
1964
|
-
self.assertEqual(t.timestamp(), 18000.0)
|
|
1965
|
-
t = self.theclass(1970, 1, 1, 1, 2, 3, 4)
|
|
1966
|
-
self.assertEqual(t.timestamp(),
|
|
1967
|
-
18000.0 + 3600 + 2*60 + 3 + 4*1e-6)
|
|
1968
|
-
# Missing hour
|
|
1969
|
-
t0 = self.theclass(2012, 3, 11, 2, 30)
|
|
1970
|
-
t1 = t0.replace(fold=1)
|
|
1971
|
-
self.assertEqual(self.theclass.fromtimestamp(t1.timestamp()),
|
|
1972
|
-
t0 - timedelta(hours=1))
|
|
1973
|
-
self.assertEqual(self.theclass.fromtimestamp(t0.timestamp()),
|
|
1974
|
-
t1 + timedelta(hours=1))
|
|
1975
|
-
# Ambiguous hour defaults to DST
|
|
1976
|
-
t = self.theclass(2012, 11, 4, 1, 30)
|
|
1977
|
-
self.assertEqual(self.theclass.fromtimestamp(t.timestamp()), t)
|
|
1978
|
-
|
|
1979
|
-
# Timestamp may raise an overflow error on some platforms
|
|
1980
|
-
# XXX: Do we care to support the first and last year?
|
|
1981
|
-
for t in [self.theclass(2,1,1), self.theclass(9998,12,12)]:
|
|
1982
|
-
try:
|
|
1983
|
-
s = t.timestamp()
|
|
1984
|
-
except OverflowError:
|
|
1985
|
-
pass
|
|
1986
|
-
else:
|
|
1987
|
-
self.assertEqual(self.theclass.fromtimestamp(s), t)
|
|
1988
|
-
|
|
1989
|
-
def test_timestamp_aware(self):
|
|
1990
|
-
t = self.theclass(1970, 1, 1, tzinfo=timezone.utc)
|
|
1991
|
-
self.assertEqual(t.timestamp(), 0.0)
|
|
1992
|
-
t = self.theclass(1970, 1, 1, 1, 2, 3, 4, tzinfo=timezone.utc)
|
|
1993
|
-
self.assertEqual(t.timestamp(),
|
|
1994
|
-
3600 + 2*60 + 3 + 4*1e-6)
|
|
1995
|
-
t = self.theclass(1970, 1, 1, 1, 2, 3, 4,
|
|
1996
|
-
tzinfo=timezone(timedelta(hours=-5), 'EST'))
|
|
1997
|
-
self.assertEqual(t.timestamp(),
|
|
1998
|
-
18000 + 3600 + 2*60 + 3 + 4*1e-6)
|
|
1999
|
-
|
|
2000
|
-
@support.run_with_tz('MSK-03') # Something east of Greenwich
|
|
2001
|
-
def test_microsecond_rounding(self):
|
|
2002
|
-
for fts in [self.theclass.fromtimestamp,
|
|
2003
|
-
self.theclass.utcfromtimestamp]:
|
|
2004
|
-
zero = fts(0)
|
|
2005
|
-
self.assertEqual(zero.second, 0)
|
|
2006
|
-
self.assertEqual(zero.microsecond, 0)
|
|
2007
|
-
one = fts(1e-6)
|
|
2008
|
-
try:
|
|
2009
|
-
minus_one = fts(-1e-6)
|
|
2010
|
-
except OSError:
|
|
2011
|
-
# localtime(-1) and gmtime(-1) is not supported on Windows
|
|
2012
|
-
pass
|
|
2013
|
-
else:
|
|
2014
|
-
self.assertEqual(minus_one.second, 59)
|
|
2015
|
-
self.assertEqual(minus_one.microsecond, 999999)
|
|
2016
|
-
|
|
2017
|
-
t = fts(-1e-8)
|
|
2018
|
-
self.assertEqual(t, zero)
|
|
2019
|
-
t = fts(-9e-7)
|
|
2020
|
-
self.assertEqual(t, minus_one)
|
|
2021
|
-
t = fts(-1e-7)
|
|
2022
|
-
self.assertEqual(t, zero)
|
|
2023
|
-
t = fts(-1/2**7)
|
|
2024
|
-
self.assertEqual(t.second, 59)
|
|
2025
|
-
self.assertEqual(t.microsecond, 992188)
|
|
2026
|
-
|
|
2027
|
-
t = fts(1e-7)
|
|
2028
|
-
self.assertEqual(t, zero)
|
|
2029
|
-
t = fts(9e-7)
|
|
2030
|
-
self.assertEqual(t, one)
|
|
2031
|
-
t = fts(0.99999949)
|
|
2032
|
-
self.assertEqual(t.second, 0)
|
|
2033
|
-
self.assertEqual(t.microsecond, 999999)
|
|
2034
|
-
t = fts(0.9999999)
|
|
2035
|
-
self.assertEqual(t.second, 1)
|
|
2036
|
-
self.assertEqual(t.microsecond, 0)
|
|
2037
|
-
t = fts(1/2**7)
|
|
2038
|
-
self.assertEqual(t.second, 0)
|
|
2039
|
-
self.assertEqual(t.microsecond, 7812)
|
|
2040
|
-
|
|
2041
|
-
def test_timestamp_limits(self):
|
|
2042
|
-
# minimum timestamp
|
|
2043
|
-
min_dt = self.theclass.min.replace(tzinfo=timezone.utc)
|
|
2044
|
-
min_ts = min_dt.timestamp()
|
|
2045
|
-
try:
|
|
2046
|
-
# date 0001-01-01 00:00:00+00:00: timestamp=-62135596800
|
|
2047
|
-
self.assertEqual(self.theclass.fromtimestamp(min_ts, tz=timezone.utc),
|
|
2048
|
-
min_dt)
|
|
2049
|
-
except (OverflowError, OSError) as exc:
|
|
2050
|
-
# the date 0001-01-01 doesn't fit into 32-bit time_t,
|
|
2051
|
-
# or platform doesn't support such very old date
|
|
2052
|
-
self.skipTest(str(exc))
|
|
2053
|
-
|
|
2054
|
-
# maximum timestamp: set seconds to zero to avoid rounding issues
|
|
2055
|
-
max_dt = self.theclass.max.replace(tzinfo=timezone.utc,
|
|
2056
|
-
second=0, microsecond=0)
|
|
2057
|
-
max_ts = max_dt.timestamp()
|
|
2058
|
-
# date 9999-12-31 23:59:00+00:00: timestamp 253402300740
|
|
2059
|
-
self.assertEqual(self.theclass.fromtimestamp(max_ts, tz=timezone.utc),
|
|
2060
|
-
max_dt)
|
|
2061
|
-
|
|
2062
|
-
# number of seconds greater than 1 year: make sure that the new date
|
|
2063
|
-
# is not valid in datetime.datetime limits
|
|
2064
|
-
delta = 3600 * 24 * 400
|
|
2065
|
-
|
|
2066
|
-
# too small
|
|
2067
|
-
ts = min_ts - delta
|
|
2068
|
-
# converting a Python int to C time_t can raise a OverflowError,
|
|
2069
|
-
# especially on 32-bit platforms.
|
|
2070
|
-
with self.assertRaises((ValueError, OverflowError)):
|
|
2071
|
-
self.theclass.fromtimestamp(ts)
|
|
2072
|
-
with self.assertRaises((ValueError, OverflowError)):
|
|
2073
|
-
self.theclass.utcfromtimestamp(ts)
|
|
2074
|
-
|
|
2075
|
-
# too big
|
|
2076
|
-
ts = max_dt.timestamp() + delta
|
|
2077
|
-
with self.assertRaises((ValueError, OverflowError)):
|
|
2078
|
-
self.theclass.fromtimestamp(ts)
|
|
2079
|
-
with self.assertRaises((ValueError, OverflowError)):
|
|
2080
|
-
self.theclass.utcfromtimestamp(ts)
|
|
2081
|
-
|
|
2082
|
-
def test_insane_fromtimestamp(self):
|
|
2083
|
-
# It's possible that some platform maps time_t to double,
|
|
2084
|
-
# and that this test will fail there. This test should
|
|
2085
|
-
# exempt such platforms (provided they return reasonable
|
|
2086
|
-
# results!).
|
|
2087
|
-
for insane in -1e200, 1e200:
|
|
2088
|
-
self.assertRaises(OverflowError, self.theclass.fromtimestamp,
|
|
2089
|
-
insane)
|
|
2090
|
-
|
|
2091
|
-
def test_insane_utcfromtimestamp(self):
|
|
2092
|
-
# It's possible that some platform maps time_t to double,
|
|
2093
|
-
# and that this test will fail there. This test should
|
|
2094
|
-
# exempt such platforms (provided they return reasonable
|
|
2095
|
-
# results!).
|
|
2096
|
-
for insane in -1e200, 1e200:
|
|
2097
|
-
self.assertRaises(OverflowError, self.theclass.utcfromtimestamp,
|
|
2098
|
-
insane)
|
|
2099
|
-
|
|
2100
|
-
@unittest.skipIf(sys.platform == "win32", "Windows doesn't accept negative timestamps")
|
|
2101
|
-
def test_negative_float_fromtimestamp(self):
|
|
2102
|
-
# The result is tz-dependent; at least test that this doesn't
|
|
2103
|
-
# fail (like it did before bug 1646728 was fixed).
|
|
2104
|
-
self.theclass.fromtimestamp(-1.05)
|
|
2105
|
-
|
|
2106
|
-
@unittest.skipIf(sys.platform == "win32", "Windows doesn't accept negative timestamps")
|
|
2107
|
-
def test_negative_float_utcfromtimestamp(self):
|
|
2108
|
-
d = self.theclass.utcfromtimestamp(-1.05)
|
|
2109
|
-
self.assertEqual(d, self.theclass(1969, 12, 31, 23, 59, 58, 950000))
|
|
2110
|
-
|
|
2111
|
-
def test_utcnow(self):
|
|
2112
|
-
import time
|
|
2113
|
-
|
|
2114
|
-
# Call it a success if utcnow() and utcfromtimestamp() are within
|
|
2115
|
-
# a second of each other.
|
|
2116
|
-
tolerance = timedelta(seconds=1)
|
|
2117
|
-
for dummy in range(3):
|
|
2118
|
-
from_now = self.theclass.utcnow()
|
|
2119
|
-
from_timestamp = self.theclass.utcfromtimestamp(time.time())
|
|
2120
|
-
if abs(from_timestamp - from_now) <= tolerance:
|
|
2121
|
-
break
|
|
2122
|
-
# Else try again a few times.
|
|
2123
|
-
self.assertLessEqual(abs(from_timestamp - from_now), tolerance)
|
|
2124
|
-
|
|
2125
|
-
def test_strptime(self):
|
|
2126
|
-
string = '2004-12-01 13:02:47.197'
|
|
2127
|
-
format = '%Y-%m-%d %H:%M:%S.%f'
|
|
2128
|
-
expected = _strptime._strptime_datetime(self.theclass, string, format)
|
|
2129
|
-
got = self.theclass.strptime(string, format)
|
|
2130
|
-
self.assertEqual(expected, got)
|
|
2131
|
-
self.assertIs(type(expected), self.theclass)
|
|
2132
|
-
self.assertIs(type(got), self.theclass)
|
|
2133
|
-
|
|
2134
|
-
strptime = self.theclass.strptime
|
|
2135
|
-
self.assertEqual(strptime("+0002", "%z").utcoffset(), 2 * MINUTE)
|
|
2136
|
-
self.assertEqual(strptime("-0002", "%z").utcoffset(), -2 * MINUTE)
|
|
2137
|
-
# Only local timezone and UTC are supported
|
|
2138
|
-
for tzseconds, tzname in ((0, 'UTC'), (0, 'GMT'),
|
|
2139
|
-
(-_time.timezone, _time.tzname[0])):
|
|
2140
|
-
if tzseconds < 0:
|
|
2141
|
-
sign = '-'
|
|
2142
|
-
seconds = -tzseconds
|
|
2143
|
-
else:
|
|
2144
|
-
sign ='+'
|
|
2145
|
-
seconds = tzseconds
|
|
2146
|
-
hours, minutes = divmod(seconds//60, 60)
|
|
2147
|
-
dtstr = "{}{:02d}{:02d} {}".format(sign, hours, minutes, tzname)
|
|
2148
|
-
dt = strptime(dtstr, "%z %Z")
|
|
2149
|
-
self.assertEqual(dt.utcoffset(), timedelta(seconds=tzseconds))
|
|
2150
|
-
self.assertEqual(dt.tzname(), tzname)
|
|
2151
|
-
# Can produce inconsistent datetime
|
|
2152
|
-
dtstr, fmt = "+1234 UTC", "%z %Z"
|
|
2153
|
-
dt = strptime(dtstr, fmt)
|
|
2154
|
-
self.assertEqual(dt.utcoffset(), 12 * HOUR + 34 * MINUTE)
|
|
2155
|
-
self.assertEqual(dt.tzname(), 'UTC')
|
|
2156
|
-
# yet will roundtrip
|
|
2157
|
-
self.assertEqual(dt.strftime(fmt), dtstr)
|
|
2158
|
-
|
|
2159
|
-
# Produce naive datetime if no %z is provided
|
|
2160
|
-
self.assertEqual(strptime("UTC", "%Z").tzinfo, None)
|
|
2161
|
-
|
|
2162
|
-
with self.assertRaises(ValueError): strptime("-2400", "%z")
|
|
2163
|
-
with self.assertRaises(ValueError): strptime("-000", "%z")
|
|
2164
|
-
|
|
2165
|
-
def test_more_timetuple(self):
|
|
2166
|
-
# This tests fields beyond those tested by the TestDate.test_timetuple.
|
|
2167
|
-
t = self.theclass(2004, 12, 31, 6, 22, 33)
|
|
2168
|
-
self.assertEqual(t.timetuple(), (2004, 12, 31, 6, 22, 33, 4, 366, -1))
|
|
2169
|
-
self.assertEqual(t.timetuple(),
|
|
2170
|
-
(t.year, t.month, t.day,
|
|
2171
|
-
t.hour, t.minute, t.second,
|
|
2172
|
-
t.weekday(),
|
|
2173
|
-
t.toordinal() - date(t.year, 1, 1).toordinal() + 1,
|
|
2174
|
-
-1))
|
|
2175
|
-
tt = t.timetuple()
|
|
2176
|
-
self.assertEqual(tt.tm_year, t.year)
|
|
2177
|
-
self.assertEqual(tt.tm_mon, t.month)
|
|
2178
|
-
self.assertEqual(tt.tm_mday, t.day)
|
|
2179
|
-
self.assertEqual(tt.tm_hour, t.hour)
|
|
2180
|
-
self.assertEqual(tt.tm_min, t.minute)
|
|
2181
|
-
self.assertEqual(tt.tm_sec, t.second)
|
|
2182
|
-
self.assertEqual(tt.tm_wday, t.weekday())
|
|
2183
|
-
self.assertEqual(tt.tm_yday, t.toordinal() -
|
|
2184
|
-
date(t.year, 1, 1).toordinal() + 1)
|
|
2185
|
-
self.assertEqual(tt.tm_isdst, -1)
|
|
2186
|
-
|
|
2187
|
-
def test_more_strftime(self):
|
|
2188
|
-
# This tests fields beyond those tested by the TestDate.test_strftime.
|
|
2189
|
-
t = self.theclass(2004, 12, 31, 6, 22, 33, 47)
|
|
2190
|
-
self.assertEqual(t.strftime("%m %d %y %f %S %M %H %j"),
|
|
2191
|
-
"12 31 04 000047 33 22 06 366")
|
|
2192
|
-
|
|
2193
|
-
def test_extract(self):
|
|
2194
|
-
dt = self.theclass(2002, 3, 4, 18, 45, 3, 1234)
|
|
2195
|
-
self.assertEqual(dt.date(), date(2002, 3, 4))
|
|
2196
|
-
self.assertEqual(dt.time(), time(18, 45, 3, 1234))
|
|
2197
|
-
|
|
2198
|
-
def test_combine(self):
|
|
2199
|
-
d = date(2002, 3, 4)
|
|
2200
|
-
t = time(18, 45, 3, 1234)
|
|
2201
|
-
expected = self.theclass(2002, 3, 4, 18, 45, 3, 1234)
|
|
2202
|
-
combine = self.theclass.combine
|
|
2203
|
-
dt = combine(d, t)
|
|
2204
|
-
self.assertEqual(dt, expected)
|
|
2205
|
-
|
|
2206
|
-
dt = combine(time=t, date=d)
|
|
2207
|
-
self.assertEqual(dt, expected)
|
|
2208
|
-
|
|
2209
|
-
self.assertEqual(d, dt.date())
|
|
2210
|
-
self.assertEqual(t, dt.time())
|
|
2211
|
-
self.assertEqual(dt, combine(dt.date(), dt.time()))
|
|
2212
|
-
|
|
2213
|
-
self.assertRaises(TypeError, combine) # need an arg
|
|
2214
|
-
self.assertRaises(TypeError, combine, d) # need two args
|
|
2215
|
-
self.assertRaises(TypeError, combine, t, d) # args reversed
|
|
2216
|
-
self.assertRaises(TypeError, combine, d, t, 1) # wrong tzinfo type
|
|
2217
|
-
self.assertRaises(TypeError, combine, d, t, 1, 2) # too many args
|
|
2218
|
-
self.assertRaises(TypeError, combine, "date", "time") # wrong types
|
|
2219
|
-
self.assertRaises(TypeError, combine, d, "time") # wrong type
|
|
2220
|
-
self.assertRaises(TypeError, combine, "date", t) # wrong type
|
|
2221
|
-
|
|
2222
|
-
# tzinfo= argument
|
|
2223
|
-
dt = combine(d, t, timezone.utc)
|
|
2224
|
-
self.assertIs(dt.tzinfo, timezone.utc)
|
|
2225
|
-
dt = combine(d, t, tzinfo=timezone.utc)
|
|
2226
|
-
self.assertIs(dt.tzinfo, timezone.utc)
|
|
2227
|
-
t = time()
|
|
2228
|
-
dt = combine(dt, t)
|
|
2229
|
-
self.assertEqual(dt.date(), d)
|
|
2230
|
-
self.assertEqual(dt.time(), t)
|
|
2231
|
-
|
|
2232
|
-
def test_replace(self):
|
|
2233
|
-
cls = self.theclass
|
|
2234
|
-
args = [1, 2, 3, 4, 5, 6, 7]
|
|
2235
|
-
base = cls(*args)
|
|
2236
|
-
self.assertEqual(base, base.replace())
|
|
2237
|
-
|
|
2238
|
-
i = 0
|
|
2239
|
-
for name, newval in (("year", 2),
|
|
2240
|
-
("month", 3),
|
|
2241
|
-
("day", 4),
|
|
2242
|
-
("hour", 5),
|
|
2243
|
-
("minute", 6),
|
|
2244
|
-
("second", 7),
|
|
2245
|
-
("microsecond", 8)):
|
|
2246
|
-
newargs = args[:]
|
|
2247
|
-
newargs[i] = newval
|
|
2248
|
-
expected = cls(*newargs)
|
|
2249
|
-
got = base.replace(**{name: newval})
|
|
2250
|
-
self.assertEqual(expected, got)
|
|
2251
|
-
i += 1
|
|
2252
|
-
|
|
2253
|
-
# Out of bounds.
|
|
2254
|
-
base = cls(2000, 2, 29)
|
|
2255
|
-
self.assertRaises(ValueError, base.replace, year=2001)
|
|
2256
|
-
|
|
2257
|
-
def test_astimezone(self):
|
|
2258
|
-
return # The rest is no longer applicable
|
|
2259
|
-
# Pretty boring! The TZ test is more interesting here. astimezone()
|
|
2260
|
-
# simply can't be applied to a naive object.
|
|
2261
|
-
dt = self.theclass.now()
|
|
2262
|
-
f = FixedOffset(44, "")
|
|
2263
|
-
self.assertRaises(ValueError, dt.astimezone) # naive
|
|
2264
|
-
self.assertRaises(TypeError, dt.astimezone, f, f) # too many args
|
|
2265
|
-
self.assertRaises(TypeError, dt.astimezone, dt) # arg wrong type
|
|
2266
|
-
self.assertRaises(ValueError, dt.astimezone, f) # naive
|
|
2267
|
-
self.assertRaises(ValueError, dt.astimezone, tz=f) # naive
|
|
2268
|
-
|
|
2269
|
-
class Bogus(tzinfo):
|
|
2270
|
-
def utcoffset(self, dt): return None
|
|
2271
|
-
def dst(self, dt): return timedelta(0)
|
|
2272
|
-
bog = Bogus()
|
|
2273
|
-
self.assertRaises(ValueError, dt.astimezone, bog) # naive
|
|
2274
|
-
self.assertRaises(ValueError,
|
|
2275
|
-
dt.replace(tzinfo=bog).astimezone, f)
|
|
2276
|
-
|
|
2277
|
-
class AlsoBogus(tzinfo):
|
|
2278
|
-
def utcoffset(self, dt): return timedelta(0)
|
|
2279
|
-
def dst(self, dt): return None
|
|
2280
|
-
alsobog = AlsoBogus()
|
|
2281
|
-
self.assertRaises(ValueError, dt.astimezone, alsobog) # also naive
|
|
2282
|
-
|
|
2283
|
-
def test_subclass_datetime(self):
|
|
2284
|
-
|
|
2285
|
-
class C(self.theclass):
|
|
2286
|
-
theAnswer = 42
|
|
2287
|
-
|
|
2288
|
-
def __new__(cls, *args, **kws):
|
|
2289
|
-
temp = kws.copy()
|
|
2290
|
-
extra = temp.pop('extra')
|
|
2291
|
-
result = self.theclass.__new__(cls, *args, **temp)
|
|
2292
|
-
result.extra = extra
|
|
2293
|
-
return result
|
|
2294
|
-
|
|
2295
|
-
def newmeth(self, start):
|
|
2296
|
-
return start + self.year + self.month + self.second
|
|
2297
|
-
|
|
2298
|
-
args = 2003, 4, 14, 12, 13, 41
|
|
2299
|
-
|
|
2300
|
-
dt1 = self.theclass(*args)
|
|
2301
|
-
dt2 = C(*args, **{'extra': 7})
|
|
2302
|
-
|
|
2303
|
-
self.assertEqual(dt2.__class__, C)
|
|
2304
|
-
self.assertEqual(dt2.theAnswer, 42)
|
|
2305
|
-
self.assertEqual(dt2.extra, 7)
|
|
2306
|
-
self.assertEqual(dt1.toordinal(), dt2.toordinal())
|
|
2307
|
-
self.assertEqual(dt2.newmeth(-7), dt1.year + dt1.month +
|
|
2308
|
-
dt1.second - 7)
|
|
2309
|
-
|
|
2310
|
-
class TestSubclassDateTime(TestDateTime):
|
|
2311
|
-
theclass = SubclassDatetime
|
|
2312
|
-
# Override tests not designed for subclass
|
|
2313
|
-
@unittest.skip('not appropriate for subclasses')
|
|
2314
|
-
def test_roundtrip(self):
|
|
2315
|
-
pass
|
|
2316
|
-
|
|
2317
|
-
class SubclassTime(time):
|
|
2318
|
-
sub_var = 1
|
|
2319
|
-
|
|
2320
|
-
class TestTime(HarmlessMixedComparison, unittest.TestCase):
|
|
2321
|
-
|
|
2322
|
-
theclass = time
|
|
2323
|
-
|
|
2324
|
-
def test_basic_attributes(self):
|
|
2325
|
-
t = self.theclass(12, 0)
|
|
2326
|
-
self.assertEqual(t.hour, 12)
|
|
2327
|
-
self.assertEqual(t.minute, 0)
|
|
2328
|
-
self.assertEqual(t.second, 0)
|
|
2329
|
-
self.assertEqual(t.microsecond, 0)
|
|
2330
|
-
|
|
2331
|
-
def test_basic_attributes_nonzero(self):
|
|
2332
|
-
# Make sure all attributes are non-zero so bugs in
|
|
2333
|
-
# bit-shifting access show up.
|
|
2334
|
-
t = self.theclass(12, 59, 59, 8000)
|
|
2335
|
-
self.assertEqual(t.hour, 12)
|
|
2336
|
-
self.assertEqual(t.minute, 59)
|
|
2337
|
-
self.assertEqual(t.second, 59)
|
|
2338
|
-
self.assertEqual(t.microsecond, 8000)
|
|
2339
|
-
|
|
2340
|
-
def test_roundtrip(self):
|
|
2341
|
-
t = self.theclass(1, 2, 3, 4)
|
|
2342
|
-
|
|
2343
|
-
# Verify t -> string -> time identity.
|
|
2344
|
-
s = repr(t)
|
|
2345
|
-
self.assertTrue(s.startswith('datetime.'))
|
|
2346
|
-
s = s[9:]
|
|
2347
|
-
t2 = eval(s)
|
|
2348
|
-
self.assertEqual(t, t2)
|
|
2349
|
-
|
|
2350
|
-
# Verify identity via reconstructing from pieces.
|
|
2351
|
-
t2 = self.theclass(t.hour, t.minute, t.second,
|
|
2352
|
-
t.microsecond)
|
|
2353
|
-
self.assertEqual(t, t2)
|
|
2354
|
-
|
|
2355
|
-
def test_comparing(self):
|
|
2356
|
-
args = [1, 2, 3, 4]
|
|
2357
|
-
t1 = self.theclass(*args)
|
|
2358
|
-
t2 = self.theclass(*args)
|
|
2359
|
-
self.assertEqual(t1, t2)
|
|
2360
|
-
self.assertTrue(t1 <= t2)
|
|
2361
|
-
self.assertTrue(t1 >= t2)
|
|
2362
|
-
self.assertFalse(t1 != t2)
|
|
2363
|
-
self.assertFalse(t1 < t2)
|
|
2364
|
-
self.assertFalse(t1 > t2)
|
|
2365
|
-
|
|
2366
|
-
for i in range(len(args)):
|
|
2367
|
-
newargs = args[:]
|
|
2368
|
-
newargs[i] = args[i] + 1
|
|
2369
|
-
t2 = self.theclass(*newargs) # this is larger than t1
|
|
2370
|
-
self.assertTrue(t1 < t2)
|
|
2371
|
-
self.assertTrue(t2 > t1)
|
|
2372
|
-
self.assertTrue(t1 <= t2)
|
|
2373
|
-
self.assertTrue(t2 >= t1)
|
|
2374
|
-
self.assertTrue(t1 != t2)
|
|
2375
|
-
self.assertTrue(t2 != t1)
|
|
2376
|
-
self.assertFalse(t1 == t2)
|
|
2377
|
-
self.assertFalse(t2 == t1)
|
|
2378
|
-
self.assertFalse(t1 > t2)
|
|
2379
|
-
self.assertFalse(t2 < t1)
|
|
2380
|
-
self.assertFalse(t1 >= t2)
|
|
2381
|
-
self.assertFalse(t2 <= t1)
|
|
2382
|
-
|
|
2383
|
-
for badarg in OTHERSTUFF:
|
|
2384
|
-
self.assertEqual(t1 == badarg, False)
|
|
2385
|
-
self.assertEqual(t1 != badarg, True)
|
|
2386
|
-
self.assertEqual(badarg == t1, False)
|
|
2387
|
-
self.assertEqual(badarg != t1, True)
|
|
2388
|
-
|
|
2389
|
-
self.assertRaises(TypeError, lambda: t1 <= badarg)
|
|
2390
|
-
self.assertRaises(TypeError, lambda: t1 < badarg)
|
|
2391
|
-
self.assertRaises(TypeError, lambda: t1 > badarg)
|
|
2392
|
-
self.assertRaises(TypeError, lambda: t1 >= badarg)
|
|
2393
|
-
self.assertRaises(TypeError, lambda: badarg <= t1)
|
|
2394
|
-
self.assertRaises(TypeError, lambda: badarg < t1)
|
|
2395
|
-
self.assertRaises(TypeError, lambda: badarg > t1)
|
|
2396
|
-
self.assertRaises(TypeError, lambda: badarg >= t1)
|
|
2397
|
-
|
|
2398
|
-
def test_bad_constructor_arguments(self):
|
|
2399
|
-
# bad hours
|
|
2400
|
-
self.theclass(0, 0) # no exception
|
|
2401
|
-
self.theclass(23, 0) # no exception
|
|
2402
|
-
self.assertRaises(ValueError, self.theclass, -1, 0)
|
|
2403
|
-
self.assertRaises(ValueError, self.theclass, 24, 0)
|
|
2404
|
-
# bad minutes
|
|
2405
|
-
self.theclass(23, 0) # no exception
|
|
2406
|
-
self.theclass(23, 59) # no exception
|
|
2407
|
-
self.assertRaises(ValueError, self.theclass, 23, -1)
|
|
2408
|
-
self.assertRaises(ValueError, self.theclass, 23, 60)
|
|
2409
|
-
# bad seconds
|
|
2410
|
-
self.theclass(23, 59, 0) # no exception
|
|
2411
|
-
self.theclass(23, 59, 59) # no exception
|
|
2412
|
-
self.assertRaises(ValueError, self.theclass, 23, 59, -1)
|
|
2413
|
-
self.assertRaises(ValueError, self.theclass, 23, 59, 60)
|
|
2414
|
-
# bad microseconds
|
|
2415
|
-
self.theclass(23, 59, 59, 0) # no exception
|
|
2416
|
-
self.theclass(23, 59, 59, 999999) # no exception
|
|
2417
|
-
self.assertRaises(ValueError, self.theclass, 23, 59, 59, -1)
|
|
2418
|
-
self.assertRaises(ValueError, self.theclass, 23, 59, 59, 1000000)
|
|
2419
|
-
|
|
2420
|
-
def test_hash_equality(self):
|
|
2421
|
-
d = self.theclass(23, 30, 17)
|
|
2422
|
-
e = self.theclass(23, 30, 17)
|
|
2423
|
-
self.assertEqual(d, e)
|
|
2424
|
-
self.assertEqual(hash(d), hash(e))
|
|
2425
|
-
|
|
2426
|
-
dic = {d: 1}
|
|
2427
|
-
dic[e] = 2
|
|
2428
|
-
self.assertEqual(len(dic), 1)
|
|
2429
|
-
self.assertEqual(dic[d], 2)
|
|
2430
|
-
self.assertEqual(dic[e], 2)
|
|
2431
|
-
|
|
2432
|
-
d = self.theclass(0, 5, 17)
|
|
2433
|
-
e = self.theclass(0, 5, 17)
|
|
2434
|
-
self.assertEqual(d, e)
|
|
2435
|
-
self.assertEqual(hash(d), hash(e))
|
|
2436
|
-
|
|
2437
|
-
dic = {d: 1}
|
|
2438
|
-
dic[e] = 2
|
|
2439
|
-
self.assertEqual(len(dic), 1)
|
|
2440
|
-
self.assertEqual(dic[d], 2)
|
|
2441
|
-
self.assertEqual(dic[e], 2)
|
|
2442
|
-
|
|
2443
|
-
def test_isoformat(self):
|
|
2444
|
-
t = self.theclass(4, 5, 1, 123)
|
|
2445
|
-
self.assertEqual(t.isoformat(), "04:05:01.000123")
|
|
2446
|
-
self.assertEqual(t.isoformat(), str(t))
|
|
2447
|
-
|
|
2448
|
-
t = self.theclass()
|
|
2449
|
-
self.assertEqual(t.isoformat(), "00:00:00")
|
|
2450
|
-
self.assertEqual(t.isoformat(), str(t))
|
|
2451
|
-
|
|
2452
|
-
t = self.theclass(microsecond=1)
|
|
2453
|
-
self.assertEqual(t.isoformat(), "00:00:00.000001")
|
|
2454
|
-
self.assertEqual(t.isoformat(), str(t))
|
|
2455
|
-
|
|
2456
|
-
t = self.theclass(microsecond=10)
|
|
2457
|
-
self.assertEqual(t.isoformat(), "00:00:00.000010")
|
|
2458
|
-
self.assertEqual(t.isoformat(), str(t))
|
|
2459
|
-
|
|
2460
|
-
t = self.theclass(microsecond=100)
|
|
2461
|
-
self.assertEqual(t.isoformat(), "00:00:00.000100")
|
|
2462
|
-
self.assertEqual(t.isoformat(), str(t))
|
|
2463
|
-
|
|
2464
|
-
t = self.theclass(microsecond=1000)
|
|
2465
|
-
self.assertEqual(t.isoformat(), "00:00:00.001000")
|
|
2466
|
-
self.assertEqual(t.isoformat(), str(t))
|
|
2467
|
-
|
|
2468
|
-
t = self.theclass(microsecond=10000)
|
|
2469
|
-
self.assertEqual(t.isoformat(), "00:00:00.010000")
|
|
2470
|
-
self.assertEqual(t.isoformat(), str(t))
|
|
2471
|
-
|
|
2472
|
-
t = self.theclass(microsecond=100000)
|
|
2473
|
-
self.assertEqual(t.isoformat(), "00:00:00.100000")
|
|
2474
|
-
self.assertEqual(t.isoformat(), str(t))
|
|
2475
|
-
|
|
2476
|
-
t = self.theclass(hour=12, minute=34, second=56, microsecond=123456)
|
|
2477
|
-
self.assertEqual(t.isoformat(timespec='hours'), "12")
|
|
2478
|
-
self.assertEqual(t.isoformat(timespec='minutes'), "12:34")
|
|
2479
|
-
self.assertEqual(t.isoformat(timespec='seconds'), "12:34:56")
|
|
2480
|
-
self.assertEqual(t.isoformat(timespec='milliseconds'), "12:34:56.123")
|
|
2481
|
-
self.assertEqual(t.isoformat(timespec='microseconds'), "12:34:56.123456")
|
|
2482
|
-
self.assertEqual(t.isoformat(timespec='auto'), "12:34:56.123456")
|
|
2483
|
-
self.assertRaises(ValueError, t.isoformat, timespec='monkey')
|
|
2484
|
-
|
|
2485
|
-
t = self.theclass(hour=12, minute=34, second=56, microsecond=999500)
|
|
2486
|
-
self.assertEqual(t.isoformat(timespec='milliseconds'), "12:34:56.999")
|
|
2487
|
-
|
|
2488
|
-
t = self.theclass(hour=12, minute=34, second=56, microsecond=0)
|
|
2489
|
-
self.assertEqual(t.isoformat(timespec='milliseconds'), "12:34:56.000")
|
|
2490
|
-
self.assertEqual(t.isoformat(timespec='microseconds'), "12:34:56.000000")
|
|
2491
|
-
self.assertEqual(t.isoformat(timespec='auto'), "12:34:56")
|
|
2492
|
-
|
|
2493
|
-
def test_1653736(self):
|
|
2494
|
-
# verify it doesn't accept extra keyword arguments
|
|
2495
|
-
t = self.theclass(second=1)
|
|
2496
|
-
self.assertRaises(TypeError, t.isoformat, foo=3)
|
|
2497
|
-
|
|
2498
|
-
def test_strftime(self):
|
|
2499
|
-
t = self.theclass(1, 2, 3, 4)
|
|
2500
|
-
self.assertEqual(t.strftime('%H %M %S %f'), "01 02 03 000004")
|
|
2501
|
-
# A naive object replaces %z and %Z with empty strings.
|
|
2502
|
-
self.assertEqual(t.strftime("'%z' '%Z'"), "'' ''")
|
|
2503
|
-
|
|
2504
|
-
def test_format(self):
|
|
2505
|
-
t = self.theclass(1, 2, 3, 4)
|
|
2506
|
-
self.assertEqual(t.__format__(''), str(t))
|
|
2507
|
-
|
|
2508
|
-
with self.assertRaisesRegex(TypeError, 'must be str, not int'):
|
|
2509
|
-
t.__format__(123)
|
|
2510
|
-
|
|
2511
|
-
# check that a derived class's __str__() gets called
|
|
2512
|
-
class A(self.theclass):
|
|
2513
|
-
def __str__(self):
|
|
2514
|
-
return 'A'
|
|
2515
|
-
a = A(1, 2, 3, 4)
|
|
2516
|
-
self.assertEqual(a.__format__(''), 'A')
|
|
2517
|
-
|
|
2518
|
-
# check that a derived class's strftime gets called
|
|
2519
|
-
class B(self.theclass):
|
|
2520
|
-
def strftime(self, format_spec):
|
|
2521
|
-
return 'B'
|
|
2522
|
-
b = B(1, 2, 3, 4)
|
|
2523
|
-
self.assertEqual(b.__format__(''), str(t))
|
|
2524
|
-
|
|
2525
|
-
for fmt in ['%H %M %S',
|
|
2526
|
-
]:
|
|
2527
|
-
self.assertEqual(t.__format__(fmt), t.strftime(fmt))
|
|
2528
|
-
self.assertEqual(a.__format__(fmt), t.strftime(fmt))
|
|
2529
|
-
self.assertEqual(b.__format__(fmt), 'B')
|
|
2530
|
-
|
|
2531
|
-
def test_str(self):
|
|
2532
|
-
self.assertEqual(str(self.theclass(1, 2, 3, 4)), "01:02:03.000004")
|
|
2533
|
-
self.assertEqual(str(self.theclass(10, 2, 3, 4000)), "10:02:03.004000")
|
|
2534
|
-
self.assertEqual(str(self.theclass(0, 2, 3, 400000)), "00:02:03.400000")
|
|
2535
|
-
self.assertEqual(str(self.theclass(12, 2, 3, 0)), "12:02:03")
|
|
2536
|
-
self.assertEqual(str(self.theclass(23, 15, 0, 0)), "23:15:00")
|
|
2537
|
-
|
|
2538
|
-
def test_repr(self):
|
|
2539
|
-
name = 'datetime.' + self.theclass.__name__
|
|
2540
|
-
self.assertEqual(repr(self.theclass(1, 2, 3, 4)),
|
|
2541
|
-
"%s(1, 2, 3, 4)" % name)
|
|
2542
|
-
self.assertEqual(repr(self.theclass(10, 2, 3, 4000)),
|
|
2543
|
-
"%s(10, 2, 3, 4000)" % name)
|
|
2544
|
-
self.assertEqual(repr(self.theclass(0, 2, 3, 400000)),
|
|
2545
|
-
"%s(0, 2, 3, 400000)" % name)
|
|
2546
|
-
self.assertEqual(repr(self.theclass(12, 2, 3, 0)),
|
|
2547
|
-
"%s(12, 2, 3)" % name)
|
|
2548
|
-
self.assertEqual(repr(self.theclass(23, 15, 0, 0)),
|
|
2549
|
-
"%s(23, 15)" % name)
|
|
2550
|
-
|
|
2551
|
-
def test_resolution_info(self):
|
|
2552
|
-
self.assertIsInstance(self.theclass.min, self.theclass)
|
|
2553
|
-
self.assertIsInstance(self.theclass.max, self.theclass)
|
|
2554
|
-
self.assertIsInstance(self.theclass.resolution, timedelta)
|
|
2555
|
-
self.assertTrue(self.theclass.max > self.theclass.min)
|
|
2556
|
-
|
|
2557
|
-
def test_pickling(self):
|
|
2558
|
-
args = 20, 59, 16, 64**2
|
|
2559
|
-
orig = self.theclass(*args)
|
|
2560
|
-
for pickler, unpickler, proto in pickle_choices:
|
|
2561
|
-
green = pickler.dumps(orig, proto)
|
|
2562
|
-
derived = unpickler.loads(green)
|
|
2563
|
-
self.assertEqual(orig, derived)
|
|
2564
|
-
self.assertEqual(orig.__reduce__(), orig.__reduce_ex__(2))
|
|
2565
|
-
|
|
2566
|
-
def test_pickling_subclass_time(self):
|
|
2567
|
-
args = 20, 59, 16, 64**2
|
|
2568
|
-
orig = SubclassTime(*args)
|
|
2569
|
-
for pickler, unpickler, proto in pickle_choices:
|
|
2570
|
-
green = pickler.dumps(orig, proto)
|
|
2571
|
-
derived = unpickler.loads(green)
|
|
2572
|
-
self.assertEqual(orig, derived)
|
|
2573
|
-
|
|
2574
|
-
def test_bool(self):
|
|
2575
|
-
# time is always True.
|
|
2576
|
-
cls = self.theclass
|
|
2577
|
-
self.assertTrue(cls(1))
|
|
2578
|
-
self.assertTrue(cls(0, 1))
|
|
2579
|
-
self.assertTrue(cls(0, 0, 1))
|
|
2580
|
-
self.assertTrue(cls(0, 0, 0, 1))
|
|
2581
|
-
self.assertTrue(cls(0))
|
|
2582
|
-
self.assertTrue(cls())
|
|
2583
|
-
|
|
2584
|
-
def test_replace(self):
|
|
2585
|
-
cls = self.theclass
|
|
2586
|
-
args = [1, 2, 3, 4]
|
|
2587
|
-
base = cls(*args)
|
|
2588
|
-
self.assertEqual(base, base.replace())
|
|
2589
|
-
|
|
2590
|
-
i = 0
|
|
2591
|
-
for name, newval in (("hour", 5),
|
|
2592
|
-
("minute", 6),
|
|
2593
|
-
("second", 7),
|
|
2594
|
-
("microsecond", 8)):
|
|
2595
|
-
newargs = args[:]
|
|
2596
|
-
newargs[i] = newval
|
|
2597
|
-
expected = cls(*newargs)
|
|
2598
|
-
got = base.replace(**{name: newval})
|
|
2599
|
-
self.assertEqual(expected, got)
|
|
2600
|
-
i += 1
|
|
2601
|
-
|
|
2602
|
-
# Out of bounds.
|
|
2603
|
-
base = cls(1)
|
|
2604
|
-
self.assertRaises(ValueError, base.replace, hour=24)
|
|
2605
|
-
self.assertRaises(ValueError, base.replace, minute=-1)
|
|
2606
|
-
self.assertRaises(ValueError, base.replace, second=100)
|
|
2607
|
-
self.assertRaises(ValueError, base.replace, microsecond=1000000)
|
|
2608
|
-
|
|
2609
|
-
def test_subclass_replace(self):
|
|
2610
|
-
class TimeSubclass(self.theclass):
|
|
2611
|
-
pass
|
|
2612
|
-
|
|
2613
|
-
ctime = TimeSubclass(12, 30)
|
|
2614
|
-
self.assertIs(type(ctime.replace(hour=10)), TimeSubclass)
|
|
2615
|
-
|
|
2616
|
-
def test_subclass_time(self):
|
|
2617
|
-
|
|
2618
|
-
class C(self.theclass):
|
|
2619
|
-
theAnswer = 42
|
|
2620
|
-
|
|
2621
|
-
def __new__(cls, *args, **kws):
|
|
2622
|
-
temp = kws.copy()
|
|
2623
|
-
extra = temp.pop('extra')
|
|
2624
|
-
result = self.theclass.__new__(cls, *args, **temp)
|
|
2625
|
-
result.extra = extra
|
|
2626
|
-
return result
|
|
2627
|
-
|
|
2628
|
-
def newmeth(self, start):
|
|
2629
|
-
return start + self.hour + self.second
|
|
2630
|
-
|
|
2631
|
-
args = 4, 5, 6
|
|
2632
|
-
|
|
2633
|
-
dt1 = self.theclass(*args)
|
|
2634
|
-
dt2 = C(*args, **{'extra': 7})
|
|
2635
|
-
|
|
2636
|
-
self.assertEqual(dt2.__class__, C)
|
|
2637
|
-
self.assertEqual(dt2.theAnswer, 42)
|
|
2638
|
-
self.assertEqual(dt2.extra, 7)
|
|
2639
|
-
self.assertEqual(dt1.isoformat(), dt2.isoformat())
|
|
2640
|
-
self.assertEqual(dt2.newmeth(-7), dt1.hour + dt1.second - 7)
|
|
2641
|
-
|
|
2642
|
-
def test_backdoor_resistance(self):
|
|
2643
|
-
# see TestDate.test_backdoor_resistance().
|
|
2644
|
-
base = '2:59.0'
|
|
2645
|
-
for hour_byte in ' ', '9', chr(24), '\xff':
|
|
2646
|
-
self.assertRaises(TypeError, self.theclass,
|
|
2647
|
-
hour_byte + base[1:])
|
|
2648
|
-
# Good bytes, but bad tzinfo:
|
|
2649
|
-
with self.assertRaisesRegex(TypeError, '^bad tzinfo state arg$'):
|
|
2650
|
-
self.theclass(bytes([1] * len(base)), 'EST')
|
|
2651
|
-
|
|
2652
|
-
# A mixin for classes with a tzinfo= argument. Subclasses must define
|
|
2653
|
-
# theclass as a class attribute, and theclass(1, 1, 1, tzinfo=whatever)
|
|
2654
|
-
# must be legit (which is true for time and datetime).
|
|
2655
|
-
class TZInfoBase:
|
|
2656
|
-
|
|
2657
|
-
def test_argument_passing(self):
|
|
2658
|
-
cls = self.theclass
|
|
2659
|
-
# A datetime passes itself on, a time passes None.
|
|
2660
|
-
class introspective(tzinfo):
|
|
2661
|
-
def tzname(self, dt): return dt and "real" or "none"
|
|
2662
|
-
def utcoffset(self, dt):
|
|
2663
|
-
return timedelta(minutes = dt and 42 or -42)
|
|
2664
|
-
dst = utcoffset
|
|
2665
|
-
|
|
2666
|
-
obj = cls(1, 2, 3, tzinfo=introspective())
|
|
2667
|
-
|
|
2668
|
-
expected = cls is time and "none" or "real"
|
|
2669
|
-
self.assertEqual(obj.tzname(), expected)
|
|
2670
|
-
|
|
2671
|
-
expected = timedelta(minutes=(cls is time and -42 or 42))
|
|
2672
|
-
self.assertEqual(obj.utcoffset(), expected)
|
|
2673
|
-
self.assertEqual(obj.dst(), expected)
|
|
2674
|
-
|
|
2675
|
-
def test_bad_tzinfo_classes(self):
|
|
2676
|
-
cls = self.theclass
|
|
2677
|
-
self.assertRaises(TypeError, cls, 1, 1, 1, tzinfo=12)
|
|
2678
|
-
|
|
2679
|
-
class NiceTry(object):
|
|
2680
|
-
def __init__(self): pass
|
|
2681
|
-
def utcoffset(self, dt): pass
|
|
2682
|
-
self.assertRaises(TypeError, cls, 1, 1, 1, tzinfo=NiceTry)
|
|
2683
|
-
|
|
2684
|
-
class BetterTry(tzinfo):
|
|
2685
|
-
def __init__(self): pass
|
|
2686
|
-
def utcoffset(self, dt): pass
|
|
2687
|
-
b = BetterTry()
|
|
2688
|
-
t = cls(1, 1, 1, tzinfo=b)
|
|
2689
|
-
self.assertIs(t.tzinfo, b)
|
|
2690
|
-
|
|
2691
|
-
def test_utc_offset_out_of_bounds(self):
|
|
2692
|
-
class Edgy(tzinfo):
|
|
2693
|
-
def __init__(self, offset):
|
|
2694
|
-
self.offset = timedelta(minutes=offset)
|
|
2695
|
-
def utcoffset(self, dt):
|
|
2696
|
-
return self.offset
|
|
2697
|
-
|
|
2698
|
-
cls = self.theclass
|
|
2699
|
-
for offset, legit in ((-1440, False),
|
|
2700
|
-
(-1439, True),
|
|
2701
|
-
(1439, True),
|
|
2702
|
-
(1440, False)):
|
|
2703
|
-
if cls is time:
|
|
2704
|
-
t = cls(1, 2, 3, tzinfo=Edgy(offset))
|
|
2705
|
-
elif cls is datetime:
|
|
2706
|
-
t = cls(6, 6, 6, 1, 2, 3, tzinfo=Edgy(offset))
|
|
2707
|
-
else:
|
|
2708
|
-
assert 0, "impossible"
|
|
2709
|
-
if legit:
|
|
2710
|
-
aofs = abs(offset)
|
|
2711
|
-
h, m = divmod(aofs, 60)
|
|
2712
|
-
tag = "%c%02d:%02d" % (offset < 0 and '-' or '+', h, m)
|
|
2713
|
-
if isinstance(t, datetime):
|
|
2714
|
-
t = t.timetz()
|
|
2715
|
-
self.assertEqual(str(t), "01:02:03" + tag)
|
|
2716
|
-
else:
|
|
2717
|
-
self.assertRaises(ValueError, str, t)
|
|
2718
|
-
|
|
2719
|
-
def test_tzinfo_classes(self):
|
|
2720
|
-
cls = self.theclass
|
|
2721
|
-
class C1(tzinfo):
|
|
2722
|
-
def utcoffset(self, dt): return None
|
|
2723
|
-
def dst(self, dt): return None
|
|
2724
|
-
def tzname(self, dt): return None
|
|
2725
|
-
for t in (cls(1, 1, 1),
|
|
2726
|
-
cls(1, 1, 1, tzinfo=None),
|
|
2727
|
-
cls(1, 1, 1, tzinfo=C1())):
|
|
2728
|
-
self.assertIsNone(t.utcoffset())
|
|
2729
|
-
self.assertIsNone(t.dst())
|
|
2730
|
-
self.assertIsNone(t.tzname())
|
|
2731
|
-
|
|
2732
|
-
class C3(tzinfo):
|
|
2733
|
-
def utcoffset(self, dt): return timedelta(minutes=-1439)
|
|
2734
|
-
def dst(self, dt): return timedelta(minutes=1439)
|
|
2735
|
-
def tzname(self, dt): return "aname"
|
|
2736
|
-
t = cls(1, 1, 1, tzinfo=C3())
|
|
2737
|
-
self.assertEqual(t.utcoffset(), timedelta(minutes=-1439))
|
|
2738
|
-
self.assertEqual(t.dst(), timedelta(minutes=1439))
|
|
2739
|
-
self.assertEqual(t.tzname(), "aname")
|
|
2740
|
-
|
|
2741
|
-
# Wrong types.
|
|
2742
|
-
class C4(tzinfo):
|
|
2743
|
-
def utcoffset(self, dt): return "aname"
|
|
2744
|
-
def dst(self, dt): return 7
|
|
2745
|
-
def tzname(self, dt): return 0
|
|
2746
|
-
t = cls(1, 1, 1, tzinfo=C4())
|
|
2747
|
-
self.assertRaises(TypeError, t.utcoffset)
|
|
2748
|
-
self.assertRaises(TypeError, t.dst)
|
|
2749
|
-
self.assertRaises(TypeError, t.tzname)
|
|
2750
|
-
|
|
2751
|
-
# Offset out of range.
|
|
2752
|
-
class C6(tzinfo):
|
|
2753
|
-
def utcoffset(self, dt): return timedelta(hours=-24)
|
|
2754
|
-
def dst(self, dt): return timedelta(hours=24)
|
|
2755
|
-
t = cls(1, 1, 1, tzinfo=C6())
|
|
2756
|
-
self.assertRaises(ValueError, t.utcoffset)
|
|
2757
|
-
self.assertRaises(ValueError, t.dst)
|
|
2758
|
-
|
|
2759
|
-
# Not a whole number of seconds.
|
|
2760
|
-
class C7(tzinfo):
|
|
2761
|
-
def utcoffset(self, dt): return timedelta(microseconds=61)
|
|
2762
|
-
def dst(self, dt): return timedelta(microseconds=-81)
|
|
2763
|
-
t = cls(1, 1, 1, tzinfo=C7())
|
|
2764
|
-
self.assertRaises(ValueError, t.utcoffset)
|
|
2765
|
-
self.assertRaises(ValueError, t.dst)
|
|
2766
|
-
|
|
2767
|
-
def test_aware_compare(self):
|
|
2768
|
-
cls = self.theclass
|
|
2769
|
-
|
|
2770
|
-
# Ensure that utcoffset() gets ignored if the comparands have
|
|
2771
|
-
# the same tzinfo member.
|
|
2772
|
-
class OperandDependentOffset(tzinfo):
|
|
2773
|
-
def utcoffset(self, t):
|
|
2774
|
-
if t.minute < 10:
|
|
2775
|
-
# d0 and d1 equal after adjustment
|
|
2776
|
-
return timedelta(minutes=t.minute)
|
|
2777
|
-
else:
|
|
2778
|
-
# d2 off in the weeds
|
|
2779
|
-
return timedelta(minutes=59)
|
|
2780
|
-
|
|
2781
|
-
base = cls(8, 9, 10, tzinfo=OperandDependentOffset())
|
|
2782
|
-
d0 = base.replace(minute=3)
|
|
2783
|
-
d1 = base.replace(minute=9)
|
|
2784
|
-
d2 = base.replace(minute=11)
|
|
2785
|
-
for x in d0, d1, d2:
|
|
2786
|
-
for y in d0, d1, d2:
|
|
2787
|
-
for op in lt, le, gt, ge, eq, ne:
|
|
2788
|
-
got = op(x, y)
|
|
2789
|
-
expected = op(x.minute, y.minute)
|
|
2790
|
-
self.assertEqual(got, expected)
|
|
2791
|
-
|
|
2792
|
-
# However, if they're different members, uctoffset is not ignored.
|
|
2793
|
-
# Note that a time can't actually have an operand-depedent offset,
|
|
2794
|
-
# though (and time.utcoffset() passes None to tzinfo.utcoffset()),
|
|
2795
|
-
# so skip this test for time.
|
|
2796
|
-
if cls is not time:
|
|
2797
|
-
d0 = base.replace(minute=3, tzinfo=OperandDependentOffset())
|
|
2798
|
-
d1 = base.replace(minute=9, tzinfo=OperandDependentOffset())
|
|
2799
|
-
d2 = base.replace(minute=11, tzinfo=OperandDependentOffset())
|
|
2800
|
-
for x in d0, d1, d2:
|
|
2801
|
-
for y in d0, d1, d2:
|
|
2802
|
-
got = (x > y) - (x < y)
|
|
2803
|
-
if (x is d0 or x is d1) and (y is d0 or y is d1):
|
|
2804
|
-
expected = 0
|
|
2805
|
-
elif x is y is d2:
|
|
2806
|
-
expected = 0
|
|
2807
|
-
elif x is d2:
|
|
2808
|
-
expected = -1
|
|
2809
|
-
else:
|
|
2810
|
-
assert y is d2
|
|
2811
|
-
expected = 1
|
|
2812
|
-
self.assertEqual(got, expected)
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
# Testing time objects with a non-None tzinfo.
|
|
2816
|
-
class TestTimeTZ(TestTime, TZInfoBase, unittest.TestCase):
|
|
2817
|
-
theclass = time
|
|
2818
|
-
|
|
2819
|
-
def test_empty(self):
|
|
2820
|
-
t = self.theclass()
|
|
2821
|
-
self.assertEqual(t.hour, 0)
|
|
2822
|
-
self.assertEqual(t.minute, 0)
|
|
2823
|
-
self.assertEqual(t.second, 0)
|
|
2824
|
-
self.assertEqual(t.microsecond, 0)
|
|
2825
|
-
self.assertIsNone(t.tzinfo)
|
|
2826
|
-
|
|
2827
|
-
def test_zones(self):
|
|
2828
|
-
est = FixedOffset(-300, "EST", 1)
|
|
2829
|
-
utc = FixedOffset(0, "UTC", -2)
|
|
2830
|
-
met = FixedOffset(60, "MET", 3)
|
|
2831
|
-
t1 = time( 7, 47, tzinfo=est)
|
|
2832
|
-
t2 = time(12, 47, tzinfo=utc)
|
|
2833
|
-
t3 = time(13, 47, tzinfo=met)
|
|
2834
|
-
t4 = time(microsecond=40)
|
|
2835
|
-
t5 = time(microsecond=40, tzinfo=utc)
|
|
2836
|
-
|
|
2837
|
-
self.assertEqual(t1.tzinfo, est)
|
|
2838
|
-
self.assertEqual(t2.tzinfo, utc)
|
|
2839
|
-
self.assertEqual(t3.tzinfo, met)
|
|
2840
|
-
self.assertIsNone(t4.tzinfo)
|
|
2841
|
-
self.assertEqual(t5.tzinfo, utc)
|
|
2842
|
-
|
|
2843
|
-
self.assertEqual(t1.utcoffset(), timedelta(minutes=-300))
|
|
2844
|
-
self.assertEqual(t2.utcoffset(), timedelta(minutes=0))
|
|
2845
|
-
self.assertEqual(t3.utcoffset(), timedelta(minutes=60))
|
|
2846
|
-
self.assertIsNone(t4.utcoffset())
|
|
2847
|
-
self.assertRaises(TypeError, t1.utcoffset, "no args")
|
|
2848
|
-
|
|
2849
|
-
self.assertEqual(t1.tzname(), "EST")
|
|
2850
|
-
self.assertEqual(t2.tzname(), "UTC")
|
|
2851
|
-
self.assertEqual(t3.tzname(), "MET")
|
|
2852
|
-
self.assertIsNone(t4.tzname())
|
|
2853
|
-
self.assertRaises(TypeError, t1.tzname, "no args")
|
|
2854
|
-
|
|
2855
|
-
self.assertEqual(t1.dst(), timedelta(minutes=1))
|
|
2856
|
-
self.assertEqual(t2.dst(), timedelta(minutes=-2))
|
|
2857
|
-
self.assertEqual(t3.dst(), timedelta(minutes=3))
|
|
2858
|
-
self.assertIsNone(t4.dst())
|
|
2859
|
-
self.assertRaises(TypeError, t1.dst, "no args")
|
|
2860
|
-
|
|
2861
|
-
self.assertEqual(hash(t1), hash(t2))
|
|
2862
|
-
self.assertEqual(hash(t1), hash(t3))
|
|
2863
|
-
self.assertEqual(hash(t2), hash(t3))
|
|
2864
|
-
|
|
2865
|
-
self.assertEqual(t1, t2)
|
|
2866
|
-
self.assertEqual(t1, t3)
|
|
2867
|
-
self.assertEqual(t2, t3)
|
|
2868
|
-
self.assertNotEqual(t4, t5) # mixed tz-aware & naive
|
|
2869
|
-
self.assertRaises(TypeError, lambda: t4 < t5) # mixed tz-aware & naive
|
|
2870
|
-
self.assertRaises(TypeError, lambda: t5 < t4) # mixed tz-aware & naive
|
|
2871
|
-
|
|
2872
|
-
self.assertEqual(str(t1), "07:47:00-05:00")
|
|
2873
|
-
self.assertEqual(str(t2), "12:47:00+00:00")
|
|
2874
|
-
self.assertEqual(str(t3), "13:47:00+01:00")
|
|
2875
|
-
self.assertEqual(str(t4), "00:00:00.000040")
|
|
2876
|
-
self.assertEqual(str(t5), "00:00:00.000040+00:00")
|
|
2877
|
-
|
|
2878
|
-
self.assertEqual(t1.isoformat(), "07:47:00-05:00")
|
|
2879
|
-
self.assertEqual(t2.isoformat(), "12:47:00+00:00")
|
|
2880
|
-
self.assertEqual(t3.isoformat(), "13:47:00+01:00")
|
|
2881
|
-
self.assertEqual(t4.isoformat(), "00:00:00.000040")
|
|
2882
|
-
self.assertEqual(t5.isoformat(), "00:00:00.000040+00:00")
|
|
2883
|
-
|
|
2884
|
-
d = 'datetime.time'
|
|
2885
|
-
self.assertEqual(repr(t1), d + "(7, 47, tzinfo=est)")
|
|
2886
|
-
self.assertEqual(repr(t2), d + "(12, 47, tzinfo=utc)")
|
|
2887
|
-
self.assertEqual(repr(t3), d + "(13, 47, tzinfo=met)")
|
|
2888
|
-
self.assertEqual(repr(t4), d + "(0, 0, 0, 40)")
|
|
2889
|
-
self.assertEqual(repr(t5), d + "(0, 0, 0, 40, tzinfo=utc)")
|
|
2890
|
-
|
|
2891
|
-
self.assertEqual(t1.strftime("%H:%M:%S %%Z=%Z %%z=%z"),
|
|
2892
|
-
"07:47:00 %Z=EST %z=-0500")
|
|
2893
|
-
self.assertEqual(t2.strftime("%H:%M:%S %Z %z"), "12:47:00 UTC +0000")
|
|
2894
|
-
self.assertEqual(t3.strftime("%H:%M:%S %Z %z"), "13:47:00 MET +0100")
|
|
2895
|
-
|
|
2896
|
-
yuck = FixedOffset(-1439, "%z %Z %%z%%Z")
|
|
2897
|
-
t1 = time(23, 59, tzinfo=yuck)
|
|
2898
|
-
self.assertEqual(t1.strftime("%H:%M %%Z='%Z' %%z='%z'"),
|
|
2899
|
-
"23:59 %Z='%z %Z %%z%%Z' %z='-2359'")
|
|
2900
|
-
|
|
2901
|
-
# Check that an invalid tzname result raises an exception.
|
|
2902
|
-
class Badtzname(tzinfo):
|
|
2903
|
-
tz = 42
|
|
2904
|
-
def tzname(self, dt): return self.tz
|
|
2905
|
-
t = time(2, 3, 4, tzinfo=Badtzname())
|
|
2906
|
-
self.assertEqual(t.strftime("%H:%M:%S"), "02:03:04")
|
|
2907
|
-
self.assertRaises(TypeError, t.strftime, "%Z")
|
|
2908
|
-
|
|
2909
|
-
# Issue #6697:
|
|
2910
|
-
if '_Fast' in self.__class__.__name__:
|
|
2911
|
-
Badtzname.tz = '\ud800'
|
|
2912
|
-
self.assertRaises(ValueError, t.strftime, "%Z")
|
|
2913
|
-
|
|
2914
|
-
def test_hash_edge_cases(self):
|
|
2915
|
-
# Offsets that overflow a basic time.
|
|
2916
|
-
t1 = self.theclass(0, 1, 2, 3, tzinfo=FixedOffset(1439, ""))
|
|
2917
|
-
t2 = self.theclass(0, 0, 2, 3, tzinfo=FixedOffset(1438, ""))
|
|
2918
|
-
self.assertEqual(hash(t1), hash(t2))
|
|
2919
|
-
|
|
2920
|
-
t1 = self.theclass(23, 58, 6, 100, tzinfo=FixedOffset(-1000, ""))
|
|
2921
|
-
t2 = self.theclass(23, 48, 6, 100, tzinfo=FixedOffset(-1010, ""))
|
|
2922
|
-
self.assertEqual(hash(t1), hash(t2))
|
|
2923
|
-
|
|
2924
|
-
def test_pickling(self):
|
|
2925
|
-
# Try one without a tzinfo.
|
|
2926
|
-
args = 20, 59, 16, 64**2
|
|
2927
|
-
orig = self.theclass(*args)
|
|
2928
|
-
for pickler, unpickler, proto in pickle_choices:
|
|
2929
|
-
green = pickler.dumps(orig, proto)
|
|
2930
|
-
derived = unpickler.loads(green)
|
|
2931
|
-
self.assertEqual(orig, derived)
|
|
2932
|
-
self.assertEqual(orig.__reduce__(), orig.__reduce_ex__(2))
|
|
2933
|
-
|
|
2934
|
-
# Try one with a tzinfo.
|
|
2935
|
-
tinfo = PicklableFixedOffset(-300, 'cookie')
|
|
2936
|
-
orig = self.theclass(5, 6, 7, tzinfo=tinfo)
|
|
2937
|
-
for pickler, unpickler, proto in pickle_choices:
|
|
2938
|
-
green = pickler.dumps(orig, proto)
|
|
2939
|
-
derived = unpickler.loads(green)
|
|
2940
|
-
self.assertEqual(orig, derived)
|
|
2941
|
-
self.assertIsInstance(derived.tzinfo, PicklableFixedOffset)
|
|
2942
|
-
self.assertEqual(derived.utcoffset(), timedelta(minutes=-300))
|
|
2943
|
-
self.assertEqual(derived.tzname(), 'cookie')
|
|
2944
|
-
self.assertEqual(orig.__reduce__(), orig.__reduce_ex__(2))
|
|
2945
|
-
|
|
2946
|
-
def test_more_bool(self):
|
|
2947
|
-
# time is always True.
|
|
2948
|
-
cls = self.theclass
|
|
2949
|
-
|
|
2950
|
-
t = cls(0, tzinfo=FixedOffset(-300, ""))
|
|
2951
|
-
self.assertTrue(t)
|
|
2952
|
-
|
|
2953
|
-
t = cls(5, tzinfo=FixedOffset(-300, ""))
|
|
2954
|
-
self.assertTrue(t)
|
|
2955
|
-
|
|
2956
|
-
t = cls(5, tzinfo=FixedOffset(300, ""))
|
|
2957
|
-
self.assertTrue(t)
|
|
2958
|
-
|
|
2959
|
-
t = cls(23, 59, tzinfo=FixedOffset(23*60 + 59, ""))
|
|
2960
|
-
self.assertTrue(t)
|
|
2961
|
-
|
|
2962
|
-
def test_replace(self):
|
|
2963
|
-
cls = self.theclass
|
|
2964
|
-
z100 = FixedOffset(100, "+100")
|
|
2965
|
-
zm200 = FixedOffset(timedelta(minutes=-200), "-200")
|
|
2966
|
-
args = [1, 2, 3, 4, z100]
|
|
2967
|
-
base = cls(*args)
|
|
2968
|
-
self.assertEqual(base, base.replace())
|
|
2969
|
-
|
|
2970
|
-
i = 0
|
|
2971
|
-
for name, newval in (("hour", 5),
|
|
2972
|
-
("minute", 6),
|
|
2973
|
-
("second", 7),
|
|
2974
|
-
("microsecond", 8),
|
|
2975
|
-
("tzinfo", zm200)):
|
|
2976
|
-
newargs = args[:]
|
|
2977
|
-
newargs[i] = newval
|
|
2978
|
-
expected = cls(*newargs)
|
|
2979
|
-
got = base.replace(**{name: newval})
|
|
2980
|
-
self.assertEqual(expected, got)
|
|
2981
|
-
i += 1
|
|
2982
|
-
|
|
2983
|
-
# Ensure we can get rid of a tzinfo.
|
|
2984
|
-
self.assertEqual(base.tzname(), "+100")
|
|
2985
|
-
base2 = base.replace(tzinfo=None)
|
|
2986
|
-
self.assertIsNone(base2.tzinfo)
|
|
2987
|
-
self.assertIsNone(base2.tzname())
|
|
2988
|
-
|
|
2989
|
-
# Ensure we can add one.
|
|
2990
|
-
base3 = base2.replace(tzinfo=z100)
|
|
2991
|
-
self.assertEqual(base, base3)
|
|
2992
|
-
self.assertIs(base.tzinfo, base3.tzinfo)
|
|
2993
|
-
|
|
2994
|
-
# Out of bounds.
|
|
2995
|
-
base = cls(1)
|
|
2996
|
-
self.assertRaises(ValueError, base.replace, hour=24)
|
|
2997
|
-
self.assertRaises(ValueError, base.replace, minute=-1)
|
|
2998
|
-
self.assertRaises(ValueError, base.replace, second=100)
|
|
2999
|
-
self.assertRaises(ValueError, base.replace, microsecond=1000000)
|
|
3000
|
-
|
|
3001
|
-
def test_mixed_compare(self):
|
|
3002
|
-
t1 = time(1, 2, 3)
|
|
3003
|
-
t2 = time(1, 2, 3)
|
|
3004
|
-
self.assertEqual(t1, t2)
|
|
3005
|
-
t2 = t2.replace(tzinfo=None)
|
|
3006
|
-
self.assertEqual(t1, t2)
|
|
3007
|
-
t2 = t2.replace(tzinfo=FixedOffset(None, ""))
|
|
3008
|
-
self.assertEqual(t1, t2)
|
|
3009
|
-
t2 = t2.replace(tzinfo=FixedOffset(0, ""))
|
|
3010
|
-
self.assertNotEqual(t1, t2)
|
|
3011
|
-
|
|
3012
|
-
# In time w/ identical tzinfo objects, utcoffset is ignored.
|
|
3013
|
-
class Varies(tzinfo):
|
|
3014
|
-
def __init__(self):
|
|
3015
|
-
self.offset = timedelta(minutes=22)
|
|
3016
|
-
def utcoffset(self, t):
|
|
3017
|
-
self.offset += timedelta(minutes=1)
|
|
3018
|
-
return self.offset
|
|
3019
|
-
|
|
3020
|
-
v = Varies()
|
|
3021
|
-
t1 = t2.replace(tzinfo=v)
|
|
3022
|
-
t2 = t2.replace(tzinfo=v)
|
|
3023
|
-
self.assertEqual(t1.utcoffset(), timedelta(minutes=23))
|
|
3024
|
-
self.assertEqual(t2.utcoffset(), timedelta(minutes=24))
|
|
3025
|
-
self.assertEqual(t1, t2)
|
|
3026
|
-
|
|
3027
|
-
# But if they're not identical, it isn't ignored.
|
|
3028
|
-
t2 = t2.replace(tzinfo=Varies())
|
|
3029
|
-
self.assertTrue(t1 < t2) # t1's offset counter still going up
|
|
3030
|
-
|
|
3031
|
-
def test_subclass_timetz(self):
|
|
3032
|
-
|
|
3033
|
-
class C(self.theclass):
|
|
3034
|
-
theAnswer = 42
|
|
3035
|
-
|
|
3036
|
-
def __new__(cls, *args, **kws):
|
|
3037
|
-
temp = kws.copy()
|
|
3038
|
-
extra = temp.pop('extra')
|
|
3039
|
-
result = self.theclass.__new__(cls, *args, **temp)
|
|
3040
|
-
result.extra = extra
|
|
3041
|
-
return result
|
|
3042
|
-
|
|
3043
|
-
def newmeth(self, start):
|
|
3044
|
-
return start + self.hour + self.second
|
|
3045
|
-
|
|
3046
|
-
args = 4, 5, 6, 500, FixedOffset(-300, "EST", 1)
|
|
3047
|
-
|
|
3048
|
-
dt1 = self.theclass(*args)
|
|
3049
|
-
dt2 = C(*args, **{'extra': 7})
|
|
3050
|
-
|
|
3051
|
-
self.assertEqual(dt2.__class__, C)
|
|
3052
|
-
self.assertEqual(dt2.theAnswer, 42)
|
|
3053
|
-
self.assertEqual(dt2.extra, 7)
|
|
3054
|
-
self.assertEqual(dt1.utcoffset(), dt2.utcoffset())
|
|
3055
|
-
self.assertEqual(dt2.newmeth(-7), dt1.hour + dt1.second - 7)
|
|
3056
|
-
|
|
3057
|
-
|
|
3058
|
-
# Testing datetime objects with a non-None tzinfo.
|
|
3059
|
-
|
|
3060
|
-
class TestDateTimeTZ(TestDateTime, TZInfoBase, unittest.TestCase):
|
|
3061
|
-
theclass = datetime
|
|
3062
|
-
|
|
3063
|
-
def test_trivial(self):
|
|
3064
|
-
dt = self.theclass(1, 2, 3, 4, 5, 6, 7)
|
|
3065
|
-
self.assertEqual(dt.year, 1)
|
|
3066
|
-
self.assertEqual(dt.month, 2)
|
|
3067
|
-
self.assertEqual(dt.day, 3)
|
|
3068
|
-
self.assertEqual(dt.hour, 4)
|
|
3069
|
-
self.assertEqual(dt.minute, 5)
|
|
3070
|
-
self.assertEqual(dt.second, 6)
|
|
3071
|
-
self.assertEqual(dt.microsecond, 7)
|
|
3072
|
-
self.assertEqual(dt.tzinfo, None)
|
|
3073
|
-
|
|
3074
|
-
def test_even_more_compare(self):
|
|
3075
|
-
# The test_compare() and test_more_compare() inherited from TestDate
|
|
3076
|
-
# and TestDateTime covered non-tzinfo cases.
|
|
3077
|
-
|
|
3078
|
-
# Smallest possible after UTC adjustment.
|
|
3079
|
-
t1 = self.theclass(1, 1, 1, tzinfo=FixedOffset(1439, ""))
|
|
3080
|
-
# Largest possible after UTC adjustment.
|
|
3081
|
-
t2 = self.theclass(MAXYEAR, 12, 31, 23, 59, 59, 999999,
|
|
3082
|
-
tzinfo=FixedOffset(-1439, ""))
|
|
3083
|
-
|
|
3084
|
-
# Make sure those compare correctly, and w/o overflow.
|
|
3085
|
-
self.assertTrue(t1 < t2)
|
|
3086
|
-
self.assertTrue(t1 != t2)
|
|
3087
|
-
self.assertTrue(t2 > t1)
|
|
3088
|
-
|
|
3089
|
-
self.assertEqual(t1, t1)
|
|
3090
|
-
self.assertEqual(t2, t2)
|
|
3091
|
-
|
|
3092
|
-
# Equal afer adjustment.
|
|
3093
|
-
t1 = self.theclass(1, 12, 31, 23, 59, tzinfo=FixedOffset(1, ""))
|
|
3094
|
-
t2 = self.theclass(2, 1, 1, 3, 13, tzinfo=FixedOffset(3*60+13+2, ""))
|
|
3095
|
-
self.assertEqual(t1, t2)
|
|
3096
|
-
|
|
3097
|
-
# Change t1 not to subtract a minute, and t1 should be larger.
|
|
3098
|
-
t1 = self.theclass(1, 12, 31, 23, 59, tzinfo=FixedOffset(0, ""))
|
|
3099
|
-
self.assertTrue(t1 > t2)
|
|
3100
|
-
|
|
3101
|
-
# Change t1 to subtract 2 minutes, and t1 should be smaller.
|
|
3102
|
-
t1 = self.theclass(1, 12, 31, 23, 59, tzinfo=FixedOffset(2, ""))
|
|
3103
|
-
self.assertTrue(t1 < t2)
|
|
3104
|
-
|
|
3105
|
-
# Back to the original t1, but make seconds resolve it.
|
|
3106
|
-
t1 = self.theclass(1, 12, 31, 23, 59, tzinfo=FixedOffset(1, ""),
|
|
3107
|
-
second=1)
|
|
3108
|
-
self.assertTrue(t1 > t2)
|
|
3109
|
-
|
|
3110
|
-
# Likewise, but make microseconds resolve it.
|
|
3111
|
-
t1 = self.theclass(1, 12, 31, 23, 59, tzinfo=FixedOffset(1, ""),
|
|
3112
|
-
microsecond=1)
|
|
3113
|
-
self.assertTrue(t1 > t2)
|
|
3114
|
-
|
|
3115
|
-
# Make t2 naive and it should differ.
|
|
3116
|
-
t2 = self.theclass.min
|
|
3117
|
-
self.assertNotEqual(t1, t2)
|
|
3118
|
-
self.assertEqual(t2, t2)
|
|
3119
|
-
|
|
3120
|
-
# It's also naive if it has tzinfo but tzinfo.utcoffset() is None.
|
|
3121
|
-
class Naive(tzinfo):
|
|
3122
|
-
def utcoffset(self, dt): return None
|
|
3123
|
-
t2 = self.theclass(5, 6, 7, tzinfo=Naive())
|
|
3124
|
-
self.assertNotEqual(t1, t2)
|
|
3125
|
-
self.assertEqual(t2, t2)
|
|
3126
|
-
|
|
3127
|
-
# OTOH, it's OK to compare two of these mixing the two ways of being
|
|
3128
|
-
# naive.
|
|
3129
|
-
t1 = self.theclass(5, 6, 7)
|
|
3130
|
-
self.assertEqual(t1, t2)
|
|
3131
|
-
|
|
3132
|
-
# Try a bogus uctoffset.
|
|
3133
|
-
class Bogus(tzinfo):
|
|
3134
|
-
def utcoffset(self, dt):
|
|
3135
|
-
return timedelta(minutes=1440) # out of bounds
|
|
3136
|
-
t1 = self.theclass(2, 2, 2, tzinfo=Bogus())
|
|
3137
|
-
t2 = self.theclass(2, 2, 2, tzinfo=FixedOffset(0, ""))
|
|
3138
|
-
self.assertRaises(ValueError, lambda: t1 == t2)
|
|
3139
|
-
|
|
3140
|
-
def test_pickling(self):
|
|
3141
|
-
# Try one without a tzinfo.
|
|
3142
|
-
args = 6, 7, 23, 20, 59, 1, 64**2
|
|
3143
|
-
orig = self.theclass(*args)
|
|
3144
|
-
for pickler, unpickler, proto in pickle_choices:
|
|
3145
|
-
green = pickler.dumps(orig, proto)
|
|
3146
|
-
derived = unpickler.loads(green)
|
|
3147
|
-
self.assertEqual(orig, derived)
|
|
3148
|
-
self.assertEqual(orig.__reduce__(), orig.__reduce_ex__(2))
|
|
3149
|
-
|
|
3150
|
-
# Try one with a tzinfo.
|
|
3151
|
-
tinfo = PicklableFixedOffset(-300, 'cookie')
|
|
3152
|
-
orig = self.theclass(*args, **{'tzinfo': tinfo})
|
|
3153
|
-
derived = self.theclass(1, 1, 1, tzinfo=FixedOffset(0, "", 0))
|
|
3154
|
-
for pickler, unpickler, proto in pickle_choices:
|
|
3155
|
-
green = pickler.dumps(orig, proto)
|
|
3156
|
-
derived = unpickler.loads(green)
|
|
3157
|
-
self.assertEqual(orig, derived)
|
|
3158
|
-
self.assertIsInstance(derived.tzinfo, PicklableFixedOffset)
|
|
3159
|
-
self.assertEqual(derived.utcoffset(), timedelta(minutes=-300))
|
|
3160
|
-
self.assertEqual(derived.tzname(), 'cookie')
|
|
3161
|
-
self.assertEqual(orig.__reduce__(), orig.__reduce_ex__(2))
|
|
3162
|
-
|
|
3163
|
-
def test_extreme_hashes(self):
|
|
3164
|
-
# If an attempt is made to hash these via subtracting the offset
|
|
3165
|
-
# then hashing a datetime object, OverflowError results. The
|
|
3166
|
-
# Python implementation used to blow up here.
|
|
3167
|
-
t = self.theclass(1, 1, 1, tzinfo=FixedOffset(1439, ""))
|
|
3168
|
-
hash(t)
|
|
3169
|
-
t = self.theclass(MAXYEAR, 12, 31, 23, 59, 59, 999999,
|
|
3170
|
-
tzinfo=FixedOffset(-1439, ""))
|
|
3171
|
-
hash(t)
|
|
3172
|
-
|
|
3173
|
-
# OTOH, an OOB offset should blow up.
|
|
3174
|
-
t = self.theclass(5, 5, 5, tzinfo=FixedOffset(-1440, ""))
|
|
3175
|
-
self.assertRaises(ValueError, hash, t)
|
|
3176
|
-
|
|
3177
|
-
def test_zones(self):
|
|
3178
|
-
est = FixedOffset(-300, "EST")
|
|
3179
|
-
utc = FixedOffset(0, "UTC")
|
|
3180
|
-
met = FixedOffset(60, "MET")
|
|
3181
|
-
t1 = datetime(2002, 3, 19, 7, 47, tzinfo=est)
|
|
3182
|
-
t2 = datetime(2002, 3, 19, 12, 47, tzinfo=utc)
|
|
3183
|
-
t3 = datetime(2002, 3, 19, 13, 47, tzinfo=met)
|
|
3184
|
-
self.assertEqual(t1.tzinfo, est)
|
|
3185
|
-
self.assertEqual(t2.tzinfo, utc)
|
|
3186
|
-
self.assertEqual(t3.tzinfo, met)
|
|
3187
|
-
self.assertEqual(t1.utcoffset(), timedelta(minutes=-300))
|
|
3188
|
-
self.assertEqual(t2.utcoffset(), timedelta(minutes=0))
|
|
3189
|
-
self.assertEqual(t3.utcoffset(), timedelta(minutes=60))
|
|
3190
|
-
self.assertEqual(t1.tzname(), "EST")
|
|
3191
|
-
self.assertEqual(t2.tzname(), "UTC")
|
|
3192
|
-
self.assertEqual(t3.tzname(), "MET")
|
|
3193
|
-
self.assertEqual(hash(t1), hash(t2))
|
|
3194
|
-
self.assertEqual(hash(t1), hash(t3))
|
|
3195
|
-
self.assertEqual(hash(t2), hash(t3))
|
|
3196
|
-
self.assertEqual(t1, t2)
|
|
3197
|
-
self.assertEqual(t1, t3)
|
|
3198
|
-
self.assertEqual(t2, t3)
|
|
3199
|
-
self.assertEqual(str(t1), "2002-03-19 07:47:00-05:00")
|
|
3200
|
-
self.assertEqual(str(t2), "2002-03-19 12:47:00+00:00")
|
|
3201
|
-
self.assertEqual(str(t3), "2002-03-19 13:47:00+01:00")
|
|
3202
|
-
d = 'datetime.datetime(2002, 3, 19, '
|
|
3203
|
-
self.assertEqual(repr(t1), d + "7, 47, tzinfo=est)")
|
|
3204
|
-
self.assertEqual(repr(t2), d + "12, 47, tzinfo=utc)")
|
|
3205
|
-
self.assertEqual(repr(t3), d + "13, 47, tzinfo=met)")
|
|
3206
|
-
|
|
3207
|
-
def test_combine(self):
|
|
3208
|
-
met = FixedOffset(60, "MET")
|
|
3209
|
-
d = date(2002, 3, 4)
|
|
3210
|
-
tz = time(18, 45, 3, 1234, tzinfo=met)
|
|
3211
|
-
dt = datetime.combine(d, tz)
|
|
3212
|
-
self.assertEqual(dt, datetime(2002, 3, 4, 18, 45, 3, 1234,
|
|
3213
|
-
tzinfo=met))
|
|
3214
|
-
|
|
3215
|
-
def test_extract(self):
|
|
3216
|
-
met = FixedOffset(60, "MET")
|
|
3217
|
-
dt = self.theclass(2002, 3, 4, 18, 45, 3, 1234, tzinfo=met)
|
|
3218
|
-
self.assertEqual(dt.date(), date(2002, 3, 4))
|
|
3219
|
-
self.assertEqual(dt.time(), time(18, 45, 3, 1234))
|
|
3220
|
-
self.assertEqual(dt.timetz(), time(18, 45, 3, 1234, tzinfo=met))
|
|
3221
|
-
|
|
3222
|
-
def test_tz_aware_arithmetic(self):
|
|
3223
|
-
import random
|
|
3224
|
-
|
|
3225
|
-
now = self.theclass.now()
|
|
3226
|
-
tz55 = FixedOffset(-330, "west 5:30")
|
|
3227
|
-
timeaware = now.time().replace(tzinfo=tz55)
|
|
3228
|
-
nowaware = self.theclass.combine(now.date(), timeaware)
|
|
3229
|
-
self.assertIs(nowaware.tzinfo, tz55)
|
|
3230
|
-
self.assertEqual(nowaware.timetz(), timeaware)
|
|
3231
|
-
|
|
3232
|
-
# Can't mix aware and non-aware.
|
|
3233
|
-
self.assertRaises(TypeError, lambda: now - nowaware)
|
|
3234
|
-
self.assertRaises(TypeError, lambda: nowaware - now)
|
|
3235
|
-
|
|
3236
|
-
# And adding datetime's doesn't make sense, aware or not.
|
|
3237
|
-
self.assertRaises(TypeError, lambda: now + nowaware)
|
|
3238
|
-
self.assertRaises(TypeError, lambda: nowaware + now)
|
|
3239
|
-
self.assertRaises(TypeError, lambda: nowaware + nowaware)
|
|
3240
|
-
|
|
3241
|
-
# Subtracting should yield 0.
|
|
3242
|
-
self.assertEqual(now - now, timedelta(0))
|
|
3243
|
-
self.assertEqual(nowaware - nowaware, timedelta(0))
|
|
3244
|
-
|
|
3245
|
-
# Adding a delta should preserve tzinfo.
|
|
3246
|
-
delta = timedelta(weeks=1, minutes=12, microseconds=5678)
|
|
3247
|
-
nowawareplus = nowaware + delta
|
|
3248
|
-
self.assertIs(nowaware.tzinfo, tz55)
|
|
3249
|
-
nowawareplus2 = delta + nowaware
|
|
3250
|
-
self.assertIs(nowawareplus2.tzinfo, tz55)
|
|
3251
|
-
self.assertEqual(nowawareplus, nowawareplus2)
|
|
3252
|
-
|
|
3253
|
-
# that - delta should be what we started with, and that - what we
|
|
3254
|
-
# started with should be delta.
|
|
3255
|
-
diff = nowawareplus - delta
|
|
3256
|
-
self.assertIs(diff.tzinfo, tz55)
|
|
3257
|
-
self.assertEqual(nowaware, diff)
|
|
3258
|
-
self.assertRaises(TypeError, lambda: delta - nowawareplus)
|
|
3259
|
-
self.assertEqual(nowawareplus - nowaware, delta)
|
|
3260
|
-
|
|
3261
|
-
# Make up a random timezone.
|
|
3262
|
-
tzr = FixedOffset(random.randrange(-1439, 1440), "randomtimezone")
|
|
3263
|
-
# Attach it to nowawareplus.
|
|
3264
|
-
nowawareplus = nowawareplus.replace(tzinfo=tzr)
|
|
3265
|
-
self.assertIs(nowawareplus.tzinfo, tzr)
|
|
3266
|
-
# Make sure the difference takes the timezone adjustments into account.
|
|
3267
|
-
got = nowaware - nowawareplus
|
|
3268
|
-
# Expected: (nowaware base - nowaware offset) -
|
|
3269
|
-
# (nowawareplus base - nowawareplus offset) =
|
|
3270
|
-
# (nowaware base - nowawareplus base) +
|
|
3271
|
-
# (nowawareplus offset - nowaware offset) =
|
|
3272
|
-
# -delta + nowawareplus offset - nowaware offset
|
|
3273
|
-
expected = nowawareplus.utcoffset() - nowaware.utcoffset() - delta
|
|
3274
|
-
self.assertEqual(got, expected)
|
|
3275
|
-
|
|
3276
|
-
# Try max possible difference.
|
|
3277
|
-
min = self.theclass(1, 1, 1, tzinfo=FixedOffset(1439, "min"))
|
|
3278
|
-
max = self.theclass(MAXYEAR, 12, 31, 23, 59, 59, 999999,
|
|
3279
|
-
tzinfo=FixedOffset(-1439, "max"))
|
|
3280
|
-
maxdiff = max - min
|
|
3281
|
-
self.assertEqual(maxdiff, self.theclass.max - self.theclass.min +
|
|
3282
|
-
timedelta(minutes=2*1439))
|
|
3283
|
-
# Different tzinfo, but the same offset
|
|
3284
|
-
tza = timezone(HOUR, 'A')
|
|
3285
|
-
tzb = timezone(HOUR, 'B')
|
|
3286
|
-
delta = min.replace(tzinfo=tza) - max.replace(tzinfo=tzb)
|
|
3287
|
-
self.assertEqual(delta, self.theclass.min - self.theclass.max)
|
|
3288
|
-
|
|
3289
|
-
def test_tzinfo_now(self):
|
|
3290
|
-
meth = self.theclass.now
|
|
3291
|
-
# Ensure it doesn't require tzinfo (i.e., that this doesn't blow up).
|
|
3292
|
-
base = meth()
|
|
3293
|
-
# Try with and without naming the keyword.
|
|
3294
|
-
off42 = FixedOffset(42, "42")
|
|
3295
|
-
another = meth(off42)
|
|
3296
|
-
again = meth(tz=off42)
|
|
3297
|
-
self.assertIs(another.tzinfo, again.tzinfo)
|
|
3298
|
-
self.assertEqual(another.utcoffset(), timedelta(minutes=42))
|
|
3299
|
-
# Bad argument with and w/o naming the keyword.
|
|
3300
|
-
self.assertRaises(TypeError, meth, 16)
|
|
3301
|
-
self.assertRaises(TypeError, meth, tzinfo=16)
|
|
3302
|
-
# Bad keyword name.
|
|
3303
|
-
self.assertRaises(TypeError, meth, tinfo=off42)
|
|
3304
|
-
# Too many args.
|
|
3305
|
-
self.assertRaises(TypeError, meth, off42, off42)
|
|
3306
|
-
|
|
3307
|
-
# We don't know which time zone we're in, and don't have a tzinfo
|
|
3308
|
-
# class to represent it, so seeing whether a tz argument actually
|
|
3309
|
-
# does a conversion is tricky.
|
|
3310
|
-
utc = FixedOffset(0, "utc", 0)
|
|
3311
|
-
for weirdtz in [FixedOffset(timedelta(hours=15, minutes=58), "weirdtz", 0),
|
|
3312
|
-
timezone(timedelta(hours=15, minutes=58), "weirdtz"),]:
|
|
3313
|
-
for dummy in range(3):
|
|
3314
|
-
now = datetime.now(weirdtz)
|
|
3315
|
-
self.assertIs(now.tzinfo, weirdtz)
|
|
3316
|
-
utcnow = datetime.utcnow().replace(tzinfo=utc)
|
|
3317
|
-
now2 = utcnow.astimezone(weirdtz)
|
|
3318
|
-
if abs(now - now2) < timedelta(seconds=30):
|
|
3319
|
-
break
|
|
3320
|
-
# Else the code is broken, or more than 30 seconds passed between
|
|
3321
|
-
# calls; assuming the latter, just try again.
|
|
3322
|
-
else:
|
|
3323
|
-
# Three strikes and we're out.
|
|
3324
|
-
self.fail("utcnow(), now(tz), or astimezone() may be broken")
|
|
3325
|
-
|
|
3326
|
-
def test_tzinfo_fromtimestamp(self):
|
|
3327
|
-
import time
|
|
3328
|
-
meth = self.theclass.fromtimestamp
|
|
3329
|
-
ts = time.time()
|
|
3330
|
-
# Ensure it doesn't require tzinfo (i.e., that this doesn't blow up).
|
|
3331
|
-
base = meth(ts)
|
|
3332
|
-
# Try with and without naming the keyword.
|
|
3333
|
-
off42 = FixedOffset(42, "42")
|
|
3334
|
-
another = meth(ts, off42)
|
|
3335
|
-
again = meth(ts, tz=off42)
|
|
3336
|
-
self.assertIs(another.tzinfo, again.tzinfo)
|
|
3337
|
-
self.assertEqual(another.utcoffset(), timedelta(minutes=42))
|
|
3338
|
-
# Bad argument with and w/o naming the keyword.
|
|
3339
|
-
self.assertRaises(TypeError, meth, ts, 16)
|
|
3340
|
-
self.assertRaises(TypeError, meth, ts, tzinfo=16)
|
|
3341
|
-
# Bad keyword name.
|
|
3342
|
-
self.assertRaises(TypeError, meth, ts, tinfo=off42)
|
|
3343
|
-
# Too many args.
|
|
3344
|
-
self.assertRaises(TypeError, meth, ts, off42, off42)
|
|
3345
|
-
# Too few args.
|
|
3346
|
-
self.assertRaises(TypeError, meth)
|
|
3347
|
-
|
|
3348
|
-
# Try to make sure tz= actually does some conversion.
|
|
3349
|
-
timestamp = 1000000000
|
|
3350
|
-
utcdatetime = datetime.utcfromtimestamp(timestamp)
|
|
3351
|
-
# In POSIX (epoch 1970), that's 2001-09-09 01:46:40 UTC, give or take.
|
|
3352
|
-
# But on some flavor of Mac, it's nowhere near that. So we can't have
|
|
3353
|
-
# any idea here what time that actually is, we can only test that
|
|
3354
|
-
# relative changes match.
|
|
3355
|
-
utcoffset = timedelta(hours=-15, minutes=39) # arbitrary, but not zero
|
|
3356
|
-
tz = FixedOffset(utcoffset, "tz", 0)
|
|
3357
|
-
expected = utcdatetime + utcoffset
|
|
3358
|
-
got = datetime.fromtimestamp(timestamp, tz)
|
|
3359
|
-
self.assertEqual(expected, got.replace(tzinfo=None))
|
|
3360
|
-
|
|
3361
|
-
def test_tzinfo_utcnow(self):
|
|
3362
|
-
meth = self.theclass.utcnow
|
|
3363
|
-
# Ensure it doesn't require tzinfo (i.e., that this doesn't blow up).
|
|
3364
|
-
base = meth()
|
|
3365
|
-
# Try with and without naming the keyword; for whatever reason,
|
|
3366
|
-
# utcnow() doesn't accept a tzinfo argument.
|
|
3367
|
-
off42 = FixedOffset(42, "42")
|
|
3368
|
-
self.assertRaises(TypeError, meth, off42)
|
|
3369
|
-
self.assertRaises(TypeError, meth, tzinfo=off42)
|
|
3370
|
-
|
|
3371
|
-
def test_tzinfo_utcfromtimestamp(self):
|
|
3372
|
-
import time
|
|
3373
|
-
meth = self.theclass.utcfromtimestamp
|
|
3374
|
-
ts = time.time()
|
|
3375
|
-
# Ensure it doesn't require tzinfo (i.e., that this doesn't blow up).
|
|
3376
|
-
base = meth(ts)
|
|
3377
|
-
# Try with and without naming the keyword; for whatever reason,
|
|
3378
|
-
# utcfromtimestamp() doesn't accept a tzinfo argument.
|
|
3379
|
-
off42 = FixedOffset(42, "42")
|
|
3380
|
-
self.assertRaises(TypeError, meth, ts, off42)
|
|
3381
|
-
self.assertRaises(TypeError, meth, ts, tzinfo=off42)
|
|
3382
|
-
|
|
3383
|
-
def test_tzinfo_timetuple(self):
|
|
3384
|
-
# TestDateTime tested most of this. datetime adds a twist to the
|
|
3385
|
-
# DST flag.
|
|
3386
|
-
class DST(tzinfo):
|
|
3387
|
-
def __init__(self, dstvalue):
|
|
3388
|
-
if isinstance(dstvalue, int):
|
|
3389
|
-
dstvalue = timedelta(minutes=dstvalue)
|
|
3390
|
-
self.dstvalue = dstvalue
|
|
3391
|
-
def dst(self, dt):
|
|
3392
|
-
return self.dstvalue
|
|
3393
|
-
|
|
3394
|
-
cls = self.theclass
|
|
3395
|
-
for dstvalue, flag in (-33, 1), (33, 1), (0, 0), (None, -1):
|
|
3396
|
-
d = cls(1, 1, 1, 10, 20, 30, 40, tzinfo=DST(dstvalue))
|
|
3397
|
-
t = d.timetuple()
|
|
3398
|
-
self.assertEqual(1, t.tm_year)
|
|
3399
|
-
self.assertEqual(1, t.tm_mon)
|
|
3400
|
-
self.assertEqual(1, t.tm_mday)
|
|
3401
|
-
self.assertEqual(10, t.tm_hour)
|
|
3402
|
-
self.assertEqual(20, t.tm_min)
|
|
3403
|
-
self.assertEqual(30, t.tm_sec)
|
|
3404
|
-
self.assertEqual(0, t.tm_wday)
|
|
3405
|
-
self.assertEqual(1, t.tm_yday)
|
|
3406
|
-
self.assertEqual(flag, t.tm_isdst)
|
|
3407
|
-
|
|
3408
|
-
# dst() returns wrong type.
|
|
3409
|
-
self.assertRaises(TypeError, cls(1, 1, 1, tzinfo=DST("x")).timetuple)
|
|
3410
|
-
|
|
3411
|
-
# dst() at the edge.
|
|
3412
|
-
self.assertEqual(cls(1,1,1, tzinfo=DST(1439)).timetuple().tm_isdst, 1)
|
|
3413
|
-
self.assertEqual(cls(1,1,1, tzinfo=DST(-1439)).timetuple().tm_isdst, 1)
|
|
3414
|
-
|
|
3415
|
-
# dst() out of range.
|
|
3416
|
-
self.assertRaises(ValueError, cls(1,1,1, tzinfo=DST(1440)).timetuple)
|
|
3417
|
-
self.assertRaises(ValueError, cls(1,1,1, tzinfo=DST(-1440)).timetuple)
|
|
3418
|
-
|
|
3419
|
-
def test_utctimetuple(self):
|
|
3420
|
-
class DST(tzinfo):
|
|
3421
|
-
def __init__(self, dstvalue=0):
|
|
3422
|
-
if isinstance(dstvalue, int):
|
|
3423
|
-
dstvalue = timedelta(minutes=dstvalue)
|
|
3424
|
-
self.dstvalue = dstvalue
|
|
3425
|
-
def dst(self, dt):
|
|
3426
|
-
return self.dstvalue
|
|
3427
|
-
|
|
3428
|
-
cls = self.theclass
|
|
3429
|
-
# This can't work: DST didn't implement utcoffset.
|
|
3430
|
-
self.assertRaises(NotImplementedError,
|
|
3431
|
-
cls(1, 1, 1, tzinfo=DST(0)).utcoffset)
|
|
3432
|
-
|
|
3433
|
-
class UOFS(DST):
|
|
3434
|
-
def __init__(self, uofs, dofs=None):
|
|
3435
|
-
DST.__init__(self, dofs)
|
|
3436
|
-
self.uofs = timedelta(minutes=uofs)
|
|
3437
|
-
def utcoffset(self, dt):
|
|
3438
|
-
return self.uofs
|
|
3439
|
-
|
|
3440
|
-
for dstvalue in -33, 33, 0, None:
|
|
3441
|
-
d = cls(1, 2, 3, 10, 20, 30, 40, tzinfo=UOFS(-53, dstvalue))
|
|
3442
|
-
t = d.utctimetuple()
|
|
3443
|
-
self.assertEqual(d.year, t.tm_year)
|
|
3444
|
-
self.assertEqual(d.month, t.tm_mon)
|
|
3445
|
-
self.assertEqual(d.day, t.tm_mday)
|
|
3446
|
-
self.assertEqual(11, t.tm_hour) # 20mm + 53mm = 1hn + 13mm
|
|
3447
|
-
self.assertEqual(13, t.tm_min)
|
|
3448
|
-
self.assertEqual(d.second, t.tm_sec)
|
|
3449
|
-
self.assertEqual(d.weekday(), t.tm_wday)
|
|
3450
|
-
self.assertEqual(d.toordinal() - date(1, 1, 1).toordinal() + 1,
|
|
3451
|
-
t.tm_yday)
|
|
3452
|
-
# Ensure tm_isdst is 0 regardless of what dst() says: DST
|
|
3453
|
-
# is never in effect for a UTC time.
|
|
3454
|
-
self.assertEqual(0, t.tm_isdst)
|
|
3455
|
-
|
|
3456
|
-
# For naive datetime, utctimetuple == timetuple except for isdst
|
|
3457
|
-
d = cls(1, 2, 3, 10, 20, 30, 40)
|
|
3458
|
-
t = d.utctimetuple()
|
|
3459
|
-
self.assertEqual(t[:-1], d.timetuple()[:-1])
|
|
3460
|
-
self.assertEqual(0, t.tm_isdst)
|
|
3461
|
-
# Same if utcoffset is None
|
|
3462
|
-
class NOFS(DST):
|
|
3463
|
-
def utcoffset(self, dt):
|
|
3464
|
-
return None
|
|
3465
|
-
d = cls(1, 2, 3, 10, 20, 30, 40, tzinfo=NOFS())
|
|
3466
|
-
t = d.utctimetuple()
|
|
3467
|
-
self.assertEqual(t[:-1], d.timetuple()[:-1])
|
|
3468
|
-
self.assertEqual(0, t.tm_isdst)
|
|
3469
|
-
# Check that bad tzinfo is detected
|
|
3470
|
-
class BOFS(DST):
|
|
3471
|
-
def utcoffset(self, dt):
|
|
3472
|
-
return "EST"
|
|
3473
|
-
d = cls(1, 2, 3, 10, 20, 30, 40, tzinfo=BOFS())
|
|
3474
|
-
self.assertRaises(TypeError, d.utctimetuple)
|
|
3475
|
-
|
|
3476
|
-
# Check that utctimetuple() is the same as
|
|
3477
|
-
# astimezone(utc).timetuple()
|
|
3478
|
-
d = cls(2010, 11, 13, 14, 15, 16, 171819)
|
|
3479
|
-
for tz in [timezone.min, timezone.utc, timezone.max]:
|
|
3480
|
-
dtz = d.replace(tzinfo=tz)
|
|
3481
|
-
self.assertEqual(dtz.utctimetuple()[:-1],
|
|
3482
|
-
dtz.astimezone(timezone.utc).timetuple()[:-1])
|
|
3483
|
-
# At the edges, UTC adjustment can produce years out-of-range
|
|
3484
|
-
# for a datetime object. Ensure that an OverflowError is
|
|
3485
|
-
# raised.
|
|
3486
|
-
tiny = cls(MINYEAR, 1, 1, 0, 0, 37, tzinfo=UOFS(1439))
|
|
3487
|
-
# That goes back 1 minute less than a full day.
|
|
3488
|
-
self.assertRaises(OverflowError, tiny.utctimetuple)
|
|
3489
|
-
|
|
3490
|
-
huge = cls(MAXYEAR, 12, 31, 23, 59, 37, 999999, tzinfo=UOFS(-1439))
|
|
3491
|
-
# That goes forward 1 minute less than a full day.
|
|
3492
|
-
self.assertRaises(OverflowError, huge.utctimetuple)
|
|
3493
|
-
# More overflow cases
|
|
3494
|
-
tiny = cls.min.replace(tzinfo=timezone(MINUTE))
|
|
3495
|
-
self.assertRaises(OverflowError, tiny.utctimetuple)
|
|
3496
|
-
huge = cls.max.replace(tzinfo=timezone(-MINUTE))
|
|
3497
|
-
self.assertRaises(OverflowError, huge.utctimetuple)
|
|
3498
|
-
|
|
3499
|
-
def test_tzinfo_isoformat(self):
|
|
3500
|
-
zero = FixedOffset(0, "+00:00")
|
|
3501
|
-
plus = FixedOffset(220, "+03:40")
|
|
3502
|
-
minus = FixedOffset(-231, "-03:51")
|
|
3503
|
-
unknown = FixedOffset(None, "")
|
|
3504
|
-
|
|
3505
|
-
cls = self.theclass
|
|
3506
|
-
datestr = '0001-02-03'
|
|
3507
|
-
for ofs in None, zero, plus, minus, unknown:
|
|
3508
|
-
for us in 0, 987001:
|
|
3509
|
-
d = cls(1, 2, 3, 4, 5, 59, us, tzinfo=ofs)
|
|
3510
|
-
timestr = '04:05:59' + (us and '.987001' or '')
|
|
3511
|
-
ofsstr = ofs is not None and d.tzname() or ''
|
|
3512
|
-
tailstr = timestr + ofsstr
|
|
3513
|
-
iso = d.isoformat()
|
|
3514
|
-
self.assertEqual(iso, datestr + 'T' + tailstr)
|
|
3515
|
-
self.assertEqual(iso, d.isoformat('T'))
|
|
3516
|
-
self.assertEqual(d.isoformat('k'), datestr + 'k' + tailstr)
|
|
3517
|
-
self.assertEqual(d.isoformat('\u1234'), datestr + '\u1234' + tailstr)
|
|
3518
|
-
self.assertEqual(str(d), datestr + ' ' + tailstr)
|
|
3519
|
-
|
|
3520
|
-
def test_replace(self):
|
|
3521
|
-
cls = self.theclass
|
|
3522
|
-
z100 = FixedOffset(100, "+100")
|
|
3523
|
-
zm200 = FixedOffset(timedelta(minutes=-200), "-200")
|
|
3524
|
-
args = [1, 2, 3, 4, 5, 6, 7, z100]
|
|
3525
|
-
base = cls(*args)
|
|
3526
|
-
self.assertEqual(base, base.replace())
|
|
3527
|
-
|
|
3528
|
-
i = 0
|
|
3529
|
-
for name, newval in (("year", 2),
|
|
3530
|
-
("month", 3),
|
|
3531
|
-
("day", 4),
|
|
3532
|
-
("hour", 5),
|
|
3533
|
-
("minute", 6),
|
|
3534
|
-
("second", 7),
|
|
3535
|
-
("microsecond", 8),
|
|
3536
|
-
("tzinfo", zm200)):
|
|
3537
|
-
newargs = args[:]
|
|
3538
|
-
newargs[i] = newval
|
|
3539
|
-
expected = cls(*newargs)
|
|
3540
|
-
got = base.replace(**{name: newval})
|
|
3541
|
-
self.assertEqual(expected, got)
|
|
3542
|
-
i += 1
|
|
3543
|
-
|
|
3544
|
-
# Ensure we can get rid of a tzinfo.
|
|
3545
|
-
self.assertEqual(base.tzname(), "+100")
|
|
3546
|
-
base2 = base.replace(tzinfo=None)
|
|
3547
|
-
self.assertIsNone(base2.tzinfo)
|
|
3548
|
-
self.assertIsNone(base2.tzname())
|
|
3549
|
-
|
|
3550
|
-
# Ensure we can add one.
|
|
3551
|
-
base3 = base2.replace(tzinfo=z100)
|
|
3552
|
-
self.assertEqual(base, base3)
|
|
3553
|
-
self.assertIs(base.tzinfo, base3.tzinfo)
|
|
3554
|
-
|
|
3555
|
-
# Out of bounds.
|
|
3556
|
-
base = cls(2000, 2, 29)
|
|
3557
|
-
self.assertRaises(ValueError, base.replace, year=2001)
|
|
3558
|
-
|
|
3559
|
-
def test_more_astimezone(self):
|
|
3560
|
-
# The inherited test_astimezone covered some trivial and error cases.
|
|
3561
|
-
fnone = FixedOffset(None, "None")
|
|
3562
|
-
f44m = FixedOffset(44, "44")
|
|
3563
|
-
fm5h = FixedOffset(-timedelta(hours=5), "m300")
|
|
3564
|
-
|
|
3565
|
-
dt = self.theclass.now(tz=f44m)
|
|
3566
|
-
self.assertIs(dt.tzinfo, f44m)
|
|
3567
|
-
# Replacing with degenerate tzinfo raises an exception.
|
|
3568
|
-
self.assertRaises(ValueError, dt.astimezone, fnone)
|
|
3569
|
-
# Replacing with same tzinfo makes no change.
|
|
3570
|
-
x = dt.astimezone(dt.tzinfo)
|
|
3571
|
-
self.assertIs(x.tzinfo, f44m)
|
|
3572
|
-
self.assertEqual(x.date(), dt.date())
|
|
3573
|
-
self.assertEqual(x.time(), dt.time())
|
|
3574
|
-
|
|
3575
|
-
# Replacing with different tzinfo does adjust.
|
|
3576
|
-
got = dt.astimezone(fm5h)
|
|
3577
|
-
self.assertIs(got.tzinfo, fm5h)
|
|
3578
|
-
self.assertEqual(got.utcoffset(), timedelta(hours=-5))
|
|
3579
|
-
expected = dt - dt.utcoffset() # in effect, convert to UTC
|
|
3580
|
-
expected += fm5h.utcoffset(dt) # and from there to local time
|
|
3581
|
-
expected = expected.replace(tzinfo=fm5h) # and attach new tzinfo
|
|
3582
|
-
self.assertEqual(got.date(), expected.date())
|
|
3583
|
-
self.assertEqual(got.time(), expected.time())
|
|
3584
|
-
self.assertEqual(got.timetz(), expected.timetz())
|
|
3585
|
-
self.assertIs(got.tzinfo, expected.tzinfo)
|
|
3586
|
-
self.assertEqual(got, expected)
|
|
3587
|
-
|
|
3588
|
-
@support.run_with_tz('UTC')
|
|
3589
|
-
def test_astimezone_default_utc(self):
|
|
3590
|
-
dt = self.theclass.now(timezone.utc)
|
|
3591
|
-
self.assertEqual(dt.astimezone(None), dt)
|
|
3592
|
-
self.assertEqual(dt.astimezone(), dt)
|
|
3593
|
-
|
|
3594
|
-
# Note that offset in TZ variable has the opposite sign to that
|
|
3595
|
-
# produced by %z directive.
|
|
3596
|
-
@support.run_with_tz('EST+05EDT,M3.2.0,M11.1.0')
|
|
3597
|
-
def test_astimezone_default_eastern(self):
|
|
3598
|
-
dt = self.theclass(2012, 11, 4, 6, 30, tzinfo=timezone.utc)
|
|
3599
|
-
local = dt.astimezone()
|
|
3600
|
-
self.assertEqual(dt, local)
|
|
3601
|
-
self.assertEqual(local.strftime("%z %Z"), "-0500 EST")
|
|
3602
|
-
dt = self.theclass(2012, 11, 4, 5, 30, tzinfo=timezone.utc)
|
|
3603
|
-
local = dt.astimezone()
|
|
3604
|
-
self.assertEqual(dt, local)
|
|
3605
|
-
self.assertEqual(local.strftime("%z %Z"), "-0400 EDT")
|
|
3606
|
-
|
|
3607
|
-
@support.run_with_tz('EST+05EDT,M3.2.0,M11.1.0')
|
|
3608
|
-
def test_astimezone_default_near_fold(self):
|
|
3609
|
-
# Issue #26616.
|
|
3610
|
-
u = datetime(2015, 11, 1, 5, tzinfo=timezone.utc)
|
|
3611
|
-
t = u.astimezone()
|
|
3612
|
-
s = t.astimezone()
|
|
3613
|
-
self.assertEqual(t.tzinfo, s.tzinfo)
|
|
3614
|
-
|
|
3615
|
-
def test_aware_subtract(self):
|
|
3616
|
-
cls = self.theclass
|
|
3617
|
-
|
|
3618
|
-
# Ensure that utcoffset() is ignored when the operands have the
|
|
3619
|
-
# same tzinfo member.
|
|
3620
|
-
class OperandDependentOffset(tzinfo):
|
|
3621
|
-
def utcoffset(self, t):
|
|
3622
|
-
if t.minute < 10:
|
|
3623
|
-
# d0 and d1 equal after adjustment
|
|
3624
|
-
return timedelta(minutes=t.minute)
|
|
3625
|
-
else:
|
|
3626
|
-
# d2 off in the weeds
|
|
3627
|
-
return timedelta(minutes=59)
|
|
3628
|
-
|
|
3629
|
-
base = cls(8, 9, 10, 11, 12, 13, 14, tzinfo=OperandDependentOffset())
|
|
3630
|
-
d0 = base.replace(minute=3)
|
|
3631
|
-
d1 = base.replace(minute=9)
|
|
3632
|
-
d2 = base.replace(minute=11)
|
|
3633
|
-
for x in d0, d1, d2:
|
|
3634
|
-
for y in d0, d1, d2:
|
|
3635
|
-
got = x - y
|
|
3636
|
-
expected = timedelta(minutes=x.minute - y.minute)
|
|
3637
|
-
self.assertEqual(got, expected)
|
|
3638
|
-
|
|
3639
|
-
# OTOH, if the tzinfo members are distinct, utcoffsets aren't
|
|
3640
|
-
# ignored.
|
|
3641
|
-
base = cls(8, 9, 10, 11, 12, 13, 14)
|
|
3642
|
-
d0 = base.replace(minute=3, tzinfo=OperandDependentOffset())
|
|
3643
|
-
d1 = base.replace(minute=9, tzinfo=OperandDependentOffset())
|
|
3644
|
-
d2 = base.replace(minute=11, tzinfo=OperandDependentOffset())
|
|
3645
|
-
for x in d0, d1, d2:
|
|
3646
|
-
for y in d0, d1, d2:
|
|
3647
|
-
got = x - y
|
|
3648
|
-
if (x is d0 or x is d1) and (y is d0 or y is d1):
|
|
3649
|
-
expected = timedelta(0)
|
|
3650
|
-
elif x is y is d2:
|
|
3651
|
-
expected = timedelta(0)
|
|
3652
|
-
elif x is d2:
|
|
3653
|
-
expected = timedelta(minutes=(11-59)-0)
|
|
3654
|
-
else:
|
|
3655
|
-
assert y is d2
|
|
3656
|
-
expected = timedelta(minutes=0-(11-59))
|
|
3657
|
-
self.assertEqual(got, expected)
|
|
3658
|
-
|
|
3659
|
-
def test_mixed_compare(self):
|
|
3660
|
-
t1 = datetime(1, 2, 3, 4, 5, 6, 7)
|
|
3661
|
-
t2 = datetime(1, 2, 3, 4, 5, 6, 7)
|
|
3662
|
-
self.assertEqual(t1, t2)
|
|
3663
|
-
t2 = t2.replace(tzinfo=None)
|
|
3664
|
-
self.assertEqual(t1, t2)
|
|
3665
|
-
t2 = t2.replace(tzinfo=FixedOffset(None, ""))
|
|
3666
|
-
self.assertEqual(t1, t2)
|
|
3667
|
-
t2 = t2.replace(tzinfo=FixedOffset(0, ""))
|
|
3668
|
-
self.assertNotEqual(t1, t2)
|
|
3669
|
-
|
|
3670
|
-
# In datetime w/ identical tzinfo objects, utcoffset is ignored.
|
|
3671
|
-
class Varies(tzinfo):
|
|
3672
|
-
def __init__(self):
|
|
3673
|
-
self.offset = timedelta(minutes=22)
|
|
3674
|
-
def utcoffset(self, t):
|
|
3675
|
-
self.offset += timedelta(minutes=1)
|
|
3676
|
-
return self.offset
|
|
3677
|
-
|
|
3678
|
-
v = Varies()
|
|
3679
|
-
t1 = t2.replace(tzinfo=v)
|
|
3680
|
-
t2 = t2.replace(tzinfo=v)
|
|
3681
|
-
self.assertEqual(t1.utcoffset(), timedelta(minutes=23))
|
|
3682
|
-
self.assertEqual(t2.utcoffset(), timedelta(minutes=24))
|
|
3683
|
-
self.assertEqual(t1, t2)
|
|
3684
|
-
|
|
3685
|
-
# But if they're not identical, it isn't ignored.
|
|
3686
|
-
t2 = t2.replace(tzinfo=Varies())
|
|
3687
|
-
self.assertTrue(t1 < t2) # t1's offset counter still going up
|
|
3688
|
-
|
|
3689
|
-
def test_subclass_datetimetz(self):
|
|
3690
|
-
|
|
3691
|
-
class C(self.theclass):
|
|
3692
|
-
theAnswer = 42
|
|
3693
|
-
|
|
3694
|
-
def __new__(cls, *args, **kws):
|
|
3695
|
-
temp = kws.copy()
|
|
3696
|
-
extra = temp.pop('extra')
|
|
3697
|
-
result = self.theclass.__new__(cls, *args, **temp)
|
|
3698
|
-
result.extra = extra
|
|
3699
|
-
return result
|
|
3700
|
-
|
|
3701
|
-
def newmeth(self, start):
|
|
3702
|
-
return start + self.hour + self.year
|
|
3703
|
-
|
|
3704
|
-
args = 2002, 12, 31, 4, 5, 6, 500, FixedOffset(-300, "EST", 1)
|
|
3705
|
-
|
|
3706
|
-
dt1 = self.theclass(*args)
|
|
3707
|
-
dt2 = C(*args, **{'extra': 7})
|
|
3708
|
-
|
|
3709
|
-
self.assertEqual(dt2.__class__, C)
|
|
3710
|
-
self.assertEqual(dt2.theAnswer, 42)
|
|
3711
|
-
self.assertEqual(dt2.extra, 7)
|
|
3712
|
-
self.assertEqual(dt1.utcoffset(), dt2.utcoffset())
|
|
3713
|
-
self.assertEqual(dt2.newmeth(-7), dt1.hour + dt1.year - 7)
|
|
3714
|
-
|
|
3715
|
-
# Pain to set up DST-aware tzinfo classes.
|
|
3716
|
-
|
|
3717
|
-
def first_sunday_on_or_after(dt):
|
|
3718
|
-
days_to_go = 6 - dt.weekday()
|
|
3719
|
-
if days_to_go:
|
|
3720
|
-
dt += timedelta(days_to_go)
|
|
3721
|
-
return dt
|
|
3722
|
-
|
|
3723
|
-
ZERO = timedelta(0)
|
|
3724
|
-
MINUTE = timedelta(minutes=1)
|
|
3725
|
-
HOUR = timedelta(hours=1)
|
|
3726
|
-
DAY = timedelta(days=1)
|
|
3727
|
-
# In the US, DST starts at 2am (standard time) on the first Sunday in April.
|
|
3728
|
-
DSTSTART = datetime(1, 4, 1, 2)
|
|
3729
|
-
# and ends at 2am (DST time; 1am standard time) on the last Sunday of Oct,
|
|
3730
|
-
# which is the first Sunday on or after Oct 25. Because we view 1:MM as
|
|
3731
|
-
# being standard time on that day, there is no spelling in local time of
|
|
3732
|
-
# the last hour of DST (that's 1:MM DST, but 1:MM is taken as standard time).
|
|
3733
|
-
DSTEND = datetime(1, 10, 25, 1)
|
|
3734
|
-
|
|
3735
|
-
class USTimeZone(tzinfo):
|
|
3736
|
-
|
|
3737
|
-
def __init__(self, hours, reprname, stdname, dstname):
|
|
3738
|
-
self.stdoffset = timedelta(hours=hours)
|
|
3739
|
-
self.reprname = reprname
|
|
3740
|
-
self.stdname = stdname
|
|
3741
|
-
self.dstname = dstname
|
|
3742
|
-
|
|
3743
|
-
def __repr__(self):
|
|
3744
|
-
return self.reprname
|
|
3745
|
-
|
|
3746
|
-
def tzname(self, dt):
|
|
3747
|
-
if self.dst(dt):
|
|
3748
|
-
return self.dstname
|
|
3749
|
-
else:
|
|
3750
|
-
return self.stdname
|
|
3751
|
-
|
|
3752
|
-
def utcoffset(self, dt):
|
|
3753
|
-
return self.stdoffset + self.dst(dt)
|
|
3754
|
-
|
|
3755
|
-
def dst(self, dt):
|
|
3756
|
-
if dt is None or dt.tzinfo is None:
|
|
3757
|
-
# An exception instead may be sensible here, in one or more of
|
|
3758
|
-
# the cases.
|
|
3759
|
-
return ZERO
|
|
3760
|
-
assert dt.tzinfo is self
|
|
3761
|
-
|
|
3762
|
-
# Find first Sunday in April.
|
|
3763
|
-
start = first_sunday_on_or_after(DSTSTART.replace(year=dt.year))
|
|
3764
|
-
assert start.weekday() == 6 and start.month == 4 and start.day <= 7
|
|
3765
|
-
|
|
3766
|
-
# Find last Sunday in October.
|
|
3767
|
-
end = first_sunday_on_or_after(DSTEND.replace(year=dt.year))
|
|
3768
|
-
assert end.weekday() == 6 and end.month == 10 and end.day >= 25
|
|
3769
|
-
|
|
3770
|
-
# Can't compare naive to aware objects, so strip the timezone from
|
|
3771
|
-
# dt first.
|
|
3772
|
-
if start <= dt.replace(tzinfo=None) < end:
|
|
3773
|
-
return HOUR
|
|
3774
|
-
else:
|
|
3775
|
-
return ZERO
|
|
3776
|
-
|
|
3777
|
-
Eastern = USTimeZone(-5, "Eastern", "EST", "EDT")
|
|
3778
|
-
Central = USTimeZone(-6, "Central", "CST", "CDT")
|
|
3779
|
-
Mountain = USTimeZone(-7, "Mountain", "MST", "MDT")
|
|
3780
|
-
Pacific = USTimeZone(-8, "Pacific", "PST", "PDT")
|
|
3781
|
-
utc_real = FixedOffset(0, "UTC", 0)
|
|
3782
|
-
# For better test coverage, we want another flavor of UTC that's west of
|
|
3783
|
-
# the Eastern and Pacific timezones.
|
|
3784
|
-
utc_fake = FixedOffset(-12*60, "UTCfake", 0)
|
|
3785
|
-
|
|
3786
|
-
class TestTimezoneConversions(unittest.TestCase):
|
|
3787
|
-
# The DST switch times for 2002, in std time.
|
|
3788
|
-
dston = datetime(2002, 4, 7, 2)
|
|
3789
|
-
dstoff = datetime(2002, 10, 27, 1)
|
|
3790
|
-
|
|
3791
|
-
theclass = datetime
|
|
3792
|
-
|
|
3793
|
-
# Check a time that's inside DST.
|
|
3794
|
-
def checkinside(self, dt, tz, utc, dston, dstoff):
|
|
3795
|
-
self.assertEqual(dt.dst(), HOUR)
|
|
3796
|
-
|
|
3797
|
-
# Conversion to our own timezone is always an identity.
|
|
3798
|
-
self.assertEqual(dt.astimezone(tz), dt)
|
|
3799
|
-
|
|
3800
|
-
asutc = dt.astimezone(utc)
|
|
3801
|
-
there_and_back = asutc.astimezone(tz)
|
|
3802
|
-
|
|
3803
|
-
# Conversion to UTC and back isn't always an identity here,
|
|
3804
|
-
# because there are redundant spellings (in local time) of
|
|
3805
|
-
# UTC time when DST begins: the clock jumps from 1:59:59
|
|
3806
|
-
# to 3:00:00, and a local time of 2:MM:SS doesn't really
|
|
3807
|
-
# make sense then. The classes above treat 2:MM:SS as
|
|
3808
|
-
# daylight time then (it's "after 2am"), really an alias
|
|
3809
|
-
# for 1:MM:SS standard time. The latter form is what
|
|
3810
|
-
# conversion back from UTC produces.
|
|
3811
|
-
if dt.date() == dston.date() and dt.hour == 2:
|
|
3812
|
-
# We're in the redundant hour, and coming back from
|
|
3813
|
-
# UTC gives the 1:MM:SS standard-time spelling.
|
|
3814
|
-
self.assertEqual(there_and_back + HOUR, dt)
|
|
3815
|
-
# Although during was considered to be in daylight
|
|
3816
|
-
# time, there_and_back is not.
|
|
3817
|
-
self.assertEqual(there_and_back.dst(), ZERO)
|
|
3818
|
-
# They're the same times in UTC.
|
|
3819
|
-
self.assertEqual(there_and_back.astimezone(utc),
|
|
3820
|
-
dt.astimezone(utc))
|
|
3821
|
-
else:
|
|
3822
|
-
# We're not in the redundant hour.
|
|
3823
|
-
self.assertEqual(dt, there_and_back)
|
|
3824
|
-
|
|
3825
|
-
# Because we have a redundant spelling when DST begins, there is
|
|
3826
|
-
# (unfortunately) an hour when DST ends that can't be spelled at all in
|
|
3827
|
-
# local time. When DST ends, the clock jumps from 1:59 back to 1:00
|
|
3828
|
-
# again. The hour 1:MM DST has no spelling then: 1:MM is taken to be
|
|
3829
|
-
# standard time. 1:MM DST == 0:MM EST, but 0:MM is taken to be
|
|
3830
|
-
# daylight time. The hour 1:MM daylight == 0:MM standard can't be
|
|
3831
|
-
# expressed in local time. Nevertheless, we want conversion back
|
|
3832
|
-
# from UTC to mimic the local clock's "repeat an hour" behavior.
|
|
3833
|
-
nexthour_utc = asutc + HOUR
|
|
3834
|
-
nexthour_tz = nexthour_utc.astimezone(tz)
|
|
3835
|
-
if dt.date() == dstoff.date() and dt.hour == 0:
|
|
3836
|
-
# We're in the hour before the last DST hour. The last DST hour
|
|
3837
|
-
# is ineffable. We want the conversion back to repeat 1:MM.
|
|
3838
|
-
self.assertEqual(nexthour_tz, dt.replace(hour=1))
|
|
3839
|
-
nexthour_utc += HOUR
|
|
3840
|
-
nexthour_tz = nexthour_utc.astimezone(tz)
|
|
3841
|
-
self.assertEqual(nexthour_tz, dt.replace(hour=1))
|
|
3842
|
-
else:
|
|
3843
|
-
self.assertEqual(nexthour_tz - dt, HOUR)
|
|
3844
|
-
|
|
3845
|
-
# Check a time that's outside DST.
|
|
3846
|
-
def checkoutside(self, dt, tz, utc):
|
|
3847
|
-
self.assertEqual(dt.dst(), ZERO)
|
|
3848
|
-
|
|
3849
|
-
# Conversion to our own timezone is always an identity.
|
|
3850
|
-
self.assertEqual(dt.astimezone(tz), dt)
|
|
3851
|
-
|
|
3852
|
-
# Converting to UTC and back is an identity too.
|
|
3853
|
-
asutc = dt.astimezone(utc)
|
|
3854
|
-
there_and_back = asutc.astimezone(tz)
|
|
3855
|
-
self.assertEqual(dt, there_and_back)
|
|
3856
|
-
|
|
3857
|
-
def convert_between_tz_and_utc(self, tz, utc):
|
|
3858
|
-
dston = self.dston.replace(tzinfo=tz)
|
|
3859
|
-
# Because 1:MM on the day DST ends is taken as being standard time,
|
|
3860
|
-
# there is no spelling in tz for the last hour of daylight time.
|
|
3861
|
-
# For purposes of the test, the last hour of DST is 0:MM, which is
|
|
3862
|
-
# taken as being daylight time (and 1:MM is taken as being standard
|
|
3863
|
-
# time).
|
|
3864
|
-
dstoff = self.dstoff.replace(tzinfo=tz)
|
|
3865
|
-
for delta in (timedelta(weeks=13),
|
|
3866
|
-
DAY,
|
|
3867
|
-
HOUR,
|
|
3868
|
-
timedelta(minutes=1),
|
|
3869
|
-
timedelta(microseconds=1)):
|
|
3870
|
-
|
|
3871
|
-
self.checkinside(dston, tz, utc, dston, dstoff)
|
|
3872
|
-
for during in dston + delta, dstoff - delta:
|
|
3873
|
-
self.checkinside(during, tz, utc, dston, dstoff)
|
|
3874
|
-
|
|
3875
|
-
self.checkoutside(dstoff, tz, utc)
|
|
3876
|
-
for outside in dston - delta, dstoff + delta:
|
|
3877
|
-
self.checkoutside(outside, tz, utc)
|
|
3878
|
-
|
|
3879
|
-
def test_easy(self):
|
|
3880
|
-
# Despite the name of this test, the endcases are excruciating.
|
|
3881
|
-
self.convert_between_tz_and_utc(Eastern, utc_real)
|
|
3882
|
-
self.convert_between_tz_and_utc(Pacific, utc_real)
|
|
3883
|
-
self.convert_between_tz_and_utc(Eastern, utc_fake)
|
|
3884
|
-
self.convert_between_tz_and_utc(Pacific, utc_fake)
|
|
3885
|
-
# The next is really dancing near the edge. It works because
|
|
3886
|
-
# Pacific and Eastern are far enough apart that their "problem
|
|
3887
|
-
# hours" don't overlap.
|
|
3888
|
-
self.convert_between_tz_and_utc(Eastern, Pacific)
|
|
3889
|
-
self.convert_between_tz_and_utc(Pacific, Eastern)
|
|
3890
|
-
# OTOH, these fail! Don't enable them. The difficulty is that
|
|
3891
|
-
# the edge case tests assume that every hour is representable in
|
|
3892
|
-
# the "utc" class. This is always true for a fixed-offset tzinfo
|
|
3893
|
-
# class (lke utc_real and utc_fake), but not for Eastern or Central.
|
|
3894
|
-
# For these adjacent DST-aware time zones, the range of time offsets
|
|
3895
|
-
# tested ends up creating hours in the one that aren't representable
|
|
3896
|
-
# in the other. For the same reason, we would see failures in the
|
|
3897
|
-
# Eastern vs Pacific tests too if we added 3*HOUR to the list of
|
|
3898
|
-
# offset deltas in convert_between_tz_and_utc().
|
|
3899
|
-
#
|
|
3900
|
-
# self.convert_between_tz_and_utc(Eastern, Central) # can't work
|
|
3901
|
-
# self.convert_between_tz_and_utc(Central, Eastern) # can't work
|
|
3902
|
-
|
|
3903
|
-
def test_tricky(self):
|
|
3904
|
-
# 22:00 on day before daylight starts.
|
|
3905
|
-
fourback = self.dston - timedelta(hours=4)
|
|
3906
|
-
ninewest = FixedOffset(-9*60, "-0900", 0)
|
|
3907
|
-
fourback = fourback.replace(tzinfo=ninewest)
|
|
3908
|
-
# 22:00-0900 is 7:00 UTC == 2:00 EST == 3:00 DST. Since it's "after
|
|
3909
|
-
# 2", we should get the 3 spelling.
|
|
3910
|
-
# If we plug 22:00 the day before into Eastern, it "looks like std
|
|
3911
|
-
# time", so its offset is returned as -5, and -5 - -9 = 4. Adding 4
|
|
3912
|
-
# to 22:00 lands on 2:00, which makes no sense in local time (the
|
|
3913
|
-
# local clock jumps from 1 to 3). The point here is to make sure we
|
|
3914
|
-
# get the 3 spelling.
|
|
3915
|
-
expected = self.dston.replace(hour=3)
|
|
3916
|
-
got = fourback.astimezone(Eastern).replace(tzinfo=None)
|
|
3917
|
-
self.assertEqual(expected, got)
|
|
3918
|
-
|
|
3919
|
-
# Similar, but map to 6:00 UTC == 1:00 EST == 2:00 DST. In that
|
|
3920
|
-
# case we want the 1:00 spelling.
|
|
3921
|
-
sixutc = self.dston.replace(hour=6, tzinfo=utc_real)
|
|
3922
|
-
# Now 6:00 "looks like daylight", so the offset wrt Eastern is -4,
|
|
3923
|
-
# and adding -4-0 == -4 gives the 2:00 spelling. We want the 1:00 EST
|
|
3924
|
-
# spelling.
|
|
3925
|
-
expected = self.dston.replace(hour=1)
|
|
3926
|
-
got = sixutc.astimezone(Eastern).replace(tzinfo=None)
|
|
3927
|
-
self.assertEqual(expected, got)
|
|
3928
|
-
|
|
3929
|
-
# Now on the day DST ends, we want "repeat an hour" behavior.
|
|
3930
|
-
# UTC 4:MM 5:MM 6:MM 7:MM checking these
|
|
3931
|
-
# EST 23:MM 0:MM 1:MM 2:MM
|
|
3932
|
-
# EDT 0:MM 1:MM 2:MM 3:MM
|
|
3933
|
-
# wall 0:MM 1:MM 1:MM 2:MM against these
|
|
3934
|
-
for utc in utc_real, utc_fake:
|
|
3935
|
-
for tz in Eastern, Pacific:
|
|
3936
|
-
first_std_hour = self.dstoff - timedelta(hours=2) # 23:MM
|
|
3937
|
-
# Convert that to UTC.
|
|
3938
|
-
first_std_hour -= tz.utcoffset(None)
|
|
3939
|
-
# Adjust for possibly fake UTC.
|
|
3940
|
-
asutc = first_std_hour + utc.utcoffset(None)
|
|
3941
|
-
# First UTC hour to convert; this is 4:00 when utc=utc_real &
|
|
3942
|
-
# tz=Eastern.
|
|
3943
|
-
asutcbase = asutc.replace(tzinfo=utc)
|
|
3944
|
-
for tzhour in (0, 1, 1, 2):
|
|
3945
|
-
expectedbase = self.dstoff.replace(hour=tzhour)
|
|
3946
|
-
for minute in 0, 30, 59:
|
|
3947
|
-
expected = expectedbase.replace(minute=minute)
|
|
3948
|
-
asutc = asutcbase.replace(minute=minute)
|
|
3949
|
-
astz = asutc.astimezone(tz)
|
|
3950
|
-
self.assertEqual(astz.replace(tzinfo=None), expected)
|
|
3951
|
-
asutcbase += HOUR
|
|
3952
|
-
|
|
3953
|
-
|
|
3954
|
-
def test_bogus_dst(self):
|
|
3955
|
-
class ok(tzinfo):
|
|
3956
|
-
def utcoffset(self, dt): return HOUR
|
|
3957
|
-
def dst(self, dt): return HOUR
|
|
3958
|
-
|
|
3959
|
-
now = self.theclass.now().replace(tzinfo=utc_real)
|
|
3960
|
-
# Doesn't blow up.
|
|
3961
|
-
now.astimezone(ok())
|
|
3962
|
-
|
|
3963
|
-
# Does blow up.
|
|
3964
|
-
class notok(ok):
|
|
3965
|
-
def dst(self, dt): return None
|
|
3966
|
-
self.assertRaises(ValueError, now.astimezone, notok())
|
|
3967
|
-
|
|
3968
|
-
# Sometimes blow up. In the following, tzinfo.dst()
|
|
3969
|
-
# implementation may return None or not None depending on
|
|
3970
|
-
# whether DST is assumed to be in effect. In this situation,
|
|
3971
|
-
# a ValueError should be raised by astimezone().
|
|
3972
|
-
class tricky_notok(ok):
|
|
3973
|
-
def dst(self, dt):
|
|
3974
|
-
if dt.year == 2000:
|
|
3975
|
-
return None
|
|
3976
|
-
else:
|
|
3977
|
-
return 10*HOUR
|
|
3978
|
-
dt = self.theclass(2001, 1, 1).replace(tzinfo=utc_real)
|
|
3979
|
-
self.assertRaises(ValueError, dt.astimezone, tricky_notok())
|
|
3980
|
-
|
|
3981
|
-
def test_fromutc(self):
|
|
3982
|
-
self.assertRaises(TypeError, Eastern.fromutc) # not enough args
|
|
3983
|
-
now = datetime.utcnow().replace(tzinfo=utc_real)
|
|
3984
|
-
self.assertRaises(ValueError, Eastern.fromutc, now) # wrong tzinfo
|
|
3985
|
-
now = now.replace(tzinfo=Eastern) # insert correct tzinfo
|
|
3986
|
-
enow = Eastern.fromutc(now) # doesn't blow up
|
|
3987
|
-
self.assertEqual(enow.tzinfo, Eastern) # has right tzinfo member
|
|
3988
|
-
self.assertRaises(TypeError, Eastern.fromutc, now, now) # too many args
|
|
3989
|
-
self.assertRaises(TypeError, Eastern.fromutc, date.today()) # wrong type
|
|
3990
|
-
|
|
3991
|
-
# Always converts UTC to standard time.
|
|
3992
|
-
class FauxUSTimeZone(USTimeZone):
|
|
3993
|
-
def fromutc(self, dt):
|
|
3994
|
-
return dt + self.stdoffset
|
|
3995
|
-
FEastern = FauxUSTimeZone(-5, "FEastern", "FEST", "FEDT")
|
|
3996
|
-
|
|
3997
|
-
# UTC 4:MM 5:MM 6:MM 7:MM 8:MM 9:MM
|
|
3998
|
-
# EST 23:MM 0:MM 1:MM 2:MM 3:MM 4:MM
|
|
3999
|
-
# EDT 0:MM 1:MM 2:MM 3:MM 4:MM 5:MM
|
|
4000
|
-
|
|
4001
|
-
# Check around DST start.
|
|
4002
|
-
start = self.dston.replace(hour=4, tzinfo=Eastern)
|
|
4003
|
-
fstart = start.replace(tzinfo=FEastern)
|
|
4004
|
-
for wall in 23, 0, 1, 3, 4, 5:
|
|
4005
|
-
expected = start.replace(hour=wall)
|
|
4006
|
-
if wall == 23:
|
|
4007
|
-
expected -= timedelta(days=1)
|
|
4008
|
-
got = Eastern.fromutc(start)
|
|
4009
|
-
self.assertEqual(expected, got)
|
|
4010
|
-
|
|
4011
|
-
expected = fstart + FEastern.stdoffset
|
|
4012
|
-
got = FEastern.fromutc(fstart)
|
|
4013
|
-
self.assertEqual(expected, got)
|
|
4014
|
-
|
|
4015
|
-
# Ensure astimezone() calls fromutc() too.
|
|
4016
|
-
got = fstart.replace(tzinfo=utc_real).astimezone(FEastern)
|
|
4017
|
-
self.assertEqual(expected, got)
|
|
4018
|
-
|
|
4019
|
-
start += HOUR
|
|
4020
|
-
fstart += HOUR
|
|
4021
|
-
|
|
4022
|
-
# Check around DST end.
|
|
4023
|
-
start = self.dstoff.replace(hour=4, tzinfo=Eastern)
|
|
4024
|
-
fstart = start.replace(tzinfo=FEastern)
|
|
4025
|
-
for wall in 0, 1, 1, 2, 3, 4:
|
|
4026
|
-
expected = start.replace(hour=wall)
|
|
4027
|
-
got = Eastern.fromutc(start)
|
|
4028
|
-
self.assertEqual(expected, got)
|
|
4029
|
-
|
|
4030
|
-
expected = fstart + FEastern.stdoffset
|
|
4031
|
-
got = FEastern.fromutc(fstart)
|
|
4032
|
-
self.assertEqual(expected, got)
|
|
4033
|
-
|
|
4034
|
-
# Ensure astimezone() calls fromutc() too.
|
|
4035
|
-
got = fstart.replace(tzinfo=utc_real).astimezone(FEastern)
|
|
4036
|
-
self.assertEqual(expected, got)
|
|
4037
|
-
|
|
4038
|
-
start += HOUR
|
|
4039
|
-
fstart += HOUR
|
|
4040
|
-
|
|
4041
|
-
|
|
4042
|
-
#############################################################################
|
|
4043
|
-
# oddballs
|
|
4044
|
-
|
|
4045
|
-
class Oddballs(unittest.TestCase):
|
|
4046
|
-
|
|
4047
|
-
def test_bug_1028306(self):
|
|
4048
|
-
# Trying to compare a date to a datetime should act like a mixed-
|
|
4049
|
-
# type comparison, despite that datetime is a subclass of date.
|
|
4050
|
-
as_date = date.today()
|
|
4051
|
-
as_datetime = datetime.combine(as_date, time())
|
|
4052
|
-
self.assertTrue(as_date != as_datetime)
|
|
4053
|
-
self.assertTrue(as_datetime != as_date)
|
|
4054
|
-
self.assertFalse(as_date == as_datetime)
|
|
4055
|
-
self.assertFalse(as_datetime == as_date)
|
|
4056
|
-
self.assertRaises(TypeError, lambda: as_date < as_datetime)
|
|
4057
|
-
self.assertRaises(TypeError, lambda: as_datetime < as_date)
|
|
4058
|
-
self.assertRaises(TypeError, lambda: as_date <= as_datetime)
|
|
4059
|
-
self.assertRaises(TypeError, lambda: as_datetime <= as_date)
|
|
4060
|
-
self.assertRaises(TypeError, lambda: as_date > as_datetime)
|
|
4061
|
-
self.assertRaises(TypeError, lambda: as_datetime > as_date)
|
|
4062
|
-
self.assertRaises(TypeError, lambda: as_date >= as_datetime)
|
|
4063
|
-
self.assertRaises(TypeError, lambda: as_datetime >= as_date)
|
|
4064
|
-
|
|
4065
|
-
# Nevertheless, comparison should work with the base-class (date)
|
|
4066
|
-
# projection if use of a date method is forced.
|
|
4067
|
-
self.assertEqual(as_date.__eq__(as_datetime), True)
|
|
4068
|
-
different_day = (as_date.day + 1) % 20 + 1
|
|
4069
|
-
as_different = as_datetime.replace(day= different_day)
|
|
4070
|
-
self.assertEqual(as_date.__eq__(as_different), False)
|
|
4071
|
-
|
|
4072
|
-
# And date should compare with other subclasses of date. If a
|
|
4073
|
-
# subclass wants to stop this, it's up to the subclass to do so.
|
|
4074
|
-
date_sc = SubclassDate(as_date.year, as_date.month, as_date.day)
|
|
4075
|
-
self.assertEqual(as_date, date_sc)
|
|
4076
|
-
self.assertEqual(date_sc, as_date)
|
|
4077
|
-
|
|
4078
|
-
# Ditto for datetimes.
|
|
4079
|
-
datetime_sc = SubclassDatetime(as_datetime.year, as_datetime.month,
|
|
4080
|
-
as_date.day, 0, 0, 0)
|
|
4081
|
-
self.assertEqual(as_datetime, datetime_sc)
|
|
4082
|
-
self.assertEqual(datetime_sc, as_datetime)
|
|
4083
|
-
|
|
4084
|
-
def test_extra_attributes(self):
|
|
4085
|
-
for x in [date.today(),
|
|
4086
|
-
time(),
|
|
4087
|
-
datetime.utcnow(),
|
|
4088
|
-
timedelta(),
|
|
4089
|
-
tzinfo(),
|
|
4090
|
-
timezone(timedelta())]:
|
|
4091
|
-
with self.assertRaises(AttributeError):
|
|
4092
|
-
x.abc = 1
|
|
4093
|
-
|
|
4094
|
-
def test_check_arg_types(self):
|
|
4095
|
-
class Number:
|
|
4096
|
-
def __init__(self, value):
|
|
4097
|
-
self.value = value
|
|
4098
|
-
def __int__(self):
|
|
4099
|
-
return self.value
|
|
4100
|
-
|
|
4101
|
-
for xx in [decimal.Decimal(10),
|
|
4102
|
-
decimal.Decimal('10.9'),
|
|
4103
|
-
Number(10)]:
|
|
4104
|
-
self.assertEqual(datetime(10, 10, 10, 10, 10, 10, 10),
|
|
4105
|
-
datetime(xx, xx, xx, xx, xx, xx, xx))
|
|
4106
|
-
|
|
4107
|
-
with self.assertRaisesRegex(TypeError, '^an integer is required '
|
|
4108
|
-
r'\(got type str\)$'):
|
|
4109
|
-
datetime(10, 10, '10')
|
|
4110
|
-
|
|
4111
|
-
f10 = Number(10.9)
|
|
4112
|
-
with self.assertRaisesRegex(TypeError, '^__int__ returned non-int '
|
|
4113
|
-
r'\(type float\)$'):
|
|
4114
|
-
datetime(10, 10, f10)
|
|
4115
|
-
|
|
4116
|
-
class Float(float):
|
|
4117
|
-
pass
|
|
4118
|
-
s10 = Float(10.9)
|
|
4119
|
-
with self.assertRaisesRegex(TypeError, '^integer argument expected, '
|
|
4120
|
-
'got float$'):
|
|
4121
|
-
datetime(10, 10, s10)
|
|
4122
|
-
|
|
4123
|
-
with self.assertRaises(TypeError):
|
|
4124
|
-
datetime(10., 10, 10)
|
|
4125
|
-
with self.assertRaises(TypeError):
|
|
4126
|
-
datetime(10, 10., 10)
|
|
4127
|
-
with self.assertRaises(TypeError):
|
|
4128
|
-
datetime(10, 10, 10.)
|
|
4129
|
-
with self.assertRaises(TypeError):
|
|
4130
|
-
datetime(10, 10, 10, 10.)
|
|
4131
|
-
with self.assertRaises(TypeError):
|
|
4132
|
-
datetime(10, 10, 10, 10, 10.)
|
|
4133
|
-
with self.assertRaises(TypeError):
|
|
4134
|
-
datetime(10, 10, 10, 10, 10, 10.)
|
|
4135
|
-
with self.assertRaises(TypeError):
|
|
4136
|
-
datetime(10, 10, 10, 10, 10, 10, 10.)
|
|
4137
|
-
|
|
4138
|
-
#############################################################################
|
|
4139
|
-
# Local Time Disambiguation
|
|
4140
|
-
|
|
4141
|
-
# An experimental reimplementation of fromutc that respects the "fold" flag.
|
|
4142
|
-
|
|
4143
|
-
class tzinfo2(tzinfo):
|
|
4144
|
-
|
|
4145
|
-
def fromutc(self, dt):
|
|
4146
|
-
"datetime in UTC -> datetime in local time."
|
|
4147
|
-
|
|
4148
|
-
if not isinstance(dt, datetime):
|
|
4149
|
-
raise TypeError("fromutc() requires a datetime argument")
|
|
4150
|
-
if dt.tzinfo is not self:
|
|
4151
|
-
raise ValueError("dt.tzinfo is not self")
|
|
4152
|
-
# Returned value satisfies
|
|
4153
|
-
# dt + ldt.utcoffset() = ldt
|
|
4154
|
-
off0 = dt.replace(fold=0).utcoffset()
|
|
4155
|
-
off1 = dt.replace(fold=1).utcoffset()
|
|
4156
|
-
if off0 is None or off1 is None or dt.dst() is None:
|
|
4157
|
-
raise ValueError
|
|
4158
|
-
if off0 == off1:
|
|
4159
|
-
ldt = dt + off0
|
|
4160
|
-
off1 = ldt.utcoffset()
|
|
4161
|
-
if off0 == off1:
|
|
4162
|
-
return ldt
|
|
4163
|
-
# Now, we discovered both possible offsets, so
|
|
4164
|
-
# we can just try four possible solutions:
|
|
4165
|
-
for off in [off0, off1]:
|
|
4166
|
-
ldt = dt + off
|
|
4167
|
-
if ldt.utcoffset() == off:
|
|
4168
|
-
return ldt
|
|
4169
|
-
ldt = ldt.replace(fold=1)
|
|
4170
|
-
if ldt.utcoffset() == off:
|
|
4171
|
-
return ldt
|
|
4172
|
-
|
|
4173
|
-
raise ValueError("No suitable local time found")
|
|
4174
|
-
|
|
4175
|
-
# Reimplementing simplified US timezones to respect the "fold" flag:
|
|
4176
|
-
|
|
4177
|
-
class USTimeZone2(tzinfo2):
|
|
4178
|
-
|
|
4179
|
-
def __init__(self, hours, reprname, stdname, dstname):
|
|
4180
|
-
self.stdoffset = timedelta(hours=hours)
|
|
4181
|
-
self.reprname = reprname
|
|
4182
|
-
self.stdname = stdname
|
|
4183
|
-
self.dstname = dstname
|
|
4184
|
-
|
|
4185
|
-
def __repr__(self):
|
|
4186
|
-
return self.reprname
|
|
4187
|
-
|
|
4188
|
-
def tzname(self, dt):
|
|
4189
|
-
if self.dst(dt):
|
|
4190
|
-
return self.dstname
|
|
4191
|
-
else:
|
|
4192
|
-
return self.stdname
|
|
4193
|
-
|
|
4194
|
-
def utcoffset(self, dt):
|
|
4195
|
-
return self.stdoffset + self.dst(dt)
|
|
4196
|
-
|
|
4197
|
-
def dst(self, dt):
|
|
4198
|
-
if dt is None or dt.tzinfo is None:
|
|
4199
|
-
# An exception instead may be sensible here, in one or more of
|
|
4200
|
-
# the cases.
|
|
4201
|
-
return ZERO
|
|
4202
|
-
assert dt.tzinfo is self
|
|
4203
|
-
|
|
4204
|
-
# Find first Sunday in April.
|
|
4205
|
-
start = first_sunday_on_or_after(DSTSTART.replace(year=dt.year))
|
|
4206
|
-
assert start.weekday() == 6 and start.month == 4 and start.day <= 7
|
|
4207
|
-
|
|
4208
|
-
# Find last Sunday in October.
|
|
4209
|
-
end = first_sunday_on_or_after(DSTEND.replace(year=dt.year))
|
|
4210
|
-
assert end.weekday() == 6 and end.month == 10 and end.day >= 25
|
|
4211
|
-
|
|
4212
|
-
# Can't compare naive to aware objects, so strip the timezone from
|
|
4213
|
-
# dt first.
|
|
4214
|
-
dt = dt.replace(tzinfo=None)
|
|
4215
|
-
if start + HOUR <= dt < end:
|
|
4216
|
-
# DST is in effect.
|
|
4217
|
-
return HOUR
|
|
4218
|
-
elif end <= dt < end + HOUR:
|
|
4219
|
-
# Fold (an ambiguous hour): use dt.fold to disambiguate.
|
|
4220
|
-
return ZERO if dt.fold else HOUR
|
|
4221
|
-
elif start <= dt < start + HOUR:
|
|
4222
|
-
# Gap (a non-existent hour): reverse the fold rule.
|
|
4223
|
-
return HOUR if dt.fold else ZERO
|
|
4224
|
-
else:
|
|
4225
|
-
# DST is off.
|
|
4226
|
-
return ZERO
|
|
4227
|
-
|
|
4228
|
-
Eastern2 = USTimeZone2(-5, "Eastern2", "EST", "EDT")
|
|
4229
|
-
Central2 = USTimeZone2(-6, "Central2", "CST", "CDT")
|
|
4230
|
-
Mountain2 = USTimeZone2(-7, "Mountain2", "MST", "MDT")
|
|
4231
|
-
Pacific2 = USTimeZone2(-8, "Pacific2", "PST", "PDT")
|
|
4232
|
-
|
|
4233
|
-
# Europe_Vilnius_1941 tzinfo implementation reproduces the following
|
|
4234
|
-
# 1941 transition from Olson's tzdist:
|
|
4235
|
-
#
|
|
4236
|
-
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
|
|
4237
|
-
# ZoneEurope/Vilnius 1:00 - CET 1940 Aug 3
|
|
4238
|
-
# 3:00 - MSK 1941 Jun 24
|
|
4239
|
-
# 1:00 C-Eur CE%sT 1944 Aug
|
|
4240
|
-
#
|
|
4241
|
-
# $ zdump -v Europe/Vilnius | grep 1941
|
|
4242
|
-
# Europe/Vilnius Mon Jun 23 20:59:59 1941 UTC = Mon Jun 23 23:59:59 1941 MSK isdst=0 gmtoff=10800
|
|
4243
|
-
# Europe/Vilnius Mon Jun 23 21:00:00 1941 UTC = Mon Jun 23 23:00:00 1941 CEST isdst=1 gmtoff=7200
|
|
4244
|
-
|
|
4245
|
-
class Europe_Vilnius_1941(tzinfo):
|
|
4246
|
-
def _utc_fold(self):
|
|
4247
|
-
return [datetime(1941, 6, 23, 21, tzinfo=self), # Mon Jun 23 21:00:00 1941 UTC
|
|
4248
|
-
datetime(1941, 6, 23, 22, tzinfo=self)] # Mon Jun 23 22:00:00 1941 UTC
|
|
4249
|
-
|
|
4250
|
-
def _loc_fold(self):
|
|
4251
|
-
return [datetime(1941, 6, 23, 23, tzinfo=self), # Mon Jun 23 23:00:00 1941 MSK / CEST
|
|
4252
|
-
datetime(1941, 6, 24, 0, tzinfo=self)] # Mon Jun 24 00:00:00 1941 CEST
|
|
4253
|
-
|
|
4254
|
-
def utcoffset(self, dt):
|
|
4255
|
-
fold_start, fold_stop = self._loc_fold()
|
|
4256
|
-
if dt < fold_start:
|
|
4257
|
-
return 3 * HOUR
|
|
4258
|
-
if dt < fold_stop:
|
|
4259
|
-
return (2 if dt.fold else 3) * HOUR
|
|
4260
|
-
# if dt >= fold_stop
|
|
4261
|
-
return 2 * HOUR
|
|
4262
|
-
|
|
4263
|
-
def dst(self, dt):
|
|
4264
|
-
fold_start, fold_stop = self._loc_fold()
|
|
4265
|
-
if dt < fold_start:
|
|
4266
|
-
return 0 * HOUR
|
|
4267
|
-
if dt < fold_stop:
|
|
4268
|
-
return (1 if dt.fold else 0) * HOUR
|
|
4269
|
-
# if dt >= fold_stop
|
|
4270
|
-
return 1 * HOUR
|
|
4271
|
-
|
|
4272
|
-
def tzname(self, dt):
|
|
4273
|
-
fold_start, fold_stop = self._loc_fold()
|
|
4274
|
-
if dt < fold_start:
|
|
4275
|
-
return 'MSK'
|
|
4276
|
-
if dt < fold_stop:
|
|
4277
|
-
return ('MSK', 'CEST')[dt.fold]
|
|
4278
|
-
# if dt >= fold_stop
|
|
4279
|
-
return 'CEST'
|
|
4280
|
-
|
|
4281
|
-
def fromutc(self, dt):
|
|
4282
|
-
assert dt.fold == 0
|
|
4283
|
-
assert dt.tzinfo is self
|
|
4284
|
-
if dt.year != 1941:
|
|
4285
|
-
raise NotImplementedError
|
|
4286
|
-
fold_start, fold_stop = self._utc_fold()
|
|
4287
|
-
if dt < fold_start:
|
|
4288
|
-
return dt + 3 * HOUR
|
|
4289
|
-
if dt < fold_stop:
|
|
4290
|
-
return (dt + 2 * HOUR).replace(fold=1)
|
|
4291
|
-
# if dt >= fold_stop
|
|
4292
|
-
return dt + 2 * HOUR
|
|
4293
|
-
|
|
4294
|
-
|
|
4295
|
-
class TestLocalTimeDisambiguation(unittest.TestCase):
|
|
4296
|
-
|
|
4297
|
-
def test_vilnius_1941_fromutc(self):
|
|
4298
|
-
Vilnius = Europe_Vilnius_1941()
|
|
4299
|
-
|
|
4300
|
-
gdt = datetime(1941, 6, 23, 20, 59, 59, tzinfo=timezone.utc)
|
|
4301
|
-
ldt = gdt.astimezone(Vilnius)
|
|
4302
|
-
self.assertEqual(ldt.strftime("%c %Z%z"),
|
|
4303
|
-
'Mon Jun 23 23:59:59 1941 MSK+0300')
|
|
4304
|
-
self.assertEqual(ldt.fold, 0)
|
|
4305
|
-
self.assertFalse(ldt.dst())
|
|
4306
|
-
|
|
4307
|
-
gdt = datetime(1941, 6, 23, 21, tzinfo=timezone.utc)
|
|
4308
|
-
ldt = gdt.astimezone(Vilnius)
|
|
4309
|
-
self.assertEqual(ldt.strftime("%c %Z%z"),
|
|
4310
|
-
'Mon Jun 23 23:00:00 1941 CEST+0200')
|
|
4311
|
-
self.assertEqual(ldt.fold, 1)
|
|
4312
|
-
self.assertTrue(ldt.dst())
|
|
4313
|
-
|
|
4314
|
-
gdt = datetime(1941, 6, 23, 22, tzinfo=timezone.utc)
|
|
4315
|
-
ldt = gdt.astimezone(Vilnius)
|
|
4316
|
-
self.assertEqual(ldt.strftime("%c %Z%z"),
|
|
4317
|
-
'Tue Jun 24 00:00:00 1941 CEST+0200')
|
|
4318
|
-
self.assertEqual(ldt.fold, 0)
|
|
4319
|
-
self.assertTrue(ldt.dst())
|
|
4320
|
-
|
|
4321
|
-
def test_vilnius_1941_toutc(self):
|
|
4322
|
-
Vilnius = Europe_Vilnius_1941()
|
|
4323
|
-
|
|
4324
|
-
ldt = datetime(1941, 6, 23, 22, 59, 59, tzinfo=Vilnius)
|
|
4325
|
-
gdt = ldt.astimezone(timezone.utc)
|
|
4326
|
-
self.assertEqual(gdt.strftime("%c %Z"),
|
|
4327
|
-
'Mon Jun 23 19:59:59 1941 UTC')
|
|
4328
|
-
|
|
4329
|
-
ldt = datetime(1941, 6, 23, 23, 59, 59, tzinfo=Vilnius)
|
|
4330
|
-
gdt = ldt.astimezone(timezone.utc)
|
|
4331
|
-
self.assertEqual(gdt.strftime("%c %Z"),
|
|
4332
|
-
'Mon Jun 23 20:59:59 1941 UTC')
|
|
4333
|
-
|
|
4334
|
-
ldt = datetime(1941, 6, 23, 23, 59, 59, tzinfo=Vilnius, fold=1)
|
|
4335
|
-
gdt = ldt.astimezone(timezone.utc)
|
|
4336
|
-
self.assertEqual(gdt.strftime("%c %Z"),
|
|
4337
|
-
'Mon Jun 23 21:59:59 1941 UTC')
|
|
4338
|
-
|
|
4339
|
-
ldt = datetime(1941, 6, 24, 0, tzinfo=Vilnius)
|
|
4340
|
-
gdt = ldt.astimezone(timezone.utc)
|
|
4341
|
-
self.assertEqual(gdt.strftime("%c %Z"),
|
|
4342
|
-
'Mon Jun 23 22:00:00 1941 UTC')
|
|
4343
|
-
|
|
4344
|
-
|
|
4345
|
-
def test_constructors(self):
|
|
4346
|
-
t = time(0, fold=1)
|
|
4347
|
-
dt = datetime(1, 1, 1, fold=1)
|
|
4348
|
-
self.assertEqual(t.fold, 1)
|
|
4349
|
-
self.assertEqual(dt.fold, 1)
|
|
4350
|
-
with self.assertRaises(TypeError):
|
|
4351
|
-
time(0, 0, 0, 0, None, 0)
|
|
4352
|
-
|
|
4353
|
-
def test_member(self):
|
|
4354
|
-
dt = datetime(1, 1, 1, fold=1)
|
|
4355
|
-
t = dt.time()
|
|
4356
|
-
self.assertEqual(t.fold, 1)
|
|
4357
|
-
t = dt.timetz()
|
|
4358
|
-
self.assertEqual(t.fold, 1)
|
|
4359
|
-
|
|
4360
|
-
def test_replace(self):
|
|
4361
|
-
t = time(0)
|
|
4362
|
-
dt = datetime(1, 1, 1)
|
|
4363
|
-
self.assertEqual(t.replace(fold=1).fold, 1)
|
|
4364
|
-
self.assertEqual(dt.replace(fold=1).fold, 1)
|
|
4365
|
-
self.assertEqual(t.replace(fold=0).fold, 0)
|
|
4366
|
-
self.assertEqual(dt.replace(fold=0).fold, 0)
|
|
4367
|
-
# Check that replacement of other fields does not change "fold".
|
|
4368
|
-
t = t.replace(fold=1, tzinfo=Eastern)
|
|
4369
|
-
dt = dt.replace(fold=1, tzinfo=Eastern)
|
|
4370
|
-
self.assertEqual(t.replace(tzinfo=None).fold, 1)
|
|
4371
|
-
self.assertEqual(dt.replace(tzinfo=None).fold, 1)
|
|
4372
|
-
# Out of bounds.
|
|
4373
|
-
with self.assertRaises(ValueError):
|
|
4374
|
-
t.replace(fold=2)
|
|
4375
|
-
with self.assertRaises(ValueError):
|
|
4376
|
-
dt.replace(fold=2)
|
|
4377
|
-
# Check that fold is a keyword-only argument
|
|
4378
|
-
with self.assertRaises(TypeError):
|
|
4379
|
-
t.replace(1, 1, 1, None, 1)
|
|
4380
|
-
with self.assertRaises(TypeError):
|
|
4381
|
-
dt.replace(1, 1, 1, 1, 1, 1, 1, None, 1)
|
|
4382
|
-
|
|
4383
|
-
def test_comparison(self):
|
|
4384
|
-
t = time(0)
|
|
4385
|
-
dt = datetime(1, 1, 1)
|
|
4386
|
-
self.assertEqual(t, t.replace(fold=1))
|
|
4387
|
-
self.assertEqual(dt, dt.replace(fold=1))
|
|
4388
|
-
|
|
4389
|
-
def test_hash(self):
|
|
4390
|
-
t = time(0)
|
|
4391
|
-
dt = datetime(1, 1, 1)
|
|
4392
|
-
self.assertEqual(hash(t), hash(t.replace(fold=1)))
|
|
4393
|
-
self.assertEqual(hash(dt), hash(dt.replace(fold=1)))
|
|
4394
|
-
|
|
4395
|
-
@support.run_with_tz('EST+05EDT,M3.2.0,M11.1.0')
|
|
4396
|
-
def test_fromtimestamp(self):
|
|
4397
|
-
s = 1414906200
|
|
4398
|
-
dt0 = datetime.fromtimestamp(s)
|
|
4399
|
-
dt1 = datetime.fromtimestamp(s + 3600)
|
|
4400
|
-
self.assertEqual(dt0.fold, 0)
|
|
4401
|
-
self.assertEqual(dt1.fold, 1)
|
|
4402
|
-
|
|
4403
|
-
@support.run_with_tz('Australia/Lord_Howe')
|
|
4404
|
-
def test_fromtimestamp_lord_howe(self):
|
|
4405
|
-
tm = _time.localtime(1.4e9)
|
|
4406
|
-
if _time.strftime('%Z%z', tm) != 'LHST+1030':
|
|
4407
|
-
self.skipTest('Australia/Lord_Howe timezone is not supported on this platform')
|
|
4408
|
-
# $ TZ=Australia/Lord_Howe date -r 1428158700
|
|
4409
|
-
# Sun Apr 5 01:45:00 LHDT 2015
|
|
4410
|
-
# $ TZ=Australia/Lord_Howe date -r 1428160500
|
|
4411
|
-
# Sun Apr 5 01:45:00 LHST 2015
|
|
4412
|
-
s = 1428158700
|
|
4413
|
-
t0 = datetime.fromtimestamp(s)
|
|
4414
|
-
t1 = datetime.fromtimestamp(s + 1800)
|
|
4415
|
-
self.assertEqual(t0, t1)
|
|
4416
|
-
self.assertEqual(t0.fold, 0)
|
|
4417
|
-
self.assertEqual(t1.fold, 1)
|
|
4418
|
-
|
|
4419
|
-
|
|
4420
|
-
@support.run_with_tz('EST+05EDT,M3.2.0,M11.1.0')
|
|
4421
|
-
def test_timestamp(self):
|
|
4422
|
-
dt0 = datetime(2014, 11, 2, 1, 30)
|
|
4423
|
-
dt1 = dt0.replace(fold=1)
|
|
4424
|
-
self.assertEqual(dt0.timestamp() + 3600,
|
|
4425
|
-
dt1.timestamp())
|
|
4426
|
-
|
|
4427
|
-
@support.run_with_tz('Australia/Lord_Howe')
|
|
4428
|
-
def test_timestamp_lord_howe(self):
|
|
4429
|
-
tm = _time.localtime(1.4e9)
|
|
4430
|
-
if _time.strftime('%Z%z', tm) != 'LHST+1030':
|
|
4431
|
-
self.skipTest('Australia/Lord_Howe timezone is not supported on this platform')
|
|
4432
|
-
t = datetime(2015, 4, 5, 1, 45)
|
|
4433
|
-
s0 = t.replace(fold=0).timestamp()
|
|
4434
|
-
s1 = t.replace(fold=1).timestamp()
|
|
4435
|
-
self.assertEqual(s0 + 1800, s1)
|
|
4436
|
-
|
|
4437
|
-
|
|
4438
|
-
@support.run_with_tz('EST+05EDT,M3.2.0,M11.1.0')
|
|
4439
|
-
def test_astimezone(self):
|
|
4440
|
-
dt0 = datetime(2014, 11, 2, 1, 30)
|
|
4441
|
-
dt1 = dt0.replace(fold=1)
|
|
4442
|
-
# Convert both naive instances to aware.
|
|
4443
|
-
adt0 = dt0.astimezone()
|
|
4444
|
-
adt1 = dt1.astimezone()
|
|
4445
|
-
# Check that the first instance in DST zone and the second in STD
|
|
4446
|
-
self.assertEqual(adt0.tzname(), 'EDT')
|
|
4447
|
-
self.assertEqual(adt1.tzname(), 'EST')
|
|
4448
|
-
self.assertEqual(adt0 + HOUR, adt1)
|
|
4449
|
-
# Aware instances with fixed offset tzinfo's always have fold=0
|
|
4450
|
-
self.assertEqual(adt0.fold, 0)
|
|
4451
|
-
self.assertEqual(adt1.fold, 0)
|
|
4452
|
-
|
|
4453
|
-
|
|
4454
|
-
def test_pickle_fold(self):
|
|
4455
|
-
t = time(fold=1)
|
|
4456
|
-
dt = datetime(1, 1, 1, fold=1)
|
|
4457
|
-
for pickler, unpickler, proto in pickle_choices:
|
|
4458
|
-
for x in [t, dt]:
|
|
4459
|
-
s = pickler.dumps(x, proto)
|
|
4460
|
-
y = unpickler.loads(s)
|
|
4461
|
-
self.assertEqual(x, y)
|
|
4462
|
-
self.assertEqual((0 if proto < 4 else x.fold), y.fold)
|
|
4463
|
-
|
|
4464
|
-
def test_repr(self):
|
|
4465
|
-
t = time(fold=1)
|
|
4466
|
-
dt = datetime(1, 1, 1, fold=1)
|
|
4467
|
-
self.assertEqual(repr(t), 'datetime.time(0, 0, fold=1)')
|
|
4468
|
-
self.assertEqual(repr(dt),
|
|
4469
|
-
'datetime.datetime(1, 1, 1, 0, 0, fold=1)')
|
|
4470
|
-
|
|
4471
|
-
def test_dst(self):
|
|
4472
|
-
# Let's first establish that things work in regular times.
|
|
4473
|
-
dt_summer = datetime(2002, 10, 27, 1, tzinfo=Eastern2) - timedelta.resolution
|
|
4474
|
-
dt_winter = datetime(2002, 10, 27, 2, tzinfo=Eastern2)
|
|
4475
|
-
self.assertEqual(dt_summer.dst(), HOUR)
|
|
4476
|
-
self.assertEqual(dt_winter.dst(), ZERO)
|
|
4477
|
-
# The disambiguation flag is ignored
|
|
4478
|
-
self.assertEqual(dt_summer.replace(fold=1).dst(), HOUR)
|
|
4479
|
-
self.assertEqual(dt_winter.replace(fold=1).dst(), ZERO)
|
|
4480
|
-
|
|
4481
|
-
# Pick local time in the fold.
|
|
4482
|
-
for minute in [0, 30, 59]:
|
|
4483
|
-
dt = datetime(2002, 10, 27, 1, minute, tzinfo=Eastern2)
|
|
4484
|
-
# With fold=0 (the default) it is in DST.
|
|
4485
|
-
self.assertEqual(dt.dst(), HOUR)
|
|
4486
|
-
# With fold=1 it is in STD.
|
|
4487
|
-
self.assertEqual(dt.replace(fold=1).dst(), ZERO)
|
|
4488
|
-
|
|
4489
|
-
# Pick local time in the gap.
|
|
4490
|
-
for minute in [0, 30, 59]:
|
|
4491
|
-
dt = datetime(2002, 4, 7, 2, minute, tzinfo=Eastern2)
|
|
4492
|
-
# With fold=0 (the default) it is in STD.
|
|
4493
|
-
self.assertEqual(dt.dst(), ZERO)
|
|
4494
|
-
# With fold=1 it is in DST.
|
|
4495
|
-
self.assertEqual(dt.replace(fold=1).dst(), HOUR)
|
|
4496
|
-
|
|
4497
|
-
|
|
4498
|
-
def test_utcoffset(self):
|
|
4499
|
-
# Let's first establish that things work in regular times.
|
|
4500
|
-
dt_summer = datetime(2002, 10, 27, 1, tzinfo=Eastern2) - timedelta.resolution
|
|
4501
|
-
dt_winter = datetime(2002, 10, 27, 2, tzinfo=Eastern2)
|
|
4502
|
-
self.assertEqual(dt_summer.utcoffset(), -4 * HOUR)
|
|
4503
|
-
self.assertEqual(dt_winter.utcoffset(), -5 * HOUR)
|
|
4504
|
-
# The disambiguation flag is ignored
|
|
4505
|
-
self.assertEqual(dt_summer.replace(fold=1).utcoffset(), -4 * HOUR)
|
|
4506
|
-
self.assertEqual(dt_winter.replace(fold=1).utcoffset(), -5 * HOUR)
|
|
4507
|
-
|
|
4508
|
-
def test_fromutc(self):
|
|
4509
|
-
# Let's first establish that things work in regular times.
|
|
4510
|
-
u_summer = datetime(2002, 10, 27, 6, tzinfo=Eastern2) - timedelta.resolution
|
|
4511
|
-
u_winter = datetime(2002, 10, 27, 7, tzinfo=Eastern2)
|
|
4512
|
-
t_summer = Eastern2.fromutc(u_summer)
|
|
4513
|
-
t_winter = Eastern2.fromutc(u_winter)
|
|
4514
|
-
self.assertEqual(t_summer, u_summer - 4 * HOUR)
|
|
4515
|
-
self.assertEqual(t_winter, u_winter - 5 * HOUR)
|
|
4516
|
-
self.assertEqual(t_summer.fold, 0)
|
|
4517
|
-
self.assertEqual(t_winter.fold, 0)
|
|
4518
|
-
|
|
4519
|
-
# What happens in the fall-back fold?
|
|
4520
|
-
u = datetime(2002, 10, 27, 5, 30, tzinfo=Eastern2)
|
|
4521
|
-
t0 = Eastern2.fromutc(u)
|
|
4522
|
-
u += HOUR
|
|
4523
|
-
t1 = Eastern2.fromutc(u)
|
|
4524
|
-
self.assertEqual(t0, t1)
|
|
4525
|
-
self.assertEqual(t0.fold, 0)
|
|
4526
|
-
self.assertEqual(t1.fold, 1)
|
|
4527
|
-
# The tricky part is when u is in the local fold:
|
|
4528
|
-
u = datetime(2002, 10, 27, 1, 30, tzinfo=Eastern2)
|
|
4529
|
-
t = Eastern2.fromutc(u)
|
|
4530
|
-
self.assertEqual((t.day, t.hour), (26, 21))
|
|
4531
|
-
# .. or gets into the local fold after a standard time adjustment
|
|
4532
|
-
u = datetime(2002, 10, 27, 6, 30, tzinfo=Eastern2)
|
|
4533
|
-
t = Eastern2.fromutc(u)
|
|
4534
|
-
self.assertEqual((t.day, t.hour), (27, 1))
|
|
4535
|
-
|
|
4536
|
-
# What happens in the spring-forward gap?
|
|
4537
|
-
u = datetime(2002, 4, 7, 2, 0, tzinfo=Eastern2)
|
|
4538
|
-
t = Eastern2.fromutc(u)
|
|
4539
|
-
self.assertEqual((t.day, t.hour), (6, 21))
|
|
4540
|
-
|
|
4541
|
-
def test_mixed_compare_regular(self):
|
|
4542
|
-
t = datetime(2000, 1, 1, tzinfo=Eastern2)
|
|
4543
|
-
self.assertEqual(t, t.astimezone(timezone.utc))
|
|
4544
|
-
t = datetime(2000, 6, 1, tzinfo=Eastern2)
|
|
4545
|
-
self.assertEqual(t, t.astimezone(timezone.utc))
|
|
4546
|
-
|
|
4547
|
-
def test_mixed_compare_fold(self):
|
|
4548
|
-
t_fold = datetime(2002, 10, 27, 1, 45, tzinfo=Eastern2)
|
|
4549
|
-
t_fold_utc = t_fold.astimezone(timezone.utc)
|
|
4550
|
-
self.assertNotEqual(t_fold, t_fold_utc)
|
|
4551
|
-
|
|
4552
|
-
def test_mixed_compare_gap(self):
|
|
4553
|
-
t_gap = datetime(2002, 4, 7, 2, 45, tzinfo=Eastern2)
|
|
4554
|
-
t_gap_utc = t_gap.astimezone(timezone.utc)
|
|
4555
|
-
self.assertNotEqual(t_gap, t_gap_utc)
|
|
4556
|
-
|
|
4557
|
-
def test_hash_aware(self):
|
|
4558
|
-
t = datetime(2000, 1, 1, tzinfo=Eastern2)
|
|
4559
|
-
self.assertEqual(hash(t), hash(t.replace(fold=1)))
|
|
4560
|
-
t_fold = datetime(2002, 10, 27, 1, 45, tzinfo=Eastern2)
|
|
4561
|
-
t_gap = datetime(2002, 4, 7, 2, 45, tzinfo=Eastern2)
|
|
4562
|
-
self.assertEqual(hash(t_fold), hash(t_fold.replace(fold=1)))
|
|
4563
|
-
self.assertEqual(hash(t_gap), hash(t_gap.replace(fold=1)))
|
|
4564
|
-
|
|
4565
|
-
SEC = timedelta(0, 1)
|
|
4566
|
-
|
|
4567
|
-
def pairs(iterable):
|
|
4568
|
-
a, b = itertools.tee(iterable)
|
|
4569
|
-
next(b, None)
|
|
4570
|
-
return zip(a, b)
|
|
4571
|
-
|
|
4572
|
-
class ZoneInfo(tzinfo):
|
|
4573
|
-
zoneroot = '/usr/share/zoneinfo'
|
|
4574
|
-
def __init__(self, ut, ti):
|
|
4575
|
-
"""
|
|
4576
|
-
|
|
4577
|
-
:param ut: array
|
|
4578
|
-
Array of transition point timestamps
|
|
4579
|
-
:param ti: list
|
|
4580
|
-
A list of (offset, isdst, abbr) tuples
|
|
4581
|
-
:return: None
|
|
4582
|
-
"""
|
|
4583
|
-
self.ut = ut
|
|
4584
|
-
self.ti = ti
|
|
4585
|
-
self.lt = self.invert(ut, ti)
|
|
4586
|
-
|
|
4587
|
-
@staticmethod
|
|
4588
|
-
def invert(ut, ti):
|
|
4589
|
-
lt = (array('q', ut), array('q', ut))
|
|
4590
|
-
if ut:
|
|
4591
|
-
offset = ti[0][0] // SEC
|
|
4592
|
-
lt[0][0] += offset
|
|
4593
|
-
lt[1][0] += offset
|
|
4594
|
-
for i in range(1, len(ut)):
|
|
4595
|
-
lt[0][i] += ti[i-1][0] // SEC
|
|
4596
|
-
lt[1][i] += ti[i][0] // SEC
|
|
4597
|
-
return lt
|
|
4598
|
-
|
|
4599
|
-
@classmethod
|
|
4600
|
-
def fromfile(cls, fileobj):
|
|
4601
|
-
if fileobj.read(4).decode() != "TZif":
|
|
4602
|
-
raise ValueError("not a zoneinfo file")
|
|
4603
|
-
fileobj.seek(32)
|
|
4604
|
-
counts = array('i')
|
|
4605
|
-
counts.fromfile(fileobj, 3)
|
|
4606
|
-
if sys.byteorder != 'big':
|
|
4607
|
-
counts.byteswap()
|
|
4608
|
-
|
|
4609
|
-
ut = array('i')
|
|
4610
|
-
ut.fromfile(fileobj, counts[0])
|
|
4611
|
-
if sys.byteorder != 'big':
|
|
4612
|
-
ut.byteswap()
|
|
4613
|
-
|
|
4614
|
-
type_indices = array('B')
|
|
4615
|
-
type_indices.fromfile(fileobj, counts[0])
|
|
4616
|
-
|
|
4617
|
-
ttis = []
|
|
4618
|
-
for i in range(counts[1]):
|
|
4619
|
-
ttis.append(struct.unpack(">lbb", fileobj.read(6)))
|
|
4620
|
-
|
|
4621
|
-
abbrs = fileobj.read(counts[2])
|
|
4622
|
-
|
|
4623
|
-
# Convert ttis
|
|
4624
|
-
for i, (gmtoff, isdst, abbrind) in enumerate(ttis):
|
|
4625
|
-
abbr = abbrs[abbrind:abbrs.find(0, abbrind)].decode()
|
|
4626
|
-
ttis[i] = (timedelta(0, gmtoff), isdst, abbr)
|
|
4627
|
-
|
|
4628
|
-
ti = [None] * len(ut)
|
|
4629
|
-
for i, idx in enumerate(type_indices):
|
|
4630
|
-
ti[i] = ttis[idx]
|
|
4631
|
-
|
|
4632
|
-
self = cls(ut, ti)
|
|
4633
|
-
|
|
4634
|
-
return self
|
|
4635
|
-
|
|
4636
|
-
@classmethod
|
|
4637
|
-
def fromname(cls, name):
|
|
4638
|
-
path = os.path.join(cls.zoneroot, name)
|
|
4639
|
-
with open(path, 'rb') as f:
|
|
4640
|
-
return cls.fromfile(f)
|
|
4641
|
-
|
|
4642
|
-
EPOCHORDINAL = date(1970, 1, 1).toordinal()
|
|
4643
|
-
|
|
4644
|
-
def fromutc(self, dt):
|
|
4645
|
-
"""datetime in UTC -> datetime in local time."""
|
|
4646
|
-
|
|
4647
|
-
if not isinstance(dt, datetime):
|
|
4648
|
-
raise TypeError("fromutc() requires a datetime argument")
|
|
4649
|
-
if dt.tzinfo is not self:
|
|
4650
|
-
raise ValueError("dt.tzinfo is not self")
|
|
4651
|
-
|
|
4652
|
-
timestamp = ((dt.toordinal() - self.EPOCHORDINAL) * 86400
|
|
4653
|
-
+ dt.hour * 3600
|
|
4654
|
-
+ dt.minute * 60
|
|
4655
|
-
+ dt.second)
|
|
4656
|
-
|
|
4657
|
-
if timestamp < self.ut[1]:
|
|
4658
|
-
tti = self.ti[0]
|
|
4659
|
-
fold = 0
|
|
4660
|
-
else:
|
|
4661
|
-
idx = bisect.bisect_right(self.ut, timestamp)
|
|
4662
|
-
assert self.ut[idx-1] <= timestamp
|
|
4663
|
-
assert idx == len(self.ut) or timestamp < self.ut[idx]
|
|
4664
|
-
tti_prev, tti = self.ti[idx-2:idx]
|
|
4665
|
-
# Detect fold
|
|
4666
|
-
shift = tti_prev[0] - tti[0]
|
|
4667
|
-
fold = (shift > timedelta(0, timestamp - self.ut[idx-1]))
|
|
4668
|
-
dt += tti[0]
|
|
4669
|
-
if fold:
|
|
4670
|
-
return dt.replace(fold=1)
|
|
4671
|
-
else:
|
|
4672
|
-
return dt
|
|
4673
|
-
|
|
4674
|
-
def _find_ti(self, dt, i):
|
|
4675
|
-
timestamp = ((dt.toordinal() - self.EPOCHORDINAL) * 86400
|
|
4676
|
-
+ dt.hour * 3600
|
|
4677
|
-
+ dt.minute * 60
|
|
4678
|
-
+ dt.second)
|
|
4679
|
-
lt = self.lt[dt.fold]
|
|
4680
|
-
idx = bisect.bisect_right(lt, timestamp)
|
|
4681
|
-
|
|
4682
|
-
return self.ti[max(0, idx - 1)][i]
|
|
4683
|
-
|
|
4684
|
-
def utcoffset(self, dt):
|
|
4685
|
-
return self._find_ti(dt, 0)
|
|
4686
|
-
|
|
4687
|
-
def dst(self, dt):
|
|
4688
|
-
isdst = self._find_ti(dt, 1)
|
|
4689
|
-
# XXX: We cannot accurately determine the "save" value,
|
|
4690
|
-
# so let's return 1h whenever DST is in effect. Since
|
|
4691
|
-
# we don't use dst() in fromutc(), it is unlikely that
|
|
4692
|
-
# it will be needed for anything more than bool(dst()).
|
|
4693
|
-
return ZERO if isdst else HOUR
|
|
4694
|
-
|
|
4695
|
-
def tzname(self, dt):
|
|
4696
|
-
return self._find_ti(dt, 2)
|
|
4697
|
-
|
|
4698
|
-
@classmethod
|
|
4699
|
-
def zonenames(cls, zonedir=None):
|
|
4700
|
-
if zonedir is None:
|
|
4701
|
-
zonedir = cls.zoneroot
|
|
4702
|
-
zone_tab = os.path.join(zonedir, 'zone.tab')
|
|
4703
|
-
try:
|
|
4704
|
-
f = open(zone_tab)
|
|
4705
|
-
except OSError:
|
|
4706
|
-
return
|
|
4707
|
-
with f:
|
|
4708
|
-
for line in f:
|
|
4709
|
-
line = line.strip()
|
|
4710
|
-
if line and not line.startswith('#'):
|
|
4711
|
-
yield line.split()[2]
|
|
4712
|
-
|
|
4713
|
-
@classmethod
|
|
4714
|
-
def stats(cls, start_year=1):
|
|
4715
|
-
count = gap_count = fold_count = zeros_count = 0
|
|
4716
|
-
min_gap = min_fold = timedelta.max
|
|
4717
|
-
max_gap = max_fold = ZERO
|
|
4718
|
-
min_gap_datetime = max_gap_datetime = datetime.min
|
|
4719
|
-
min_gap_zone = max_gap_zone = None
|
|
4720
|
-
min_fold_datetime = max_fold_datetime = datetime.min
|
|
4721
|
-
min_fold_zone = max_fold_zone = None
|
|
4722
|
-
stats_since = datetime(start_year, 1, 1) # Starting from 1970 eliminates a lot of noise
|
|
4723
|
-
for zonename in cls.zonenames():
|
|
4724
|
-
count += 1
|
|
4725
|
-
tz = cls.fromname(zonename)
|
|
4726
|
-
for dt, shift in tz.transitions():
|
|
4727
|
-
if dt < stats_since:
|
|
4728
|
-
continue
|
|
4729
|
-
if shift > ZERO:
|
|
4730
|
-
gap_count += 1
|
|
4731
|
-
if (shift, dt) > (max_gap, max_gap_datetime):
|
|
4732
|
-
max_gap = shift
|
|
4733
|
-
max_gap_zone = zonename
|
|
4734
|
-
max_gap_datetime = dt
|
|
4735
|
-
if (shift, datetime.max - dt) < (min_gap, datetime.max - min_gap_datetime):
|
|
4736
|
-
min_gap = shift
|
|
4737
|
-
min_gap_zone = zonename
|
|
4738
|
-
min_gap_datetime = dt
|
|
4739
|
-
elif shift < ZERO:
|
|
4740
|
-
fold_count += 1
|
|
4741
|
-
shift = -shift
|
|
4742
|
-
if (shift, dt) > (max_fold, max_fold_datetime):
|
|
4743
|
-
max_fold = shift
|
|
4744
|
-
max_fold_zone = zonename
|
|
4745
|
-
max_fold_datetime = dt
|
|
4746
|
-
if (shift, datetime.max - dt) < (min_fold, datetime.max - min_fold_datetime):
|
|
4747
|
-
min_fold = shift
|
|
4748
|
-
min_fold_zone = zonename
|
|
4749
|
-
min_fold_datetime = dt
|
|
4750
|
-
else:
|
|
4751
|
-
zeros_count += 1
|
|
4752
|
-
trans_counts = (gap_count, fold_count, zeros_count)
|
|
4753
|
-
print("Number of zones: %5d" % count)
|
|
4754
|
-
print("Number of transitions: %5d = %d (gaps) + %d (folds) + %d (zeros)" %
|
|
4755
|
-
((sum(trans_counts),) + trans_counts))
|
|
4756
|
-
print("Min gap: %16s at %s in %s" % (min_gap, min_gap_datetime, min_gap_zone))
|
|
4757
|
-
print("Max gap: %16s at %s in %s" % (max_gap, max_gap_datetime, max_gap_zone))
|
|
4758
|
-
print("Min fold: %16s at %s in %s" % (min_fold, min_fold_datetime, min_fold_zone))
|
|
4759
|
-
print("Max fold: %16s at %s in %s" % (max_fold, max_fold_datetime, max_fold_zone))
|
|
4760
|
-
|
|
4761
|
-
|
|
4762
|
-
def transitions(self):
|
|
4763
|
-
for (_, prev_ti), (t, ti) in pairs(zip(self.ut, self.ti)):
|
|
4764
|
-
shift = ti[0] - prev_ti[0]
|
|
4765
|
-
yield datetime.utcfromtimestamp(t), shift
|
|
4766
|
-
|
|
4767
|
-
def nondst_folds(self):
|
|
4768
|
-
"""Find all folds with the same value of isdst on both sides of the transition."""
|
|
4769
|
-
for (_, prev_ti), (t, ti) in pairs(zip(self.ut, self.ti)):
|
|
4770
|
-
shift = ti[0] - prev_ti[0]
|
|
4771
|
-
if shift < ZERO and ti[1] == prev_ti[1]:
|
|
4772
|
-
yield datetime.utcfromtimestamp(t), -shift, prev_ti[2], ti[2]
|
|
4773
|
-
|
|
4774
|
-
@classmethod
|
|
4775
|
-
def print_all_nondst_folds(cls, same_abbr=False, start_year=1):
|
|
4776
|
-
count = 0
|
|
4777
|
-
for zonename in cls.zonenames():
|
|
4778
|
-
tz = cls.fromname(zonename)
|
|
4779
|
-
for dt, shift, prev_abbr, abbr in tz.nondst_folds():
|
|
4780
|
-
if dt.year < start_year or same_abbr and prev_abbr != abbr:
|
|
4781
|
-
continue
|
|
4782
|
-
count += 1
|
|
4783
|
-
print("%3d) %-30s %s %10s %5s -> %s" %
|
|
4784
|
-
(count, zonename, dt, shift, prev_abbr, abbr))
|
|
4785
|
-
|
|
4786
|
-
def folds(self):
|
|
4787
|
-
for t, shift in self.transitions():
|
|
4788
|
-
if shift < ZERO:
|
|
4789
|
-
yield t, -shift
|
|
4790
|
-
|
|
4791
|
-
def gaps(self):
|
|
4792
|
-
for t, shift in self.transitions():
|
|
4793
|
-
if shift > ZERO:
|
|
4794
|
-
yield t, shift
|
|
4795
|
-
|
|
4796
|
-
def zeros(self):
|
|
4797
|
-
for t, shift in self.transitions():
|
|
4798
|
-
if not shift:
|
|
4799
|
-
yield t
|
|
4800
|
-
|
|
4801
|
-
|
|
4802
|
-
class ZoneInfoTest(unittest.TestCase):
|
|
4803
|
-
zonename = 'America/New_York'
|
|
4804
|
-
|
|
4805
|
-
def setUp(self):
|
|
4806
|
-
if sys.platform == "win32":
|
|
4807
|
-
self.skipTest("Skipping zoneinfo tests on Windows")
|
|
4808
|
-
try:
|
|
4809
|
-
self.tz = ZoneInfo.fromname(self.zonename)
|
|
4810
|
-
except FileNotFoundError as err:
|
|
4811
|
-
self.skipTest("Skipping %s: %s" % (self.zonename, err))
|
|
4812
|
-
|
|
4813
|
-
def assertEquivDatetimes(self, a, b):
|
|
4814
|
-
self.assertEqual((a.replace(tzinfo=None), a.fold, id(a.tzinfo)),
|
|
4815
|
-
(b.replace(tzinfo=None), b.fold, id(b.tzinfo)))
|
|
4816
|
-
|
|
4817
|
-
def test_folds(self):
|
|
4818
|
-
tz = self.tz
|
|
4819
|
-
for dt, shift in tz.folds():
|
|
4820
|
-
for x in [0 * shift, 0.5 * shift, shift - timedelta.resolution]:
|
|
4821
|
-
udt = dt + x
|
|
4822
|
-
ldt = tz.fromutc(udt.replace(tzinfo=tz))
|
|
4823
|
-
self.assertEqual(ldt.fold, 1)
|
|
4824
|
-
adt = udt.replace(tzinfo=timezone.utc).astimezone(tz)
|
|
4825
|
-
self.assertEquivDatetimes(adt, ldt)
|
|
4826
|
-
utcoffset = ldt.utcoffset()
|
|
4827
|
-
self.assertEqual(ldt.replace(tzinfo=None), udt + utcoffset)
|
|
4828
|
-
# Round trip
|
|
4829
|
-
self.assertEquivDatetimes(ldt.astimezone(timezone.utc),
|
|
4830
|
-
udt.replace(tzinfo=timezone.utc))
|
|
4831
|
-
|
|
4832
|
-
|
|
4833
|
-
for x in [-timedelta.resolution, shift]:
|
|
4834
|
-
udt = dt + x
|
|
4835
|
-
udt = udt.replace(tzinfo=tz)
|
|
4836
|
-
ldt = tz.fromutc(udt)
|
|
4837
|
-
self.assertEqual(ldt.fold, 0)
|
|
4838
|
-
|
|
4839
|
-
def test_gaps(self):
|
|
4840
|
-
tz = self.tz
|
|
4841
|
-
for dt, shift in tz.gaps():
|
|
4842
|
-
for x in [0 * shift, 0.5 * shift, shift - timedelta.resolution]:
|
|
4843
|
-
udt = dt + x
|
|
4844
|
-
udt = udt.replace(tzinfo=tz)
|
|
4845
|
-
ldt = tz.fromutc(udt)
|
|
4846
|
-
self.assertEqual(ldt.fold, 0)
|
|
4847
|
-
adt = udt.replace(tzinfo=timezone.utc).astimezone(tz)
|
|
4848
|
-
self.assertEquivDatetimes(adt, ldt)
|
|
4849
|
-
utcoffset = ldt.utcoffset()
|
|
4850
|
-
self.assertEqual(ldt.replace(tzinfo=None), udt.replace(tzinfo=None) + utcoffset)
|
|
4851
|
-
# Create a local time inside the gap
|
|
4852
|
-
ldt = tz.fromutc(dt.replace(tzinfo=tz)) - shift + x
|
|
4853
|
-
self.assertLess(ldt.replace(fold=1).utcoffset(),
|
|
4854
|
-
ldt.replace(fold=0).utcoffset(),
|
|
4855
|
-
"At %s." % ldt)
|
|
4856
|
-
|
|
4857
|
-
for x in [-timedelta.resolution, shift]:
|
|
4858
|
-
udt = dt + x
|
|
4859
|
-
ldt = tz.fromutc(udt.replace(tzinfo=tz))
|
|
4860
|
-
self.assertEqual(ldt.fold, 0)
|
|
4861
|
-
|
|
4862
|
-
def test_system_transitions(self):
|
|
4863
|
-
if ('Riyadh8' in self.zonename or
|
|
4864
|
-
# From tzdata NEWS file:
|
|
4865
|
-
# The files solar87, solar88, and solar89 are no longer distributed.
|
|
4866
|
-
# They were a negative experiment - that is, a demonstration that
|
|
4867
|
-
# tz data can represent solar time only with some difficulty and error.
|
|
4868
|
-
# Their presence in the distribution caused confusion, as Riyadh
|
|
4869
|
-
# civil time was generally not solar time in those years.
|
|
4870
|
-
self.zonename.startswith('right/')):
|
|
4871
|
-
self.skipTest("Skipping %s" % self.zonename)
|
|
4872
|
-
tz = self.tz
|
|
4873
|
-
TZ = os.environ.get('TZ')
|
|
4874
|
-
os.environ['TZ'] = self.zonename
|
|
4875
|
-
try:
|
|
4876
|
-
_time.tzset()
|
|
4877
|
-
for udt, shift in tz.transitions():
|
|
4878
|
-
if udt.year >= 2037:
|
|
4879
|
-
# System support for times around the end of 32-bit time_t
|
|
4880
|
-
# and later is flaky on many systems.
|
|
4881
|
-
break
|
|
4882
|
-
s0 = (udt - datetime(1970, 1, 1)) // SEC
|
|
4883
|
-
ss = shift // SEC # shift seconds
|
|
4884
|
-
for x in [-40 * 3600, -20*3600, -1, 0,
|
|
4885
|
-
ss - 1, ss + 20 * 3600, ss + 40 * 3600]:
|
|
4886
|
-
s = s0 + x
|
|
4887
|
-
sdt = datetime.fromtimestamp(s)
|
|
4888
|
-
tzdt = datetime.fromtimestamp(s, tz).replace(tzinfo=None)
|
|
4889
|
-
self.assertEquivDatetimes(sdt, tzdt)
|
|
4890
|
-
s1 = sdt.timestamp()
|
|
4891
|
-
self.assertEqual(s, s1)
|
|
4892
|
-
if ss > 0: # gap
|
|
4893
|
-
# Create local time inside the gap
|
|
4894
|
-
dt = datetime.fromtimestamp(s0) - shift / 2
|
|
4895
|
-
ts0 = dt.timestamp()
|
|
4896
|
-
ts1 = dt.replace(fold=1).timestamp()
|
|
4897
|
-
self.assertEqual(ts0, s0 + ss / 2)
|
|
4898
|
-
self.assertEqual(ts1, s0 - ss / 2)
|
|
4899
|
-
finally:
|
|
4900
|
-
if TZ is None:
|
|
4901
|
-
del os.environ['TZ']
|
|
4902
|
-
else:
|
|
4903
|
-
os.environ['TZ'] = TZ
|
|
4904
|
-
_time.tzset()
|
|
4905
|
-
|
|
4906
|
-
|
|
4907
|
-
class ZoneInfoCompleteTest(unittest.TestSuite):
|
|
4908
|
-
def __init__(self):
|
|
4909
|
-
tests = []
|
|
4910
|
-
if is_resource_enabled('tzdata'):
|
|
4911
|
-
for name in ZoneInfo.zonenames():
|
|
4912
|
-
Test = type('ZoneInfoTest[%s]' % name, (ZoneInfoTest,), {})
|
|
4913
|
-
Test.zonename = name
|
|
4914
|
-
for method in dir(Test):
|
|
4915
|
-
if method.startswith('test_'):
|
|
4916
|
-
tests.append(Test(method))
|
|
4917
|
-
super().__init__(tests)
|
|
4918
|
-
|
|
4919
|
-
# Iran had a sub-minute UTC offset before 1946.
|
|
4920
|
-
class IranTest(ZoneInfoTest):
|
|
4921
|
-
zonename = 'Asia/Tehran'
|
|
4922
|
-
|
|
4923
|
-
def load_tests(loader, standard_tests, pattern):
|
|
4924
|
-
standard_tests.addTest(ZoneInfoCompleteTest())
|
|
4925
|
-
return standard_tests
|
|
4926
|
-
|
|
4927
|
-
|
|
4928
|
-
if __name__ == "__main__":
|
|
4929
|
-
unittest.main()
|