X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;ds=sidebyside;f=trunk%2Fpycurl%2Ftests%2Ftest_stringio.py;fp=trunk%2Fpycurl%2Ftests%2Ftest_stringio.py;h=25e639bd6a2ba47ac12b0976531e062f80f2d98a;hb=5a4c1b1278ffa01e630fde47f7c54888ed20a576;hp=0000000000000000000000000000000000000000;hpb=cee5ab52df1c9f38b6eaff2dd354cb22f59028c7;p=plcapi.git diff --git a/trunk/pycurl/tests/test_stringio.py b/trunk/pycurl/tests/test_stringio.py new file mode 100644 index 0000000..25e639b --- /dev/null +++ b/trunk/pycurl/tests/test_stringio.py @@ -0,0 +1,25 @@ +#! /usr/bin/env python +# -*- coding: iso-8859-1 -*- +# vi:ts=4:et +# $Id$ + +import sys +try: + from cStringIO import StringIO +except ImportError: + from StringIO import StringIO +import pycurl + +url = "http://curl.haxx.se/dev/" + +print "Testing", pycurl.version + +body = StringIO() +c = pycurl.Curl() +c.setopt(c.URL, url) +c.setopt(c.WRITEFUNCTION, body.write) +c.perform() +c.close() + +contents = body.getvalue() +print contents