/
usr
/
share
/
doc
/
python3-pycurl
/
tests
/
/usr/share/doc/python3-pycurl/tests
mkdir
upload
Name
Size
Mode
Actions
certs/
-
0755
rm
ext/
-
0755
rm
fake-curl/
-
0755
rm
fixtures/
-
0755
rm
matrix/
-
0755
rm
tmp/
-
0755
rm
__pycache__/
-
0755
rm
app.py
4088
0644
edit
dl
rm
appmanager.py
1380
0644
edit
dl
rm
cadata_test.py
1452
0644
edit
dl
rm
certinfo_test.py
3468
0644
edit
dl
rm
close_socket_cb_test.py
2168
0644
edit
dl
rm
curl_object_test.py
4883
0644
edit
dl
rm
debug_test.py
2275
0644
edit
dl
rm
default_write_cb_test.py
3039
0644
edit
dl
rm
error_constants_test.py
662
0644
edit
dl
rm
error_test.py
2901
0644
edit
dl
rm
failonerror_test.py
3509
0644
edit
dl
rm
ftp_test.py
1537
0644
edit
dl
rm
global_init_test.py
1063
0644
edit
dl
rm
header_cb_test.py
1560
0644
edit
dl
rm
header_test.py
1848
0644
edit
dl
rm
high_level_curl_test.py
632
0644
edit
dl
rm
info_constants_test.py
387
0644
edit
dl
rm
internals_test.py
6674
0644
edit
dl
rm
matrix.py
6816
0644
edit
dl
rm
multi_option_constants_test.py
2503
0644
edit
dl
rm
multi_socket_test.py
3049
0644
edit
dl
rm
multi_test.py
12313
0644
edit
dl
rm
multi_timer_test.py
2695
0644
edit
dl
rm
open_socket_cb_test.py
4761
0644
edit
dl
rm
option_constants_test.py
16371
0644
edit
dl
rm
perform_test.py
2179
0644
edit
dl
rm
procmgr.py
2731
0644
edit
dl
rm
protocol_constants_test.py
1679
0644
edit
dl
rm
readdata_test.py
9623
0644
edit
dl
rm
read_cb_test.py
4340
0644
edit
dl
rm
relative_url_test.py
551
0644
edit
dl
rm
reload_test.py
430
0644
edit
dl
rm
reset_test.py
2699
0644
edit
dl
rm
resolve_test.py
780
0644
edit
dl
rm
run-quickstart.sh
768
0755
edit
dl
rm
run.sh
690
0755
edit
dl
rm
runwsgi.py
3733
0644
edit
dl
rm
seek_cb_constants_test.py
833
0644
edit
dl
rm
setopt_lifecycle_test.py
1797
0644
edit
dl
rm
setopt_string_test.py
816
0644
edit
dl
rm
setopt_test.py
3773
0644
edit
dl
rm
setopt_unicode_test.py
1092
0644
edit
dl
rm
setup_test.py
10035
0644
edit
dl
rm
share_test.py
1726
0644
edit
dl
rm
sockopt_cb_test.py
2453
0644
edit
dl
rm
unset_range_test.py
1482
0644
edit
dl
rm
user_agent_string_test.py
820
0644
edit
dl
rm
util.py
8291
0644
edit
dl
rm
version_comparison_test.py
514
0644
edit
dl
rm
version_constants_test.py
2056
0644
edit
dl
rm
version_test.py
313
0644
edit
dl
rm
vsftpd.conf
294
0644
edit
dl
rm
weakref_test.py
443
0644
edit
dl
rm
write_abort_test.py
1194
0644
edit
dl
rm
write_cb_bogus_test.py
1381
0644
edit
dl
rm
write_test.py
10048
0644
edit
dl
rm
write_to_stringio_test.py
1228
0644
edit
dl
rm
xferinfo_cb_test.py
2147
0644
edit
dl
rm
__init__.py
535
0644
edit
dl
rm
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
Save
cmd:
run