python-cx_Oracle/test/TestEnv.py
Anthony Tuininga 2e26d0beb8 Continued work on Unicode support; added new test cases for full unicode
support within Python 2.x; move away from character semantics which Oracle is
deprecating anyway to byte semantics which should hopefully eliminate the
problem with a backend character set of UTF-8.
2008-10-14 04:51:43 +00:00

21 lines
528 B
Python

"""Define test environment."""
import cx_Oracle
import os
import sys
import unittest
def GetValue(name, label):
value = os.environ.get("CX_ORACLE_" + name)
if value is None:
value = raw_input(label + ": ")
if hasattr(cx_Oracle, "UNICODE") or sys.version_info[0] >= 3:
return value
return unicode(value)
USERNAME = GetValue("USERNAME", "user name")
PASSWORD = GetValue("PASSWORD", "password")
TNSENTRY = GetValue("TNSENTRY", "TNS entry")
ARRAY_SIZE = int(GetValue("ARRAY_SIZE", "array size"))