pass # default should make a local SQL Server connection
elif node == "xxx":  # try Postgres database
    _computername = "25.223.161.222"
    _databasename='adotest'
    _username = '******'
    _password = '******'
    _driver="PostgreSQL Unicode"
    _provider = ''
    connStr = '%sDriver={%s};Server=%s;Database=%s;uid=%s;pwd=%s;' % \
                  (_provider,_driver,_computername,_databasename,_username,_password)
elif node == "yyy":  # ACCESS data base is known to fail some tests.
    if is64bit.Python():
        driver = "Microsoft.ACE.OLEDB.12.0"
    else:
        driver = "Microsoft.Jet.OLEDB.4.0"
    testmdb = setuptestframework.makemdb(testfolder)
    connStr = r"Provider=%s;Data Source=%s" % (driver, testmdb)
else: # try a remote connection to an SQL server
    conn_kws['proxy_host'] = '25.44.77.176'
    import adodbapi.remote
    db = adodbapi.remote

print(('Using Connection String like=%s' % connStr))
print(('Keywords=%s' % repr(conn_kws)))

class test_adodbapi(dbapi20.DatabaseAPI20Test):
    driver = db
    connect_args = (connStr,)
    connect_kw_args = conn_kws

    def __init__(self,arg):
Beispiel #2
0
iterateOverTimeTests = ('--time' in sys.argv or doAllTests) and onWindows

THE_PROXY_HOST = '25.44.77.176' if node != SQL_HOST_NODE or not onWindows else '::1'  # -- change this

try:  # If mx extensions are installed, use mxDateTime
    import mx.DateTime

    doMxDateTimeTest = True
except:
    doMxDateTimeTest = False  # Requires eGenixMXExtensions

doTimeTest = True  # obsolete python time format

if doAccessTest:
    if onWindows and (node == SQL_HOST_NODE or not is64bit.Python()):
        c = {'mdb': setuptestframework.makemdb(testfolder, mdb_name)}
    else:
        c = {'macro_find_temp_test_path': ['mdb', 'server_test.mdb'],
             'proxy_host': THE_PROXY_HOST}

    # macro definition for keyword "driver"  using macro "is64bit" -- see documentation
    c['macro_is64bit'] = ['driver', "Microsoft.ACE.OLEDB.12.0", "Microsoft.Jet.OLEDB.4.0"]
    connStrAccess = "Provider=%(driver)s;Data Source=%(mdb)s"
    print('    ...Testing ACCESS connection...')
    doAccessTest, connStrAccess, dbAccessconnect = tryconnection.try_connection(verbose, connStrAccess, 10, **c)

