/usr/share/doc/python3-pycurl/tests
NameSizeModeActions
certs/-0755rm
ext/-0755rm
fake-curl/-0755rm
fixtures/-0755rm
matrix/-0755rm
tmp/-0755rm
__pycache__/-0755rm
app.py40880644editdlrm
appmanager.py13800644editdlrm
cadata_test.py14520644editdlrm
certinfo_test.py34680644editdlrm
close_socket_cb_test.py21680644editdlrm
curl_object_test.py48830644editdlrm
debug_test.py22750644editdlrm
default_write_cb_test.py30390644editdlrm
error_constants_test.py6620644editdlrm
error_test.py29010644editdlrm
failonerror_test.py35090644editdlrm
ftp_test.py15370644editdlrm
global_init_test.py10630644editdlrm
header_cb_test.py15600644editdlrm
header_test.py18480644editdlrm
high_level_curl_test.py6320644editdlrm
info_constants_test.py3870644editdlrm
internals_test.py66740644editdlrm
matrix.py68160644editdlrm
multi_option_constants_test.py25030644editdlrm
multi_socket_test.py30490644editdlrm
multi_test.py123130644editdlrm
multi_timer_test.py26950644editdlrm
open_socket_cb_test.py47610644editdlrm
option_constants_test.py163710644editdlrm
perform_test.py21790644editdlrm
procmgr.py27310644editdlrm
protocol_constants_test.py16790644editdlrm
readdata_test.py96230644editdlrm
read_cb_test.py43400644editdlrm
relative_url_test.py5510644editdlrm
reload_test.py4300644editdlrm
reset_test.py26990644editdlrm
resolve_test.py7800644editdlrm
run-quickstart.sh7680755editdlrm
run.sh6900755editdlrm
runwsgi.py37330644editdlrm
seek_cb_constants_test.py8330644editdlrm
setopt_lifecycle_test.py17970644editdlrm
setopt_string_test.py8160644editdlrm
setopt_test.py37730644editdlrm
setopt_unicode_test.py10920644editdlrm
setup_test.py100350644editdlrm
share_test.py17260644editdlrm
sockopt_cb_test.py24530644editdlrm
unset_range_test.py14820644editdlrm
user_agent_string_test.py8200644editdlrm
util.py82910644editdlrm
version_comparison_test.py5140644editdlrm
version_constants_test.py20560644editdlrm
version_test.py3130644editdlrm
vsftpd.conf2940644editdlrm
weakref_test.py4430644editdlrm
write_abort_test.py11940644editdlrm
write_cb_bogus_test.py13810644editdlrm
write_test.py100480644editdlrm
write_to_stringio_test.py12280644editdlrm
xferinfo_cb_test.py21470644editdlrm
__init__.py5350644editdlrm
Edit: /usr/share/doc/python3-pycurl/tests/internals_test.py (6674B)
#! /usr/bin/env python # -*- coding: utf-8 -*- # vi:ts=4:et import pycurl import unittest try: import cPickle except ImportError: cPickle = None import pickle import copy from . import util class InternalsTest(unittest.TestCase): def setUp(self): self.curl = util.DefaultCurl() def tearDown(self): self.curl.close() del self.curl # /*********************************************************************** # // test misc # ************************************************************************/ def test_constant_aliasing(self): assert self.curl.URL is pycurl.URL # /*********************************************************************** # // test handles # ************************************************************************/ def test_remove_invalid_handle(self): m = pycurl.CurlMulti() try: m.remove_handle(self.curl) except pycurl.error: pass else: assert False, "No exception when trying to remove a handle that is not in CurlMulti" del m def test_remove_invalid_closed_handle(self): m = pycurl.CurlMulti() c = util.DefaultCurl() c.close() m.remove_handle(c) del m, c def test_add_closed_handle(self): m = pycurl.CurlMulti() c = util.DefaultCurl() c.close() try: m.add_handle(c) except pycurl.error: pass else: assert 0, "No exception when trying to add a close handle to CurlMulti" m.close() del m, c def test_add_handle_twice(self): m = pycurl.CurlMulti() m.add_handle(self.curl) try: m.add_handle(self.curl) except pycurl.error: pass else: assert 0, "No exception when trying to add the same handle twice" del m def test_add_handle_on_multiple_stacks(self): m1 = pycurl.CurlMulti() m2 = pycurl.CurlMulti() m1.add_handle(self.curl) try: m2.add_handle(self.curl) except pycurl.error: pass else: assert 0, "No exception when trying to add the same handle on multiple stacks" del m1, m2 def test_move_handle(self): m1 = pycurl.CurlMulti() m2 = pycurl.CurlMulti() m1.add_handle(self.curl) m1.remove_handle(self.curl) m2.add_handle(self.curl) del m1, m2 # /*********************************************************************** # // test copying and pickling - copying and pickling of # // instances of Curl and CurlMulti is not allowed # ************************************************************************/ def test_copy_curl(self): try: copy.copy(self.curl) # python 2 raises copy.Error, python 3 raises TypeError except (copy.Error, TypeError): pass else: assert False, "No exception when trying to copy a Curl handle" def test_copy_multi(self): m = pycurl.CurlMulti() try: copy.copy(m) except (copy.Error, TypeError): pass else: assert False, "No exception when trying to copy a CurlMulti handle" def test_copy_share(self): s = pycurl.CurlShare() try: copy.copy(s) except (copy.Error, TypeError): pass else: assert False, "No exception when trying to copy a CurlShare handle" def test_pickle_curl(self): fp = util.StringIO() p = pickle.Pickler(fp, 1) try: p.dump(self.curl) # python 2 raises pickle.PicklingError, python 3 raises TypeError except (pickle.PicklingError, TypeError): pass else: assert 0, "No exception when trying to pickle a Curl handle" del fp, p def test_pickle_multi(self): m = pycurl.CurlMulti() fp = util.StringIO() p = pickle.Pickler(fp, 1) try: p.dump(m) except (pickle.PicklingError, TypeError): pass else: assert 0, "No exception when trying to pickle a CurlMulti handle" del m, fp, p def test_pickle_share(self): s = pycurl.CurlShare() fp = util.StringIO() p = pickle.Pickler(fp, 1) try: p.dump(s) except (pickle.PicklingError, TypeError): pass else: assert 0, "No exception when trying to pickle a CurlShare handle" del s, fp, p def test_pickle_dumps_curl(self): try: pickle.dumps(self.curl) # python 2 raises pickle.PicklingError, python 3 raises TypeError except (pickle.PicklingError, TypeError): pass else: self.fail("No exception when trying to pickle a Curl handle") def test_pickle_dumps_multi(self): m = pycurl.CurlMulti() try: pickle.dumps(m) except (pickle.PicklingError, TypeError): pass else: self.fail("No exception when trying to pickle a CurlMulti handle") def test_pickle_dumps_share(self): s = pycurl.CurlShare() try: pickle.dumps(s) except (pickle.PicklingError, TypeError): pass else: self.fail("No exception when trying to pickle a CurlShare handle") if cPickle is not None: def test_cpickle_curl(self): fp = util.StringIO() p = cPickle.Pickler(fp, 1) try: p.dump(self.curl) except cPickle.PicklingError: pass else: assert 0, "No exception when trying to pickle a Curl handle via cPickle" del fp, p def test_cpickle_multi(self): m = pycurl.CurlMulti() fp = util.StringIO() p = cPickle.Pickler(fp, 1) try: p.dump(m) except cPickle.PicklingError: pass else: assert 0, "No exception when trying to pickle a CurlMulti handle via cPickle" del m, fp, p def test_cpickle_share(self): s = pycurl.CurlMulti() fp = util.StringIO() p = cPickle.Pickler(fp, 1) try: p.dump(s) except cPickle.PicklingError: pass else: assert 0, "No exception when trying to pickle a CurlShare handle via cPickle" del s, fp, p