

def test_post_file(self):
    path = os.path.join(os.path.dirname(__file__), '..', 'README.rst')
    f = open(path)
    try:
        contents = f.read()
    finally:
        f.close()
    send = [('field2', (pycurl.FORM_FILE, path))]
    expect = [{
        'name': 'field2',
        'filename': 'README.rst',
        'data': contents,
    }]
    self.check_post(send, expect, 'http://localhost:8380/files')

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