

def test_socket_open(self):
    self.curl.setopt(pycurl.OPENSOCKETFUNCTION, socket_open)
    self.curl.setopt(self.curl.URL, 'http://localhost:8380/success')
    sio = util.StringIO()
    self.curl.setopt(pycurl.WRITEFUNCTION, sio.write)
    self.curl.perform()
    assert socket_open_called
    self.assertEqual('success', sio.getvalue())

dataset/ETHPy150Open cloudaice/simple-data/misc/virtenv/share/doc/pycurl/tests/socket_open_test.py SocketOpenTest.test_socket_open/original