'Test errors thrown when creating or deleting indices.'

def testDumpCurl(self):

    dump = StringIO()
    conn = get_conn(dump_curl=dump)
    result = conn.index(dict(title='Hi'), self.index_name, self.document_type)
    self.assertTrue(('ok' in result))
    self.assertTrue(('error' not in result))
    dump = dump.getvalue().decode('utf-8')
    self.assertTrue(('\n                                                curl    -XPOST    \'http://127.0.0.1:9200/test-index/test-type?pretty=true\'    -d    \'{"title":    "Hi"}\'\n                                                '.strip() in dump))
