...........................................................................................................................................................................................................................................................................................................................@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@%PDF-1.5 MRK IS HERE %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY
| Server IP : 65.108.66.160 / Your IP : 216.73.216.26 Web Server : Apache System : Linux srv16.asso.com.ar 4.18.0-553.123.1.el8_10.x86_64 #1 SMP Tue May 5 04:00:43 EDT 2026 x86_64 User : alasaweborg ( 1047) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /proc/self/root/usr/share/doc/python3-pycurl/tests/ |
Upload File : |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
import os.path
import pycurl
import sys
import unittest
class WriteAbortTest(unittest.TestCase):
def setUp(self):
self.curl = pycurl.Curl()
def tearDown(self):
self.curl.close()
def write_cb_returning_string(self, data):
return 'foo'
def write_cb_returning_float(self, data):
return 0.5
def test_write_cb_returning_string(self):
self.check(self.write_cb_returning_string)
def test_write_cb_returning_float(self):
self.check(self.write_cb_returning_float)
def check(self, write_cb):
# download the script itself through the file:// protocol into write_cb
self.curl.setopt(pycurl.URL, 'file://' + os.path.abspath(__file__).replace('\\', '/'))
self.curl.setopt(pycurl.WRITEFUNCTION, write_cb)
try:
self.curl.perform()
self.fail('Should not get here')
except pycurl.error:
err, msg = sys.exc_info()[1].args
# we expect pycurl.E_WRITE_ERROR as the response
assert pycurl.E_WRITE_ERROR == err
# actual error
assert hasattr(sys, 'last_type')
self.assertEqual(pycurl.error, sys.last_type)
assert hasattr(sys, 'last_value')
self.assertEqual('write callback must return int or None', str(sys.last_value))