/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/multi_option_constants_test.py (2503B)
#! /usr/bin/env python # -*- coding: utf-8 -*- # vi:ts=4:et import sys import pycurl import unittest from . import util class MultiOptionConstantsTest(unittest.TestCase): def setUp(self): super(MultiOptionConstantsTest, self).setUp() self.m = pycurl.CurlMulti() def tearDown(self): super(MultiOptionConstantsTest, self).tearDown() self.m.close() def test_option_constant_on_pycurl(self): assert hasattr(pycurl, 'M_PIPELINING') def test_option_constant_on_curlmulti(self): assert hasattr(self.m, 'M_PIPELINING') @util.min_libcurl(7, 43, 0) def test_pipe_constants(self): self.m.setopt(self.m.M_PIPELINING, self.m.PIPE_NOTHING) self.m.setopt(self.m.M_PIPELINING, self.m.PIPE_HTTP1) self.m.setopt(self.m.M_PIPELINING, self.m.PIPE_MULTIPLEX) @util.min_libcurl(7, 30, 0) def test_multi_pipeline_opts(self): assert hasattr(pycurl, 'M_MAX_HOST_CONNECTIONS') assert hasattr(pycurl, 'M_MAX_PIPELINE_LENGTH') assert hasattr(pycurl, 'M_CONTENT_LENGTH_PENALTY_SIZE') assert hasattr(pycurl, 'M_CHUNK_LENGTH_PENALTY_SIZE') assert hasattr(pycurl, 'M_MAX_TOTAL_CONNECTIONS') self.m.setopt(pycurl.M_MAX_HOST_CONNECTIONS, 2) self.m.setopt(pycurl.M_MAX_PIPELINE_LENGTH, 2) self.m.setopt(pycurl.M_CONTENT_LENGTH_PENALTY_SIZE, 2) self.m.setopt(pycurl.M_CHUNK_LENGTH_PENALTY_SIZE, 2) self.m.setopt(pycurl.M_MAX_TOTAL_CONNECTIONS, 2) @util.min_libcurl(7, 30, 0) def test_multi_pipelining_site_bl(self): self.check_multi_charpp_option(self.m.M_PIPELINING_SITE_BL) @util.min_libcurl(7, 30, 0) def test_multi_pipelining_server_bl(self): self.check_multi_charpp_option(self.m.M_PIPELINING_SERVER_BL) def check_multi_charpp_option(self, option): input = [util.b('test1'), util.b('test2')] self.m.setopt(option, input) input = [util.u('test1'), util.u('test2')] self.m.setopt(option, input) self.m.setopt(option, []) input = (util.b('test1'), util.b('test2')) self.m.setopt(option, input) input = (util.u('test1'), util.u('test2')) self.m.setopt(option, input) self.m.setopt(option, ()) try: self.m.setopt(option, 1) self.fail('expected to raise') except TypeError: exc = sys.exc_info()[1] assert 'integers are not supported for this option' in str(exc)