003 File Manager
Current Path:
/usr/local/lib/python3.8/test
usr
/
local
/
lib
/
python3.8
/
test
/
π
..
π
Sine-1000Hz-300ms.aif
(60.25 KB)
π
__init__.py
(47 B)
π
__main__.py
(41 B)
π
__pycache__
π
_test_multiprocessing.py
(183.09 KB)
π
allsans.pem
(9.87 KB)
π
ann_module.py
(1.08 KB)
π
ann_module2.py
(519 B)
π
ann_module3.py
(448 B)
π
audiodata
π
audiotest.au
(27.48 KB)
π
audiotests.py
(12.46 KB)
π
audit-tests.py
(8.9 KB)
π
autotest.py
(209 B)
π
bad_coding.py
(24 B)
π
bad_coding2.py
(30 B)
π
bad_getattr.py
(61 B)
π
bad_getattr2.py
(77 B)
π
bad_getattr3.py
(139 B)
π
badcert.pem
(1.88 KB)
π
badkey.pem
(2.11 KB)
π
badsyntax_3131.py
(32 B)
π
badsyntax_future10.py
(95 B)
π
badsyntax_future3.py
(172 B)
π
badsyntax_future4.py
(153 B)
π
badsyntax_future5.py
(184 B)
π
badsyntax_future6.py
(161 B)
π
badsyntax_future7.py
(196 B)
π
badsyntax_future8.py
(122 B)
π
badsyntax_future9.py
(142 B)
π
badsyntax_pep3120.py
(14 B)
π
bisect_cmd.py
(4.85 KB)
π
bytecode_helper.py
(1.56 KB)
π
capath
π
cfgparser.1
(67 B)
π
cfgparser.2
(19.02 KB)
π
cfgparser.3
(1.55 KB)
π
cjkencodings
π
clinic.test
(94.65 KB)
π
cmath_testcases.txt
(141.05 KB)
π
coding20731.py
(22 B)
π
curses_tests.py
(1.22 KB)
π
data
π
dataclass_module_1.py
(837 B)
π
dataclass_module_1_str.py
(835 B)
π
dataclass_module_2.py
(756 B)
π
dataclass_module_2_str.py
(754 B)
π
dataclass_textanno.py
(126 B)
π
datetimetester.py
(239.84 KB)
π
decimaltestdata
π
dis_module.py
(76 B)
π
doctest_aliases.py
(240 B)
π
double_const.py
(1.18 KB)
π
dtracedata
π
eintrdata
π
empty.vbs
(70 B)
π
encoded_modules
π
exception_hierarchy.txt
(1.78 KB)
π
ffdh3072.pem
(2.16 KB)
π
final_a.py
(411 B)
π
final_b.py
(411 B)
π
floating_points.txt
(15.92 KB)
π
fork_wait.py
(2.53 KB)
π
formatfloat_testcases.txt
(7.45 KB)
π
future_test1.py
(229 B)
π
future_test2.py
(149 B)
π
gdb_sample.py
(153 B)
π
good_getattr.py
(198 B)
π
idnsans.pem
(9.71 KB)
π
ieee754.txt
(3.21 KB)
π
imghdrdata
π
imp_dummy.py
(63 B)
π
inspect_fodder.py
(1.88 KB)
π
inspect_fodder2.py
(2.06 KB)
π
keycert.passwd.pem
(4.13 KB)
π
keycert.pem
(3.96 KB)
π
keycert2.pem
(3.98 KB)
π
keycert3.pem
(9.23 KB)
π
keycert4.pem
(9.24 KB)
π
keycertecc.pem
(5.5 KB)
π
libregrtest
π
list_tests.py
(16.54 KB)
π
lock_tests.py
(28.26 KB)
π
mailcap.txt
(1.24 KB)
π
make_ssl_certs.py
(9.25 KB)
π
mapping_tests.py
(21.75 KB)
π
math_testcases.txt
(23.19 KB)
π
memory_watchdog.py
(859 B)
π
mime.types
(47.37 KB)
π
mock_socket.py
(3.53 KB)
π
mod_generics_cache.py
(1.13 KB)
π
mp_fork_bomb.py
(448 B)
π
mp_preload.py
(351 B)
π
multibytecodec_support.py
(14.17 KB)
π
nokia.pem
(1.88 KB)
π
nosan.pem
(7.54 KB)
π
nullbytecert.pem
(5.31 KB)
π
nullcert.pem
(0 B)
π
outstanding_bugs.py
(370 B)
π
pickletester.py
(135.99 KB)
π
profilee.py
(2.97 KB)
π
pstats.pck
(65.05 KB)
π
pycacert.pem
(5.53 KB)
π
pycakey.pem
(2.43 KB)
π
pyclbr_input.py
(648 B)
π
pydoc_mod.py
(713 B)
π
pydocfodder.py
(6.18 KB)
π
pythoninfo.py
(20.34 KB)
π
randv2_32.pck
(7.34 KB)
π
randv2_64.pck
(7.19 KB)
π
randv3.pck
(7.82 KB)
π
re_tests.py
(25.93 KB)
π
recursion.tar
(516 B)
π
regrtest.py
(1.34 KB)
π
relimport.py
(27 B)
π
reperf.py
(538 B)
π
revocation.crl
(800 B)
π
sample_doctest.py
(1.02 KB)
π
sample_doctest_no_docstrings.py
(227 B)
π
sample_doctest_no_doctests.py
(269 B)
π
secp384r1.pem
(256 B)
π
selfsigned_pythontestdotnet.pem
(2.08 KB)
π
seq_tests.py
(14.18 KB)
π
sgml_input.html
(8.1 KB)
π
signalinterproctester.py
(2.7 KB)
π
sndhdrdata
π
sortperf.py
(4.69 KB)
π
ssl_cert.pem
(1.53 KB)
π
ssl_key.passwd.pem
(2.59 KB)
π
ssl_key.pem
(2.43 KB)
π
ssl_servers.py
(7.04 KB)
π
ssltests.py
(1.03 KB)
π
string_tests.py
(64.65 KB)
π
subprocessdata
π
support
π
talos-2019-0758.pem
(1.3 KB)
π
test___all__.py
(4.12 KB)
π
test___future__.py
(2.36 KB)
π
test__locale.py
(7.83 KB)
π
test__opcode.py
(3.03 KB)
π
test__osx_support.py
(13.66 KB)
π
test__xxsubinterpreters.py
(68.7 KB)
π
test_abc.py
(18 KB)
π
test_abstract_numbers.py
(1.49 KB)
π
test_aifc.py
(17.68 KB)
π
test_argparse.py
(172.67 KB)
π
test_array.py
(52.57 KB)
π
test_asdl_parser.py
(4.15 KB)
π
test_ast.py
(88.53 KB)
π
test_asyncgen.py
(31.44 KB)
π
test_asynchat.py
(9.28 KB)
π
test_asyncio
π
test_asyncore.py
(25.81 KB)
π
test_atexit.py
(5.81 KB)
π
test_audioop.py
(28.24 KB)
π
test_audit.py
(4.05 KB)
π
test_augassign.py
(7.68 KB)
π
test_base64.py
(30.17 KB)
π
test_baseexception.py
(6.86 KB)
π
test_bdb.py
(41.55 KB)
π
test_bigaddrspace.py
(2.92 KB)
π
test_bigmem.py
(44.88 KB)
π
test_binascii.py
(18 KB)
π
test_binhex.py
(1.79 KB)
π
test_binop.py
(14.14 KB)
π
test_bisect.py
(13.63 KB)
π
test_bool.py
(12.48 KB)
π
test_buffer.py
(160.04 KB)
π
test_bufio.py
(2.54 KB)
π
test_builtin.py
(78.38 KB)
π
test_bytes.py
(72.23 KB)
π
test_bz2.py
(36.76 KB)
π
test_c_locale_coercion.py
(18.82 KB)
π
test_calendar.py
(48.71 KB)
π
test_call.py
(20.88 KB)
π
test_capi.py
(30.46 KB)
π
test_cgi.py
(22.15 KB)
π
test_cgitb.py
(2.5 KB)
π
test_charmapcodec.py
(1.68 KB)
π
test_class.py
(17.42 KB)
π
test_clinic.py
(21.71 KB)
π
test_cmath.py
(24.07 KB)
π
test_cmd.py
(6.1 KB)
π
test_cmd_line.py
(33.72 KB)
π
test_cmd_line_script.py
(31.46 KB)
π
test_code.py
(13.66 KB)
π
test_code_module.py
(5.51 KB)
π
test_codeccallbacks.py
(40.97 KB)
π
test_codecencodings_cn.py
(3.86 KB)
π
test_codecencodings_hk.py
(701 B)
π
test_codecencodings_iso2022.py
(1.36 KB)
π
test_codecencodings_jp.py
(4.79 KB)
π
test_codecencodings_kr.py
(2.96 KB)
π
test_codecencodings_tw.py
(681 B)
π
test_codecmaps_cn.py
(746 B)
π
test_codecmaps_hk.py
(386 B)
π
test_codecmaps_jp.py
(1.7 KB)
π
test_codecmaps_kr.py
(1.16 KB)
π
test_codecmaps_tw.py
(705 B)
π
test_codecs.py
(129.38 KB)
π
test_codeop.py
(7.97 KB)
π
test_collections.py
(83.93 KB)
π
test_colorsys.py
(3.83 KB)
π
test_compare.py
(3.82 KB)
π
test_compile.py
(36.48 KB)
π
test_compileall.py
(26.7 KB)
π
test_complex.py
(30.24 KB)
π
test_concurrent_futures.py
(44.93 KB)
π
test_configparser.py
(84.93 KB)
π
test_contains.py
(3.49 KB)
π
test_context.py
(29.33 KB)
π
test_contextlib.py
(32.54 KB)
π
test_contextlib_async.py
(14.82 KB)
π
test_copy.py
(25.81 KB)
π
test_copyreg.py
(4.39 KB)
π
test_coroutines.py
(62.52 KB)
π
test_cprofile.py
(6.33 KB)
π
test_crashers.py
(1.17 KB)
π
test_crypt.py
(3.97 KB)
π
test_csv.py
(47.77 KB)
π
test_ctypes.py
(184 B)
π
test_curses.py
(45.47 KB)
π
test_dataclasses.py
(108.8 KB)
π
test_datetime.py
(2.15 KB)
π
test_dbm.py
(6.45 KB)
π
test_dbm_dumb.py
(10.61 KB)
π
test_dbm_gnu.py
(6.22 KB)
π
test_dbm_ndbm.py
(5.05 KB)
π
test_decimal.py
(206.63 KB)
π
test_decorators.py
(9.48 KB)
π
test_defaultdict.py
(5.88 KB)
π
test_deque.py
(34.46 KB)
π
test_descr.py
(190.58 KB)
π
test_descrtut.py
(11.53 KB)
π
test_devpoll.py
(4.5 KB)
π
test_dict.py
(45 KB)
π
test_dict_version.py
(5.88 KB)
π
test_dictcomps.py
(4.42 KB)
π
test_dictviews.py
(11.68 KB)
π
test_difflib.py
(19.64 KB)
π
test_difflib_expect.html
(100.85 KB)
π
test_dis.py
(48.4 KB)
π
test_distutils.py
(375 B)
π
test_doctest.py
(98.67 KB)
π
test_doctest.txt
(300 B)
π
test_doctest2.py
(2.3 KB)
π
test_doctest2.txt
(392 B)
π
test_doctest3.txt
(82 B)
π
test_doctest4.txt
(244 B)
π
test_docxmlrpc.py
(8.67 KB)
π
test_dtrace.py
(5.23 KB)
π
test_dummy_thread.py
(9.69 KB)
π
test_dummy_threading.py
(1.7 KB)
π
test_dynamic.py
(4.29 KB)
π
test_dynamicclassattribute.py
(9.57 KB)
π
test_eintr.py
(1.32 KB)
π
test_email
π
test_embed.py
(49.23 KB)
π
test_ensurepip.py
(9.83 KB)
π
test_enum.py
(113.68 KB)
π
test_enumerate.py
(8.46 KB)
π
test_eof.py
(1.94 KB)
π
test_epoll.py
(9.03 KB)
π
test_errno.py
(1.04 KB)
π
test_exception_hierarchy.py
(7.43 KB)
π
test_exception_variations.py
(3.86 KB)
π
test_exceptions.py
(49.81 KB)
π
test_extcall.py
(13.49 KB)
π
test_faulthandler.py
(28.13 KB)
π
test_fcntl.py
(6.21 KB)
π
test_file.py
(11.02 KB)
π
test_file_eintr.py
(10.6 KB)
π
test_filecmp.py
(8.69 KB)
π
test_fileinput.py
(37.33 KB)
π
test_fileio.py
(19.96 KB)
π
test_finalization.py
(14.66 KB)
π
test_float.py
(63.41 KB)
π
test_flufl.py
(1.32 KB)
π
test_fnmatch.py
(5.07 KB)
π
test_fork1.py
(3.67 KB)
π
test_format.py
(22.58 KB)
π
test_fractions.py
(29.83 KB)
π
test_frame.py
(5.67 KB)
π
test_frozen.py
(943 B)
π
test_fstring.py
(46.16 KB)
π
test_ftplib.py
(39.71 KB)
π
test_funcattrs.py
(13.54 KB)
π
test_functools.py
(90.59 KB)
π
test_future.py
(11.9 KB)
π
test_future3.py
(490 B)
π
test_future4.py
(222 B)
π
test_future5.py
(510 B)
π
test_gc.py
(40.49 KB)
π
test_gdb.py
(40.88 KB)
π
test_generator_stop.py
(943 B)
π
test_generators.py
(58.51 KB)
π
test_genericclass.py
(9.28 KB)
π
test_genericpath.py
(21.7 KB)
π
test_genexps.py
(7.12 KB)
π
test_getargs2.py
(50 KB)
π
test_getopt.py
(6.75 KB)
π
test_getpass.py
(6.29 KB)
π
test_gettext.py
(41.38 KB)
π
test_glob.py
(13.03 KB)
π
test_global.py
(1.31 KB)
π
test_grammar.py
(57.5 KB)
π
test_grp.py
(3.54 KB)
π
test_gzip.py
(29.9 KB)
π
test_hash.py
(11.45 KB)
π
test_hashlib.py
(39.43 KB)
π
test_heapq.py
(16.4 KB)
π
test_hmac.py
(22.24 KB)
π
test_html.py
(4.23 KB)
π
test_htmlparser.py
(33.19 KB)
π
test_http_cookiejar.py
(78.36 KB)
π
test_http_cookies.py
(18.71 KB)
π
test_httplib.py
(76.98 KB)
π
test_httpservers.py
(45.24 KB)
π
test_idle.py
(825 B)
π
test_imaplib.py
(38.95 KB)
π
test_imghdr.py
(4.66 KB)
π
test_imp.py
(17.73 KB)
π
test_import
π
test_importlib
π
test_index.py
(8.37 KB)
π
test_inspect.py
(151.79 KB)
π
test_int.py
(20.8 KB)
π
test_int_literal.py
(6.89 KB)
π
test_io.py
(163.94 KB)
π
test_ioctl.py
(3.2 KB)
π
test_ipaddress.py
(90.98 KB)
π
test_isinstance.py
(10.25 KB)
π
test_iter.py
(31.81 KB)
π
test_iterlen.py
(7.1 KB)
π
test_itertools.py
(101.41 KB)
π
test_json
π
test_keyword.py
(1.23 KB)
π
test_keywordonlyarg.py
(6.85 KB)
π
test_kqueue.py
(8.76 KB)
π
test_largefile.py
(6.83 KB)
π
test_lib2to3.py
(101 B)
π
test_linecache.py
(7.79 KB)
π
test_list.py
(7.4 KB)
π
test_listcomps.py
(3.76 KB)
π
test_lltrace.py
(1012 B)
π
test_locale.py
(23.87 KB)
π
test_logging.py
(182.43 KB)
π
test_long.py
(53.21 KB)
π
test_longexp.py
(233 B)
π
test_lzma.py
(87.92 KB)
π
test_mailbox.py
(91.92 KB)
π
test_mailcap.py
(9.88 KB)
π
test_marshal.py
(20.57 KB)
π
test_math.py
(82.18 KB)
π
test_memoryio.py
(31.48 KB)
π
test_memoryview.py
(17.78 KB)
π
test_metaclass.py
(6.2 KB)
π
test_mimetypes.py
(12.14 KB)
π
test_minidom.py
(66.95 KB)
π
test_mmap.py
(29.04 KB)
π
test_module.py
(10.3 KB)
π
test_modulefinder.py
(12.2 KB)
π
test_msilib.py
(5.06 KB)
π
test_multibytecodec.py
(15.04 KB)
π
test_multiprocessing_fork.py
(477 B)
π
test_multiprocessing_forkserver.py
(392 B)
π
test_multiprocessing_main_handling.py
(11.45 KB)
π
test_multiprocessing_spawn.py
(277 B)
π
test_named_expressions.py
(16.51 KB)
π
test_netrc.py
(5.96 KB)
π
test_nis.py
(1.13 KB)
π
test_nntplib.py
(61.7 KB)
π
test_normalization.py
(3.66 KB)
π
test_ntpath.py
(35.08 KB)
π
test_numeric_tower.py
(7.18 KB)
π
test_opcodes.py
(3.61 KB)
π
test_openpty.py
(600 B)
π
test_operator.py
(23.54 KB)
π
test_optparse.py
(60.99 KB)
π
test_ordered_dict.py
(30.22 KB)
π
test_os.py
(150.53 KB)
π
test_ossaudiodev.py
(7.06 KB)
π
test_osx_env.py
(1.3 KB)
π
test_parser.py
(35.72 KB)
π
test_pathlib.py
(97.12 KB)
π
test_pdb.py
(55.36 KB)
π
test_peepholer.py
(19.41 KB)
π
test_pickle.py
(19.16 KB)
π
test_picklebuffer.py
(4.96 KB)
π
test_pickletools.py
(4.33 KB)
π
test_pipes.py
(6.59 KB)
π
test_pkg.py
(9.59 KB)
π
test_pkgimport.py
(2.67 KB)
π
test_pkgutil.py
(19.25 KB)
π
test_platform.py
(14.31 KB)
π
test_plistlib.py
(41.43 KB)
π
test_poll.py
(7.23 KB)
π
test_popen.py
(1.98 KB)
π
test_poplib.py
(16.97 KB)
π
test_positional_only_arg.py
(17.5 KB)
π
test_posix.py
(75.76 KB)
π
test_posixpath.py
(29.19 KB)
π
test_pow.py
(5.44 KB)
π
test_pprint.py
(43.85 KB)
π
test_print.py
(7.37 KB)
π
test_profile.py
(8.72 KB)
π
test_property.py
(8.77 KB)
π
test_pstats.py
(3.04 KB)
π
test_pty.py
(11.97 KB)
π
test_pulldom.py
(12.66 KB)
π
test_pwd.py
(4.17 KB)
π
test_py_compile.py
(10.78 KB)
π
test_pyclbr.py
(10 KB)
π
test_pydoc.py
(56.98 KB)
π
test_pyexpat.py
(26.54 KB)
π
test_queue.py
(20.36 KB)
π
test_quopri.py
(7.78 KB)
π
test_raise.py
(12.86 KB)
π
test_random.py
(45.59 KB)
π
test_range.py
(23.35 KB)
π
test_re.py
(106.41 KB)
π
test_readline.py
(12.95 KB)
π
test_regrtest.py
(46.36 KB)
π
test_repl.py
(3.96 KB)
π
test_reprlib.py
(15.12 KB)
π
test_resource.py
(7.02 KB)
π
test_richcmp.py
(11.91 KB)
π
test_rlcompleter.py
(6.3 KB)
π
test_robotparser.py
(10.69 KB)
π
test_runpy.py
(33.86 KB)
π
test_sax.py
(46.9 KB)
π
test_sched.py
(6.41 KB)
π
test_scope.py
(19.7 KB)
π
test_script_helper.py
(5.78 KB)
π
test_secrets.py
(4.28 KB)
π
test_select.py
(2.69 KB)
π
test_selectors.py
(17.79 KB)
π
test_set.py
(64.41 KB)
π
test_setcomps.py
(3.7 KB)
π
test_shelve.py
(6.24 KB)
π
test_shlex.py
(13.29 KB)
π
test_shutil.py
(101.55 KB)
π
test_signal.py
(46.62 KB)
π
test_site.py
(24.71 KB)
π
test_slice.py
(8.25 KB)
π
test_smtpd.py
(40.14 KB)
π
test_smtplib.py
(56.51 KB)
π
test_smtpnet.py
(2.87 KB)
π
test_sndhdr.py
(1.43 KB)
π
test_socket.py
(232.71 KB)
π
test_socketserver.py
(17.7 KB)
π
test_sort.py
(13.42 KB)
π
test_source_encoding.py
(7.89 KB)
π
test_spwd.py
(2.71 KB)
π
test_sqlite.py
(948 B)
π
test_ssl.py
(203.3 KB)
π
test_startfile.py
(1.29 KB)
π
test_stat.py
(8.3 KB)
π
test_statistics.py
(106.5 KB)
π
test_strftime.py
(7.54 KB)
π
test_string.py
(19.8 KB)
π
test_string_literals.py
(9.88 KB)
π
test_stringprep.py
(3.04 KB)
π
test_strptime.py
(34.42 KB)
π
test_strtod.py
(20.06 KB)
π
test_struct.py
(34.41 KB)
π
test_structmembers.py
(4.7 KB)
π
test_structseq.py
(3.87 KB)
π
test_subclassinit.py
(8.12 KB)
π
test_subprocess.py
(142.64 KB)
π
test_sunau.py
(6.07 KB)
π
test_sundry.py
(2.07 KB)
π
test_super.py
(9.6 KB)
π
test_support.py
(24.12 KB)
π
test_symbol.py
(2.06 KB)
π
test_symtable.py
(9.13 KB)
π
test_syntax.py
(25.75 KB)
π
test_sys.py
(55.24 KB)
π
test_sys_setprofile.py
(12.31 KB)
π
test_sys_settrace.py
(43.08 KB)
π
test_sysconfig.py
(17.01 KB)
π
test_syslog.py
(1.15 KB)
π
test_tabnanny.py
(13.44 KB)
π
test_tarfile.py
(98.31 KB)
π
test_tcl.py
(30.74 KB)
π
test_telnetlib.py
(12.7 KB)
π
test_tempfile.py
(52.57 KB)
π
test_textwrap.py
(38.84 KB)
π
test_thread.py
(8.41 KB)
π
test_threaded_import.py
(8.9 KB)
π
test_threadedtempfile.py
(1.85 KB)
π
test_threading.py
(47.52 KB)
π
test_threading_local.py
(6.09 KB)
π
test_threadsignals.py
(10.09 KB)
π
test_time.py
(38.43 KB)
π
test_timeit.py
(14.8 KB)
π
test_timeout.py
(11.19 KB)
π
test_tix.py
(756 B)
π
test_tk.py
(362 B)
π
test_tokenize.py
(63.18 KB)
π
test_tools
π
test_trace.py
(19.89 KB)
π
test_traceback.py
(46.97 KB)
π
test_tracemalloc.py
(37.41 KB)
π
test_ttk_guionly.py
(746 B)
π
test_ttk_textonly.py
(299 B)
π
test_tuple.py
(18.85 KB)
π
test_turtle.py
(12.79 KB)
π
test_type_comments.py
(10.13 KB)
π
test_typechecks.py
(2.55 KB)
π
test_types.py
(58 KB)
π
test_typing.py
(122.05 KB)
π
test_ucn.py
(9.35 KB)
π
test_unary.py
(1.63 KB)
π
test_unicode.py
(129.94 KB)
π
test_unicode_file.py
(5.74 KB)
π
test_unicode_file_functions.py
(6.84 KB)
π
test_unicode_identifiers.py
(891 B)
π
test_unicodedata.py
(12.7 KB)
π
test_unittest.py
(286 B)
π
test_univnewlines.py
(3.83 KB)
π
test_unpack.py
(3.01 KB)
π
test_unpack_ex.py
(8.73 KB)
π
test_urllib.py
(71.24 KB)
π
test_urllib2.py
(76.95 KB)
π
test_urllib2_localnet.py
(24.24 KB)
π
test_urllib2net.py
(12.39 KB)
π
test_urllib_response.py
(1.69 KB)
π
test_urllibnet.py
(8.9 KB)
π
test_urlparse.py
(64.87 KB)
π
test_userdict.py
(7.64 KB)
π
test_userlist.py
(1.97 KB)
π
test_userstring.py
(2.4 KB)
π
test_utf8_mode.py
(9.22 KB)
π
test_utf8source.py
(1.15 KB)
π
test_uu.py
(8.02 KB)
π
test_uuid.py
(35.74 KB)
π
test_venv.py
(20.46 KB)
π
test_wait3.py
(1.16 KB)
π
test_wait4.py
(1.15 KB)
π
test_warnings
π
test_wave.py
(6.57 KB)
π
test_weakref.py
(69.47 KB)
π
test_weakset.py
(15.03 KB)
π
test_webbrowser.py
(10.47 KB)
π
test_winconsoleio.py
(6.14 KB)
π
test_winreg.py
(21.38 KB)
π
test_winsound.py
(4.57 KB)
π
test_with.py
(25.78 KB)
π
test_wsgiref.py
(30.1 KB)
π
test_xdrlib.py
(2.17 KB)
π
test_xml_dom_minicompat.py
(4.18 KB)
π
test_xml_etree.py
(147.87 KB)
π
test_xml_etree_c.py
(8.06 KB)
π
test_xmlrpc.py
(55.96 KB)
π
test_xmlrpc_net.py
(1015 B)
π
test_xxtestfuzz.py
(670 B)
π
test_yield_from.py
(30.01 KB)
π
test_zipapp.py
(15.92 KB)
π
test_zipfile.py
(115.45 KB)
π
test_zipfile64.py
(5.8 KB)
π
test_zipimport.py
(29.28 KB)
π
test_zipimport_support.py
(10.44 KB)
π
test_zlib.py
(34.48 KB)
π
testcodec.py
(1.02 KB)
π
testtar.tar
(425 KB)
π
tf_inherit_check.py
(714 B)
π
threaded_import_hangers.py
(1.45 KB)
π
time_hashlib.py
(2.87 KB)
π
tokenize_tests-latin1-coding-cookie-and-utf8-bom-sig.txt
(443 B)
π
tokenize_tests-no-coding-cookie-and-utf8-bom-sig-only.txt
(302 B)
π
tokenize_tests-utf8-coding-cookie-and-no-utf8-bom-sig.txt
(421 B)
π
tokenize_tests-utf8-coding-cookie-and-utf8-bom-sig.txt
(326 B)
π
tokenize_tests.txt
(2.65 KB)
π
tracedmodules
π
win_console_handler.py
(1.38 KB)
π
xmltestdata
π
xmltests.py
(499 B)
π
zip_cp437_header.zip
(270 B)
π
zipdir.zip
(374 B)
π
ziptestdata
Editing: test_tcl.py
import unittest import locale import re import subprocess import sys import os from test import support # Skip this test if the _tkinter module wasn't built. _tkinter = support.import_module('_tkinter') import tkinter from tkinter import Tcl from _tkinter import TclError try: from _testcapi import INT_MAX, PY_SSIZE_T_MAX except ImportError: INT_MAX = PY_SSIZE_T_MAX = sys.maxsize tcl_version = tuple(map(int, _tkinter.TCL_VERSION.split('.'))) _tk_patchlevel = None def get_tk_patchlevel(): global _tk_patchlevel if _tk_patchlevel is None: tcl = Tcl() patchlevel = tcl.call('info', 'patchlevel') m = re.fullmatch(r'(\d+)\.(\d+)([ab.])(\d+)', patchlevel) major, minor, releaselevel, serial = m.groups() major, minor, serial = int(major), int(minor), int(serial) releaselevel = {'a': 'alpha', 'b': 'beta', '.': 'final'}[releaselevel] if releaselevel == 'final': _tk_patchlevel = major, minor, serial, releaselevel, 0 else: _tk_patchlevel = major, minor, 0, releaselevel, serial return _tk_patchlevel class TkinterTest(unittest.TestCase): def testFlattenLen(self): # flatten(<object with no length>) self.assertRaises(TypeError, _tkinter._flatten, True) class TclTest(unittest.TestCase): def setUp(self): self.interp = Tcl() self.wantobjects = self.interp.tk.wantobjects() def testEval(self): tcl = self.interp tcl.eval('set a 1') self.assertEqual(tcl.eval('set a'),'1') def test_eval_null_in_result(self): tcl = self.interp self.assertEqual(tcl.eval('set a "a\\0b"'), 'a\x00b') def test_eval_surrogates_in_result(self): tcl = self.interp self.assertIn(tcl.eval(r'set a "<\ud83d\udcbb>"'), '<\U0001f4bb>') def testEvalException(self): tcl = self.interp self.assertRaises(TclError,tcl.eval,'set a') def testEvalException2(self): tcl = self.interp self.assertRaises(TclError,tcl.eval,'this is wrong') def testCall(self): tcl = self.interp tcl.call('set','a','1') self.assertEqual(tcl.call('set','a'),'1') def testCallException(self): tcl = self.interp self.assertRaises(TclError,tcl.call,'set','a') def testCallException2(self): tcl = self.interp self.assertRaises(TclError,tcl.call,'this','is','wrong') def testSetVar(self): tcl = self.interp tcl.setvar('a','1') self.assertEqual(tcl.eval('set a'),'1') def testSetVarArray(self): tcl = self.interp tcl.setvar('a(1)','1') self.assertEqual(tcl.eval('set a(1)'),'1') def testGetVar(self): tcl = self.interp tcl.eval('set a 1') self.assertEqual(tcl.getvar('a'),'1') def testGetVarArray(self): tcl = self.interp tcl.eval('set a(1) 1') self.assertEqual(tcl.getvar('a(1)'),'1') def testGetVarException(self): tcl = self.interp self.assertRaises(TclError,tcl.getvar,'a') def testGetVarArrayException(self): tcl = self.interp self.assertRaises(TclError,tcl.getvar,'a(1)') def testUnsetVar(self): tcl = self.interp tcl.setvar('a',1) self.assertEqual(tcl.eval('info exists a'),'1') tcl.unsetvar('a') self.assertEqual(tcl.eval('info exists a'),'0') def testUnsetVarArray(self): tcl = self.interp tcl.setvar('a(1)',1) tcl.setvar('a(2)',2) self.assertEqual(tcl.eval('info exists a(1)'),'1') self.assertEqual(tcl.eval('info exists a(2)'),'1') tcl.unsetvar('a(1)') self.assertEqual(tcl.eval('info exists a(1)'),'0') self.assertEqual(tcl.eval('info exists a(2)'),'1') def testUnsetVarException(self): tcl = self.interp self.assertRaises(TclError,tcl.unsetvar,'a') def get_integers(self): integers = (0, 1, -1, 2**31-1, -2**31, 2**31, -2**31-1, 2**63-1, -2**63) # bignum was added in Tcl 8.5, but its support is able only since 8.5.8. # Actually it is determined at compile time, so using get_tk_patchlevel() # is not reliable. # TODO: expose full static version. if tcl_version >= (8, 5): v = get_tk_patchlevel() if v >= (8, 6, 0, 'final') or (8, 5, 8) <= v < (8, 6): integers += (2**63, -2**63-1, 2**1000, -2**1000) return integers def test_getint(self): tcl = self.interp.tk for i in self.get_integers(): self.assertEqual(tcl.getint(' %d ' % i), i) if tcl_version >= (8, 5): self.assertEqual(tcl.getint(' %#o ' % i), i) self.assertEqual(tcl.getint((' %#o ' % i).replace('o', '')), i) self.assertEqual(tcl.getint(' %#x ' % i), i) if tcl_version < (8, 5): # bignum was added in Tcl 8.5 self.assertRaises(TclError, tcl.getint, str(2**1000)) self.assertEqual(tcl.getint(42), 42) self.assertRaises(TypeError, tcl.getint) self.assertRaises(TypeError, tcl.getint, '42', '10') self.assertRaises(TypeError, tcl.getint, b'42') self.assertRaises(TypeError, tcl.getint, 42.0) self.assertRaises(TclError, tcl.getint, 'a') self.assertRaises((TypeError, ValueError, TclError), tcl.getint, '42\0') self.assertRaises((UnicodeEncodeError, ValueError, TclError), tcl.getint, '42\ud800') def test_getdouble(self): tcl = self.interp.tk self.assertEqual(tcl.getdouble(' 42 '), 42.0) self.assertEqual(tcl.getdouble(' 42.5 '), 42.5) self.assertEqual(tcl.getdouble(42.5), 42.5) self.assertEqual(tcl.getdouble(42), 42.0) self.assertRaises(TypeError, tcl.getdouble) self.assertRaises(TypeError, tcl.getdouble, '42.5', '10') self.assertRaises(TypeError, tcl.getdouble, b'42.5') self.assertRaises(TclError, tcl.getdouble, 'a') self.assertRaises((TypeError, ValueError, TclError), tcl.getdouble, '42.5\0') self.assertRaises((UnicodeEncodeError, ValueError, TclError), tcl.getdouble, '42.5\ud800') def test_getboolean(self): tcl = self.interp.tk self.assertIs(tcl.getboolean('on'), True) self.assertIs(tcl.getboolean('1'), True) self.assertIs(tcl.getboolean(42), True) self.assertIs(tcl.getboolean(0), False) self.assertRaises(TypeError, tcl.getboolean) self.assertRaises(TypeError, tcl.getboolean, 'on', '1') self.assertRaises(TypeError, tcl.getboolean, b'on') self.assertRaises(TypeError, tcl.getboolean, 1.0) self.assertRaises(TclError, tcl.getboolean, 'a') self.assertRaises((TypeError, ValueError, TclError), tcl.getboolean, 'on\0') self.assertRaises((UnicodeEncodeError, ValueError, TclError), tcl.getboolean, 'on\ud800') def testEvalFile(self): tcl = self.interp filename = support.TESTFN self.addCleanup(support.unlink, filename) with open(filename, 'w') as f: f.write("""set a 1 set b 2 set c [ expr $a + $b ] """) tcl.evalfile(filename) self.assertEqual(tcl.eval('set a'),'1') self.assertEqual(tcl.eval('set b'),'2') self.assertEqual(tcl.eval('set c'),'3') def test_evalfile_null_in_result(self): tcl = self.interp filename = support.TESTFN self.addCleanup(support.unlink, filename) with open(filename, 'w') as f: f.write(""" set a "a\0b" set b "a\\0b" """) tcl.evalfile(filename) self.assertEqual(tcl.eval('set a'), 'a\x00b') self.assertEqual(tcl.eval('set b'), 'a\x00b') def test_evalfile_surrogates_in_result(self): tcl = self.interp encoding = tcl.call('encoding', 'system') self.addCleanup(tcl.call, 'encoding', 'system', encoding) tcl.call('encoding', 'system', 'utf-8') filename = support.TESTFN self.addCleanup(support.unlink, filename) with open(filename, 'wb') as f: f.write(b""" set a "<\xed\xa0\xbd\xed\xb2\xbb>" set b "<\\ud83d\\udcbb>" """) tcl.evalfile(filename) self.assertEqual(tcl.eval('set a'), '<\U0001f4bb>') self.assertEqual(tcl.eval('set b'), '<\U0001f4bb>') def testEvalFileException(self): tcl = self.interp filename = "doesnotexists" try: os.remove(filename) except Exception as e: pass self.assertRaises(TclError,tcl.evalfile,filename) def testPackageRequireException(self): tcl = self.interp self.assertRaises(TclError,tcl.eval,'package require DNE') @unittest.skipUnless(sys.platform == 'win32', 'Requires Windows') def testLoadWithUNC(self): # Build a UNC path from the regular path. # Something like # \\%COMPUTERNAME%\c$\python27\python.exe fullname = os.path.abspath(sys.executable) if fullname[1] != ':': raise unittest.SkipTest('Absolute path should have drive part') unc_name = r'\\%s\%s$\%s' % (os.environ['COMPUTERNAME'], fullname[0], fullname[3:]) if not os.path.exists(unc_name): raise unittest.SkipTest('Cannot connect to UNC Path') with support.EnvironmentVarGuard() as env: env.unset("TCL_LIBRARY") stdout = subprocess.check_output( [unc_name, '-c', 'import tkinter; print(tkinter)']) self.assertIn(b'tkinter', stdout) def test_exprstring(self): tcl = self.interp tcl.call('set', 'a', 3) tcl.call('set', 'b', 6) def check(expr, expected): result = tcl.exprstring(expr) self.assertEqual(result, expected) self.assertIsInstance(result, str) self.assertRaises(TypeError, tcl.exprstring) self.assertRaises(TypeError, tcl.exprstring, '8.2', '+6') self.assertRaises(TypeError, tcl.exprstring, b'8.2 + 6') self.assertRaises(TclError, tcl.exprstring, 'spam') check('', '0') check('8.2 + 6', '14.2') check('3.1 + $a', '6.1') check('2 + "$a.$b"', '5.6') check('4*[llength "6 2"]', '8') check('{word one} < "word $a"', '0') check('4*2 < 7', '0') check('hypot($a, 4)', '5.0') check('5 / 4', '1') check('5 / 4.0', '1.25') check('5 / ( [string length "abcd"] + 0.0 )', '1.25') check('20.0/5.0', '4.0') check('"0x03" > "2"', '1') check('[string length "a\xbd\u20ac"]', '3') check(r'[string length "a\xbd\u20ac"]', '3') check('"abc"', 'abc') check('"a\xbd\u20ac"', 'a\xbd\u20ac') check(r'"a\xbd\u20ac"', 'a\xbd\u20ac') check(r'"a\0b"', 'a\x00b') if tcl_version >= (8, 5): # bignum was added in Tcl 8.5 check('2**64', str(2**64)) def test_exprdouble(self): tcl = self.interp tcl.call('set', 'a', 3) tcl.call('set', 'b', 6) def check(expr, expected): result = tcl.exprdouble(expr) self.assertEqual(result, expected) self.assertIsInstance(result, float) self.assertRaises(TypeError, tcl.exprdouble) self.assertRaises(TypeError, tcl.exprdouble, '8.2', '+6') self.assertRaises(TypeError, tcl.exprdouble, b'8.2 + 6') self.assertRaises(TclError, tcl.exprdouble, 'spam') check('', 0.0) check('8.2 + 6', 14.2) check('3.1 + $a', 6.1) check('2 + "$a.$b"', 5.6) check('4*[llength "6 2"]', 8.0) check('{word one} < "word $a"', 0.0) check('4*2 < 7', 0.0) check('hypot($a, 4)', 5.0) check('5 / 4', 1.0) check('5 / 4.0', 1.25) check('5 / ( [string length "abcd"] + 0.0 )', 1.25) check('20.0/5.0', 4.0) check('"0x03" > "2"', 1.0) check('[string length "a\xbd\u20ac"]', 3.0) check(r'[string length "a\xbd\u20ac"]', 3.0) self.assertRaises(TclError, tcl.exprdouble, '"abc"') if tcl_version >= (8, 5): # bignum was added in Tcl 8.5 check('2**64', float(2**64)) def test_exprlong(self): tcl = self.interp tcl.call('set', 'a', 3) tcl.call('set', 'b', 6) def check(expr, expected): result = tcl.exprlong(expr) self.assertEqual(result, expected) self.assertIsInstance(result, int) self.assertRaises(TypeError, tcl.exprlong) self.assertRaises(TypeError, tcl.exprlong, '8.2', '+6') self.assertRaises(TypeError, tcl.exprlong, b'8.2 + 6') self.assertRaises(TclError, tcl.exprlong, 'spam') check('', 0) check('8.2 + 6', 14) check('3.1 + $a', 6) check('2 + "$a.$b"', 5) check('4*[llength "6 2"]', 8) check('{word one} < "word $a"', 0) check('4*2 < 7', 0) check('hypot($a, 4)', 5) check('5 / 4', 1) check('5 / 4.0', 1) check('5 / ( [string length "abcd"] + 0.0 )', 1) check('20.0/5.0', 4) check('"0x03" > "2"', 1) check('[string length "a\xbd\u20ac"]', 3) check(r'[string length "a\xbd\u20ac"]', 3) self.assertRaises(TclError, tcl.exprlong, '"abc"') if tcl_version >= (8, 5): # bignum was added in Tcl 8.5 self.assertRaises(TclError, tcl.exprlong, '2**64') def test_exprboolean(self): tcl = self.interp tcl.call('set', 'a', 3) tcl.call('set', 'b', 6) def check(expr, expected): result = tcl.exprboolean(expr) self.assertEqual(result, expected) self.assertIsInstance(result, int) self.assertNotIsInstance(result, bool) self.assertRaises(TypeError, tcl.exprboolean) self.assertRaises(TypeError, tcl.exprboolean, '8.2', '+6') self.assertRaises(TypeError, tcl.exprboolean, b'8.2 + 6') self.assertRaises(TclError, tcl.exprboolean, 'spam') check('', False) for value in ('0', 'false', 'no', 'off'): check(value, False) check('"%s"' % value, False) check('{%s}' % value, False) for value in ('1', 'true', 'yes', 'on'): check(value, True) check('"%s"' % value, True) check('{%s}' % value, True) check('8.2 + 6', True) check('3.1 + $a', True) check('2 + "$a.$b"', True) check('4*[llength "6 2"]', True) check('{word one} < "word $a"', False) check('4*2 < 7', False) check('hypot($a, 4)', True) check('5 / 4', True) check('5 / 4.0', True) check('5 / ( [string length "abcd"] + 0.0 )', True) check('20.0/5.0', True) check('"0x03" > "2"', True) check('[string length "a\xbd\u20ac"]', True) check(r'[string length "a\xbd\u20ac"]', True) self.assertRaises(TclError, tcl.exprboolean, '"abc"') if tcl_version >= (8, 5): # bignum was added in Tcl 8.5 check('2**64', True) @unittest.skipUnless(tcl_version >= (8, 5), 'requires Tcl version >= 8.5') def test_booleans(self): tcl = self.interp def check(expr, expected): result = tcl.call('expr', expr) if tcl.wantobjects(): self.assertEqual(result, expected) self.assertIsInstance(result, int) else: self.assertIn(result, (expr, str(int(expected)))) self.assertIsInstance(result, str) check('true', True) check('yes', True) check('on', True) check('false', False) check('no', False) check('off', False) check('1 < 2', True) check('1 > 2', False) def test_expr_bignum(self): tcl = self.interp for i in self.get_integers(): result = tcl.call('expr', str(i)) if self.wantobjects: self.assertEqual(result, i) self.assertIsInstance(result, int) else: self.assertEqual(result, str(i)) self.assertIsInstance(result, str) if get_tk_patchlevel() < (8, 5): # bignum was added in Tcl 8.5 self.assertRaises(TclError, tcl.call, 'expr', str(2**1000)) def test_passing_values(self): def passValue(value): return self.interp.call('set', '_', value) self.assertEqual(passValue(True), True if self.wantobjects else '1') self.assertEqual(passValue(False), False if self.wantobjects else '0') self.assertEqual(passValue('string'), 'string') self.assertEqual(passValue('string\u20ac'), 'string\u20ac') self.assertEqual(passValue('string\U0001f4bb'), 'string\U0001f4bb') self.assertEqual(passValue('str\x00ing'), 'str\x00ing') self.assertEqual(passValue('str\x00ing\xbd'), 'str\x00ing\xbd') self.assertEqual(passValue('str\x00ing\u20ac'), 'str\x00ing\u20ac') self.assertEqual(passValue('str\x00ing\U0001f4bb'), 'str\x00ing\U0001f4bb') if sys.platform != 'win32': self.assertEqual(passValue('<\udce2\udc82\udcac>'), '<\u20ac>') self.assertEqual(passValue('<\udced\udca0\udcbd\udced\udcb2\udcbb>'), '<\U0001f4bb>') self.assertEqual(passValue(b'str\x00ing'), b'str\x00ing' if self.wantobjects else 'str\x00ing') self.assertEqual(passValue(b'str\xc0\x80ing'), b'str\xc0\x80ing' if self.wantobjects else 'str\xc0\x80ing') self.assertEqual(passValue(b'str\xbding'), b'str\xbding' if self.wantobjects else 'str\xbding') for i in self.get_integers(): self.assertEqual(passValue(i), i if self.wantobjects else str(i)) if tcl_version < (8, 5): # bignum was added in Tcl 8.5 self.assertEqual(passValue(2**1000), str(2**1000)) for f in (0.0, 1.0, -1.0, 1/3, sys.float_info.min, sys.float_info.max, -sys.float_info.min, -sys.float_info.max): if self.wantobjects: self.assertEqual(passValue(f), f) else: self.assertEqual(float(passValue(f)), f) if self.wantobjects: f = passValue(float('nan')) self.assertNotEqual(f, f) self.assertEqual(passValue(float('inf')), float('inf')) self.assertEqual(passValue(-float('inf')), -float('inf')) else: self.assertEqual(float(passValue(float('inf'))), float('inf')) self.assertEqual(float(passValue(-float('inf'))), -float('inf')) # XXX NaN representation can be not parsable by float() self.assertEqual(passValue((1, '2', (3.4,))), (1, '2', (3.4,)) if self.wantobjects else '1 2 3.4') self.assertEqual(passValue(['a', ['b', 'c']]), ('a', ('b', 'c')) if self.wantobjects else 'a {b c}') def test_user_command(self): result = None def testfunc(arg): nonlocal result result = arg return arg self.interp.createcommand('testfunc', testfunc) self.addCleanup(self.interp.tk.deletecommand, 'testfunc') def check(value, expected=None, *, eq=self.assertEqual): if expected is None: expected = value nonlocal result result = None r = self.interp.call('testfunc', value) self.assertIsInstance(result, str) eq(result, expected) self.assertIsInstance(r, str) eq(r, expected) def float_eq(actual, expected): self.assertAlmostEqual(float(actual), expected, delta=abs(expected) * 1e-10) check(True, '1') check(False, '0') check('string') check('string\xbd') check('string\u20ac') check('string\U0001f4bb') if sys.platform != 'win32': check('<\udce2\udc82\udcac>', '<\u20ac>') check('<\udced\udca0\udcbd\udced\udcb2\udcbb>', '<\U0001f4bb>') check('') check(b'string', 'string') check(b'string\xe2\x82\xac', 'string\xe2\x82\xac') check(b'string\xbd', 'string\xbd') check(b'', '') check('str\x00ing') check('str\x00ing\xbd') check('str\x00ing\u20ac') check(b'str\x00ing', 'str\x00ing') check(b'str\xc0\x80ing', 'str\xc0\x80ing') check(b'str\xc0\x80ing\xe2\x82\xac', 'str\xc0\x80ing\xe2\x82\xac') for i in self.get_integers(): check(i, str(i)) if tcl_version < (8, 5): # bignum was added in Tcl 8.5 check(2**1000, str(2**1000)) for f in (0.0, 1.0, -1.0): check(f, repr(f)) for f in (1/3.0, sys.float_info.min, sys.float_info.max, -sys.float_info.min, -sys.float_info.max): check(f, eq=float_eq) check(float('inf'), eq=float_eq) check(-float('inf'), eq=float_eq) # XXX NaN representation can be not parsable by float() check((), '') check((1, (2,), (3, 4), '5 6', ()), '1 2 {3 4} {5 6} {}') check([1, [2,], [3, 4], '5 6', []], '1 2 {3 4} {5 6} {}') def test_splitlist(self): splitlist = self.interp.tk.splitlist call = self.interp.tk.call self.assertRaises(TypeError, splitlist) self.assertRaises(TypeError, splitlist, 'a', 'b') self.assertRaises(TypeError, splitlist, 2) testcases = [ ('2', ('2',)), ('', ()), ('{}', ('',)), ('""', ('',)), ('a\n b\t\r c\n ', ('a', 'b', 'c')), (b'a\n b\t\r c\n ', ('a', 'b', 'c')), ('a \u20ac', ('a', '\u20ac')), ('a \U0001f4bb', ('a', '\U0001f4bb')), (b'a \xe2\x82\xac', ('a', '\u20ac')), (b'a \xf0\x9f\x92\xbb', ('a', '\U0001f4bb')), (b'a \xed\xa0\xbd\xed\xb2\xbb', ('a', '\U0001f4bb')), (b'a\xc0\x80b c\xc0\x80d', ('a\x00b', 'c\x00d')), ('a {b c}', ('a', 'b c')), (r'a b\ c', ('a', 'b c')), (('a', 'b c'), ('a', 'b c')), ('a 2', ('a', '2')), (('a', 2), ('a', 2)), ('a 3.4', ('a', '3.4')), (('a', 3.4), ('a', 3.4)), ((), ()), ([], ()), (['a', ['b', 'c']], ('a', ['b', 'c'])), (call('list', 1, '2', (3.4,)), (1, '2', (3.4,)) if self.wantobjects else ('1', '2', '3.4')), ] tk_patchlevel = get_tk_patchlevel() if tcl_version >= (8, 5): if not self.wantobjects or tk_patchlevel < (8, 5, 5): # Before 8.5.5 dicts were converted to lists through string expected = ('12', '\u20ac', '\xe2\x82\xac', '3.4') else: expected = (12, '\u20ac', b'\xe2\x82\xac', (3.4,)) testcases += [ (call('dict', 'create', 12, '\u20ac', b'\xe2\x82\xac', (3.4,)), expected), ] dbg_info = ('want objects? %s, Tcl version: %s, Tk patchlevel: %s' % (self.wantobjects, tcl_version, tk_patchlevel)) for arg, res in testcases: self.assertEqual(splitlist(arg), res, 'arg=%a, %s' % (arg, dbg_info)) self.assertRaises(TclError, splitlist, '{') def test_split(self): split = self.interp.tk.split call = self.interp.tk.call self.assertRaises(TypeError, split) self.assertRaises(TypeError, split, 'a', 'b') self.assertRaises(TypeError, split, 2) testcases = [ ('2', '2'), ('', ''), ('{}', ''), ('""', ''), ('{', '{'), ('a\n b\t\r c\n ', ('a', 'b', 'c')), (b'a\n b\t\r c\n ', ('a', 'b', 'c')), ('a \u20ac', ('a', '\u20ac')), (b'a \xe2\x82\xac', ('a', '\u20ac')), (b'a\xc0\x80b', 'a\x00b'), (b'a\xc0\x80b c\xc0\x80d', ('a\x00b', 'c\x00d')), (b'{a\xc0\x80b c\xc0\x80d', '{a\x00b c\x00d'), ('a {b c}', ('a', ('b', 'c'))), (r'a b\ c', ('a', ('b', 'c'))), (('a', b'b c'), ('a', ('b', 'c'))), (('a', 'b c'), ('a', ('b', 'c'))), ('a 2', ('a', '2')), (('a', 2), ('a', 2)), ('a 3.4', ('a', '3.4')), (('a', 3.4), ('a', 3.4)), (('a', (2, 3.4)), ('a', (2, 3.4))), ((), ()), ([], ()), (['a', 'b c'], ('a', ('b', 'c'))), (['a', ['b', 'c']], ('a', ('b', 'c'))), (call('list', 1, '2', (3.4,)), (1, '2', (3.4,)) if self.wantobjects else ('1', '2', '3.4')), ] if tcl_version >= (8, 5): if not self.wantobjects or get_tk_patchlevel() < (8, 5, 5): # Before 8.5.5 dicts were converted to lists through string expected = ('12', '\u20ac', '\xe2\x82\xac', '3.4') else: expected = (12, '\u20ac', b'\xe2\x82\xac', (3.4,)) testcases += [ (call('dict', 'create', 12, '\u20ac', b'\xe2\x82\xac', (3.4,)), expected), ] for arg, res in testcases: self.assertEqual(split(arg), res, msg=arg) def test_splitdict(self): splitdict = tkinter._splitdict tcl = self.interp.tk arg = '-a {1 2 3} -something foo status {}' self.assertEqual(splitdict(tcl, arg, False), {'-a': '1 2 3', '-something': 'foo', 'status': ''}) self.assertEqual(splitdict(tcl, arg), {'a': '1 2 3', 'something': 'foo', 'status': ''}) arg = ('-a', (1, 2, 3), '-something', 'foo', 'status', '{}') self.assertEqual(splitdict(tcl, arg, False), {'-a': (1, 2, 3), '-something': 'foo', 'status': '{}'}) self.assertEqual(splitdict(tcl, arg), {'a': (1, 2, 3), 'something': 'foo', 'status': '{}'}) self.assertRaises(RuntimeError, splitdict, tcl, '-a b -c ') self.assertRaises(RuntimeError, splitdict, tcl, ('-a', 'b', '-c')) arg = tcl.call('list', '-a', (1, 2, 3), '-something', 'foo', 'status', ()) self.assertEqual(splitdict(tcl, arg), {'a': (1, 2, 3) if self.wantobjects else '1 2 3', 'something': 'foo', 'status': ''}) if tcl_version >= (8, 5): arg = tcl.call('dict', 'create', '-a', (1, 2, 3), '-something', 'foo', 'status', ()) if not self.wantobjects or get_tk_patchlevel() < (8, 5, 5): # Before 8.5.5 dicts were converted to lists through string expected = {'a': '1 2 3', 'something': 'foo', 'status': ''} else: expected = {'a': (1, 2, 3), 'something': 'foo', 'status': ''} self.assertEqual(splitdict(tcl, arg), expected) def test_join(self): join = tkinter._join tcl = self.interp.tk def unpack(s): return tcl.call('lindex', s, 0) def check(value): self.assertEqual(unpack(join([value])), value) self.assertEqual(unpack(join([value, 0])), value) self.assertEqual(unpack(unpack(join([[value]]))), value) self.assertEqual(unpack(unpack(join([[value, 0]]))), value) self.assertEqual(unpack(unpack(join([[value], 0]))), value) self.assertEqual(unpack(unpack(join([[value, 0], 0]))), value) check('') check('spam') check('sp am') check('sp\tam') check('sp\nam') check(' \t\n') check('{spam}') check('{sp am}') check('"spam"') check('"sp am"') check('{"spam"}') check('"{spam}"') check('sp\\am') check('"sp\\am"') check('"{}" "{}"') check('"\\') check('"{') check('"}') check('\n\\') check('\n{') check('\n}') check('\\\n') check('{\n') check('}\n') def test_new_tcl_obj(self): self.assertRaises(TypeError, _tkinter.Tcl_Obj) class BigmemTclTest(unittest.TestCase): def setUp(self): self.interp = Tcl() @support.cpython_only @unittest.skipUnless(INT_MAX < PY_SSIZE_T_MAX, "needs UINT_MAX < SIZE_MAX") @support.bigmemtest(size=INT_MAX + 1, memuse=5, dry_run=False) def test_huge_string_call(self, size): value = ' ' * size self.assertRaises(OverflowError, self.interp.call, 'string', 'index', value, 0) @support.cpython_only @unittest.skipUnless(INT_MAX < PY_SSIZE_T_MAX, "needs UINT_MAX < SIZE_MAX") @support.bigmemtest(size=INT_MAX + 1, memuse=2, dry_run=False) def test_huge_string_builtins(self, size): tk = self.interp.tk value = '1' + ' ' * size self.assertRaises(OverflowError, tk.getint, value) self.assertRaises(OverflowError, tk.getdouble, value) self.assertRaises(OverflowError, tk.getboolean, value) self.assertRaises(OverflowError, tk.eval, value) self.assertRaises(OverflowError, tk.evalfile, value) self.assertRaises(OverflowError, tk.record, value) self.assertRaises(OverflowError, tk.adderrorinfo, value) self.assertRaises(OverflowError, tk.setvar, value, 'x', 'a') self.assertRaises(OverflowError, tk.setvar, 'x', value, 'a') self.assertRaises(OverflowError, tk.unsetvar, value) self.assertRaises(OverflowError, tk.unsetvar, 'x', value) self.assertRaises(OverflowError, tk.adderrorinfo, value) self.assertRaises(OverflowError, tk.exprstring, value) self.assertRaises(OverflowError, tk.exprlong, value) self.assertRaises(OverflowError, tk.exprboolean, value) self.assertRaises(OverflowError, tk.splitlist, value) self.assertRaises(OverflowError, tk.split, value) self.assertRaises(OverflowError, tk.createcommand, value, max) self.assertRaises(OverflowError, tk.deletecommand, value) @support.cpython_only @unittest.skipUnless(INT_MAX < PY_SSIZE_T_MAX, "needs UINT_MAX < SIZE_MAX") @support.bigmemtest(size=INT_MAX + 1, memuse=6, dry_run=False) def test_huge_string_builtins2(self, size): # These commands require larger memory for possible error messages tk = self.interp.tk value = '1' + ' ' * size self.assertRaises(OverflowError, tk.evalfile, value) self.assertRaises(OverflowError, tk.unsetvar, value) self.assertRaises(OverflowError, tk.unsetvar, 'x', value) def setUpModule(): if support.verbose: tcl = Tcl() print('patchlevel =', tcl.call('info', 'patchlevel')) def test_main(): support.run_unittest(TclTest, TkinterTest, BigmemTclTest) if __name__ == "__main__": test_main()
Upload File
Create Folder