'Simple helper method to preform cql statements and check for expected exception
@param text CQl statement to execute
@param consistency_level Consistency level at which it is to be executed
@param expected_exception Exception expected to be throw or none'

def _perform_cql_statement(self, text, consistency_level, expected_exception, session=None):

    if (session is None):
        session = self.session
    statement = SimpleStatement(text)
    statement.consistency_level = consistency_level
    if (expected_exception is None):
        self.execute_helper(session, statement)
    else:
        with self.assertRaises(expected_exception) as cm:
            self.execute_helper(session, statement)
        if (self.support_v5 and (isinstance(cm.exception, WriteFailure) or isinstance(cm.exception, ReadFailure))):
            if isinstance(cm.exception, ReadFailure):
                self.assertEqual(list(cm.exception.error_code_map.values())[0], 1)
            else:
                self.assertEqual(list(cm.exception.error_code_map.values())[0], 0)
