

def check_post(self, send, expect, endpoint):
    self.curl.setopt(pycurl.URL, endpoint)
    self.curl.setopt(pycurl.HTTPPOST, send)
    sio = util.StringIO()
    self.curl.setopt(pycurl.WRITEFUNCTION, sio.write)
    self.curl.perform()
    body = sio.getvalue()
    returned_fields = json.loads(body)
    self.assertEqual(expect, returned_fields)

dataset/ETHPy150Open cloudaice/simple-data/misc/virtenv/share/doc/pycurl/tests/post_test.py PostTest.check_post/original