if doSqlServerTest:
    c = {'macro_getnode': ['host', r"%s\SQLExpress"],  # name of computer with SQL Server
         # 'host':'25.44.77.176;' # Network Library=dbmssocn',
         'database': "adotest",
         'user': '******',  # None implies Windows security
    _driver = "PostgreSQL Unicode"
    _provider = ""
    connStr = "%sDriver={%s};Server=%s;Database=%s;uid=%s;pwd=%s;" % (
        _provider,
        _driver,
        _computername,
        _databasename,
        _username,
        _password,
    )
elif node == "yyy":  # ACCESS data base is known to fail some tests.
    if is64bit.Python():
        driver = "Microsoft.ACE.OLEDB.12.0"
    else:
        driver = "Microsoft.Jet.OLEDB.4.0"
    testmdb = setuptestframework.makemdb(testfolder)
    connStr = r"Provider=%s;Data Source=%s" % (driver, testmdb)
else:  # try a remote connection to an SQL server
    conn_kws["proxy_host"] = "25.44.77.176"
    import adodbapi.remote

    db = adodbapi.remote

print("Using Connection String like=%s" % connStr)
print("Keywords=%s" % repr(conn_kws))


class test_adodbapi(dbapi20.DatabaseAPI20Test):
    driver = db
    connect_args = (connStr,)
    connect_kw_args = conn_kws
iterateOverTimeTests = ("--time" in sys.argv or doAllTests) and onWindows

THE_PROXY_HOST = "25.44.77.176" if node != SQL_HOST_NODE or not onWindows else "::1"  # -- change this

try:  # If mx extensions are installed, use mxDateTime
    import mx.DateTime

    doMxDateTimeTest = True
except:
    doMxDateTimeTest = False  # Requires eGenixMXExtensions

doTimeTest = True  # obsolete python time format

if doAccessTest:
    if onWindows and (node == SQL_HOST_NODE or not is64bit.Python()):
        c = {"mdb": setuptestframework.makemdb(testfolder, mdb_name)}
    else:
        c = {"macro_find_temp_test_path": ["mdb", "server_test.mdb"], "proxy_host": THE_PROXY_HOST}

    # macro definition for keyword "driver"  using macro "is64bit" -- see documentation
    c["macro_is64bit"] = ["driver", "Microsoft.ACE.OLEDB.12.0", "Microsoft.Jet.OLEDB.4.0"]
    connStrAccess = "Provider=%(driver)s;Data Source=%(mdb)s"
    print("    ...Testing ACCESS connection...")
    doAccessTest, connStrAccess, dbAccessconnect = tryconnection.try_connection(verbose, connStrAccess, 10, **c)

if doSqlServerTest:
    c = {
        "macro_getnode": ["host", r"%s\SQLExpress"],  # name of computer with SQL Server
        #'host':'25.44.77.176;' # Network Library=dbmssocn',
        "database": "adotest",
        "user": "******",  # None implies Windows security
Beispiel #5
0
doPostgresTest = '--pg' in sys.argv or doAllTests
iterateOverTimeTests = ('--time' in sys.argv or doAllTests) and onWindows

THE_PROXY_HOST = '25.44.77.176' if node != SQL_HOST_NODE or not onWindows else '::1' # -- change this

try: #If mx extensions are installed, use mxDateTime
    import mx.DateTime
    doMxDateTimeTest=True
except: 
    doMxDateTimeTest=False #Requires eGenixMXExtensions

doTimeTest = True # obsolete python time format

if doAccessTest:
    if onWindows and (node == SQL_HOST_NODE or not is64bit.Python()):
        c = {'mdb': setuptestframework.makemdb(testfolder, mdb_name)}
    else:
        c = {'macro_find_temp_test_path' : ['mdb', 'server_test.mdb'],
            'proxy_host' : THE_PROXY_HOST}


    # macro definition for keyword "driver"  using macro "is64bit" -- see documentation
    c['macro_is64bit'] = ['driver', "Microsoft.ACE.OLEDB.12.0", "Microsoft.Jet.OLEDB.4.0"]
    connStrAccess = "Provider=%(driver)s;Data Source=%(mdb)s"
    print('    ...Testing ACCESS connection...')
    doAccessTest, connStrAccess, dbAccessconnect = tryconnection.try_connection(verbose, connStrAccess, 10, **c)

if doSqlServerTest:
    c = {'macro_getnode' : ['host', r"%s\SQLExpress"],  # name of computer with SQL Server
        #'host':'25.44.77.176;' # Network Library=dbmssocn',
        'database': "adotest",
Beispiel #6
0
doAccessTest = node != 'novelt2' or doAllTests
doSqlServerTest = node == 'novelt2' or doAllTests
doMySqlTest = '--mysql' in sys.argv or doAllTests
doPostgresTest = '--pg' in sys.argv or doAllTests
iterateOverTimeTests = '--time' in sys.argv or doAllTests

try:  #If mx extensions are installed, use mxDateTime
    import mx.DateTime
    doMxDateTimeTest = True
except:
    doMxDateTimeTest = False  #Requires eGenixMXExtensions

doTimeTest = True  # obsolete python time format

if doAccessTest:
    c = {'dsn': setuptestframework.makemdb(testfolder)}
    if is64bit.Python():
        c['driver'] = "Microsoft.ACE.OLEDB.12.0"
    else:
        c['driver'] = "Microsoft.Jet.OLEDB.4.0"
    connStrAccess = "Provider=%(driver)s;Data Source=%(dsn)s" % c
    doAccessTest = tryconnection.try_connection(connStrAccess)

if doSqlServerTest:
    _computername = "192.168.100.101"  # name of computer with SQL Server
    _databasename = "vernon"  #or something else
    #_username="******"
    #_password="******"
    #if is64bit:
    #    connStrSQLServer = "Provider=SQLNCLI11;Data Source=tcp:o9our2opzq.database.windows.net;Database=ADOtest;User ID=vernondcole@o9our2opzq;Password=Az0456xxx;Encrypt=True;"
    #else:
Beispiel #7
0
    import mx.DateTime

    doMxDateTimeTest = True
except:
    doMxDateTimeTest = False  # Requires eGenixMXExtensions

doTimeTest = True  # obsolete python time format

if doAccessTest:
    if proxy_host:  # determine the (probably remote) database file folder
        c = {
            "macro_find_temp_test_path": ["mdb", mdb_name],
            "proxy_host": proxy_host
        }
    else:
        c = {"mdb": setuptestframework.makemdb(testfolder, mdb_name)}

    # macro definition for keyword "provider"  using macro "is64bit" -- see documentation
    # is64bit will return true for 64 bit versions of Python, so the macro will select the ACE provider
    # (If running a remote ADO service, this will test the 64-bitedness of the ADO server.)
    c["macro_is64bit"] = [
        "provider",
        "Microsoft.ACE.OLEDB.12.0",  # 64 bit provider
        "Microsoft.Jet.OLEDB.4.0",
    ]  # 32 bit provider
    connStrAccess = "Provider=%(provider)s;Data Source=%(mdb)s"  # ;Mode=ReadWrite;Persist Security Info=False;Jet OLEDB:Bypass UserInfo Validation=True"
    print("    ...Testing ACCESS connection to {} file...".format(
        c.get("mdb", "remote .mdb")))
    doAccessTest, connStrAccess, dbAccessconnect = tryconnection.try_connection(
        verbose, connStrAccess, 10, **c)
doAccessTest = node != 'novelt2' or doAllTests
doSqlServerTest = node == 'novelt2' or doAllTests
doMySqlTest = '--mysql' in sys.argv or doAllTests
doPostgresTest =  '--pg' in sys.argv or doAllTests
iterateOverTimeTests = '--time' in sys.argv or doAllTests

try: #If mx extensions are installed, use mxDateTime
    import mx.DateTime
    doMxDateTimeTest=True
except: 
    doMxDateTimeTest=False #Requires eGenixMXExtensions

doTimeTest = True # obsolete python time format

if doAccessTest:
    c = {'dsn': setuptestframework.makemdb(testfolder)}
    if is64bit.Python():
        c['driver'] = "Microsoft.ACE.OLEDB.12.0"
    else:
        c['driver'] = "Microsoft.Jet.OLEDB.4.0"
    connStrAccess = "Provider=%(driver)s;Data Source=%(dsn)s" % c
    doAccessTest = tryconnection.try_connection(connStrAccess)
   
if doSqlServerTest:
    _computername = "192.168.100.101" # name of computer with SQL Server
    _databasename = "vernon" #or something else
    #_username="******"
    #_password="******"
    #if is64bit:
    #    connStrSQLServer = "Provider=SQLNCLI11;Data Source=tcp:o9our2opzq.database.windows.net;Database=ADOtest;User ID=vernondcole@o9our2opzq;Password=Az0456xxx;Encrypt=True;"
    #else: