예제 #1
0
    except Exception as e:
        testCase.failure = e


def cursorAndExecuteSelect(testCase, session, threadId):
    try:
        with session.cursor() as cursor:
            for row in cursor.execute("SELECT * FROM DBC.DBCInfo"):
                logger.info(str(threadId) + ": " + str(row))
    except Exception as e:
        testCase.failure = e


# The unit tests in the UdaExecExecuteTest are execute once for each named
# data source below.
util.createTestCasePerDSN(
    UdaExecExecuteTest, unittest.TestCase, ("HTTP", "HTTPS", "ODBC"))

if __name__ == '__main__':
    formatter = logging.Formatter(
        "%(asctime)s - %(name)s - %(levelname)s - %(message)s")
    sh = logging.StreamHandler(sys.stdout)
    sh.setFormatter(formatter)
    sh.setLevel(logging.INFO)
    root = logging.getLogger()
    root.setLevel(logging.INFO)
    root.addHandler(sh)

configFiles = [os.path.join(os.path.dirname(__file__), 'udaexec.ini')]
udaExec = teradata.UdaExec(configFiles=configFiles, configureLogging=False)
udaExec.checkpoint()
예제 #2
0
    except Exception as e:
        testCase.failure = e


def cursorAndExecuteSelect(testCase, session, threadId):
    try:
        with session.cursor() as cursor:
            for row in cursor.execute("SELECT * FROM DBC.DBCInfo"):
                logger.info(str(threadId) + ": " + str(row))
    except Exception as e:
        testCase.failure = e


# The unit tests in the UdaExecExecuteTest are execute once for each named
# data source below.
util.createTestCasePerDSN(
    UdaExecExecuteTest, unittest.TestCase,  ("HTTP", "HTTPS", "ODBC"))

if __name__ == '__main__':
    formatter = logging.Formatter(
        "%(asctime)s - %(name)s - %(levelname)s - %(message)s")
    sh = logging.StreamHandler(sys.stdout)
    sh.setFormatter(formatter)
    sh.setLevel(logging.INFO)
    root = logging.getLogger()
    root.setLevel(logging.INFO)
    root.addHandler(sh)

configFiles = [os.path.join(os.path.dirname(__file__), 'udaexec.ini')]
udaExec = teradata.UdaExec(configFiles=configFiles, configureLogging=False)
udaExec.checkpoint()