Linux ip-148-66-134-25.ip.secureserver.net 3.10.0-1160.119.1.el7.tuxcare.els11.x86_64 #1 SMP Sun Nov 3 09:06:59 UTC 2024 x86_64
Apache
: 148.66.134.25 | : 3.133.146.94
66 Domain
8.0.30
amvm
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
BLACK DEFEND!
README
+ Create Folder
+ Create File
/
usr /
share /
doc /
python-pycurl-7.19.0 /
tests /
[ HOME SHELL ]
Name
Size
Permission
Action
test.py
1.91
KB
-rw-r--r--
test_cb.py
693
B
-rw-r--r--
test_debug.py
340
B
-rw-r--r--
test_ftp.py
289
B
-rw-r--r--
test_getinfo.py
1.39
KB
-rw-r--r--
test_gtk.py
2.67
KB
-rw-r--r--
test_internals.py
5.48
KB
-rw-r--r--
test_memleak.py
1.1
KB
-rw-r--r--
test_multi.py
676
B
-rw-r--r--
test_multi2.py
1.71
KB
-rw-r--r--
test_multi3.py
2.02
KB
-rw-r--r--
test_multi4.py
1.37
KB
-rw-r--r--
test_multi5.py
1.44
KB
-rw-r--r--
test_multi6.py
1.5
KB
-rw-r--r--
test_multi_socket.py
1.88
KB
-rw-r--r--
test_multi_socket_select.py
2.39
KB
-rw-r--r--
test_multi_timer.py
1.71
KB
-rw-r--r--
test_multi_vs_thread.py
5.64
KB
-rw-r--r--
test_post.py
589
B
-rw-r--r--
test_post2.py
535
B
-rw-r--r--
test_post3.py
804
B
-rw-r--r--
test_reset.py
2.19
KB
-rw-r--r--
test_share.py
714
B
-rw-r--r--
test_socketopen.py
440
B
-rw-r--r--
test_stringio.py
473
B
-rw-r--r--
test_write_abort.py
663
B
-rw-r--r--
test_xmlrpc.py
744
B
-rw-r--r--
util.py
949
B
-rw-r--r--
util.pyc
1004
B
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : test_internals.py
#! /usr/bin/env python # -*- coding: iso-8859-1 -*- # vi:ts=4:et # $Id: test_internals.py,v 1.17 2003/05/01 16:48:54 mfx Exp $ # # a simple self-test # try: # need Python 2.2 or better for garbage collection from gc import get_objects import gc del get_objects gc.enable() except ImportError: gc = None import copy, os, sys from StringIO import StringIO try: import cPickle except ImportError: cPickle = None try: import pickle except ImportError: pickle = None # update sys.path when running in the build directory from util import get_sys_path sys.path = get_sys_path() import pycurl from pycurl import Curl, CurlMulti class opts: verbose = 1 if "-q" in sys.argv: opts.verbose = opts.verbose - 1 print "Python", sys.version print "PycURL %s (compiled against 0x%x)" % (pycurl.version, pycurl.COMPILE_LIBCURL_VERSION_NUM) print "PycURL version info", pycurl.version_info() print " %s, compiled %s" % (pycurl.__file__, pycurl.COMPILE_DATE) # /*********************************************************************** # // test misc # ************************************************************************/ if 1: c = Curl() assert c.URL is pycurl.URL del c # /*********************************************************************** # // test handles # ************************************************************************/ # remove an invalid handle: this should fail if 1: m = CurlMulti() c = Curl() try: m.remove_handle(c) except pycurl.error: pass else: assert 0, "internal error" del m, c # remove an invalid but closed handle if 1: m = CurlMulti() c = Curl() c.close() m.remove_handle(c) del m, c # add a closed handle: this should fail if 1: m = CurlMulti() c = Curl() c.close() try: m.add_handle(c) except pycurl.error: pass else: assert 0, "internal error" m.close() del m, c # add a handle twice: this should fail if 1: m = CurlMulti() c = Curl() m.add_handle(c) try: m.add_handle(c) except pycurl.error: pass else: assert 0, "internal error" del m, c # add a handle on multiple stacks: this should fail if 1: m1 = CurlMulti() m2 = CurlMulti() c = Curl() m1.add_handle(c) try: m2.add_handle(c) except pycurl.error: pass else: assert 0, "internal error" del m1, m2, c # move a handle if 1: m1 = CurlMulti() m2 = CurlMulti() c = Curl() m1.add_handle(c) m1.remove_handle(c) m2.add_handle(c) del m1, m2, c # /*********************************************************************** # // test copying and pickling - copying and pickling of # // instances of Curl and CurlMulti is not allowed # ************************************************************************/ if 1 and copy: c = Curl() m = CurlMulti() try: copy.copy(c) except copy.Error: pass else: assert 0, "internal error - copying should fail" try: copy.copy(m) except copy.Error: pass else: assert 0, "internal error - copying should fail" if 1 and pickle: c = Curl() m = CurlMulti() fp = StringIO() p = pickle.Pickler(fp, 1) try: p.dump(c) except pickle.PicklingError: pass else: assert 0, "internal error - pickling should fail" try: p.dump(m) except pickle.PicklingError: pass else: assert 0, "internal error - pickling should fail" del c, m, fp, p if 1 and cPickle: c = Curl() m = CurlMulti() fp = StringIO() p = cPickle.Pickler(fp, 1) try: p.dump(c) except cPickle.PicklingError: pass else: assert 0, "internal error - pickling should fail" try: p.dump(m) except cPickle.PicklingError: pass else: assert 0, "internal error - pickling should fail" del c, m, fp, p # /*********************************************************************** # // test refcounts # ************************************************************************/ # basic check of reference counting (use a memory checker like valgrind) if 1: c = Curl() m = CurlMulti() m.add_handle(c) del m m = CurlMulti() c.close() del m, c # basic check of cyclic garbage collection if 1 and gc: gc.collect() c = Curl() c.m = CurlMulti() c.m.add_handle(c) # create some nasty cyclic references c.c = c c.c.c1 = c c.c.c2 = c c.c.c3 = c.c c.c.c4 = c.m c.m.c = c c.m.m = c.m c.m.c = c # delete gc.collect() flags = gc.DEBUG_COLLECTABLE | gc.DEBUG_UNCOLLECTABLE | gc.DEBUG_OBJECTS if opts.verbose >= 1: flags = flags | gc.DEBUG_STATS gc.set_debug(flags) gc.collect() ##print gc.get_referrers(c) ##print gc.get_objects() if opts.verbose >= 1: print "Tracked objects:", len(gc.get_objects()) # The `del' below should delete these 4 objects: # Curl + internal dict, CurlMulti + internal dict del c gc.collect() if opts.verbose >= 1: print "Tracked objects:", len(gc.get_objects()) if 1: # Ensure that the refcounting error in "reset" is fixed: for i in xrange(100000): c = Curl() c.reset() # /*********************************************************************** # // done # ************************************************************************/ print "All tests passed."
Close