'Test errors thrown when creating or deleting indices.'

def testCreateDelete(self):

    result = self.conn.indices.create_index(self.index_name)
    self.assertTrue(('acknowledge' in result))
    self.assertTrue(('error' not in result))
    err = self.checkRaises(exceptions.IndexAlreadyExistsException, self.conn.indices.create_index, self.index_name)
    self.assertEqual(str(err), '[test-index]    already    exists')
    self.assertEqual(err.status, 400)
    self.assertTrue(('error' in err.result))
    self.assertTrue(('ok' not in err.result))
    result = self.conn.indices.delete_index(self.index_name)
    self.assertTrue(('ok' in result))
    self.assertTrue(('error' not in result))
    err = self.checkRaises(exceptions.IndexMissingException, self.conn.indices.delete_index, self.index_name)
    self.assertEqual(str(err), '[test-index]    missing')
    self.assertEqual(err.status, 404)
    self.assertTrue(('error' in err.result))
    self.assertTrue(('ok' not in err.result))
