python-cx_Oracle/test/SetupTest.py
Anthony Tuininga 4ed95aad94 Reworked test suite to eliminate the use of default passwords and to make the
individual test modules directly runnable (instead of using execfile() within
test.py).
2019-01-31 10:18:04 -07:00

35 lines
1.1 KiB
Python

#------------------------------------------------------------------------------
# Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
# SetupTest.py
#
# Creates users and populates their schemas with the tables and packages
# necessary for the cx_Oracle test suite.
#------------------------------------------------------------------------------
from __future__ import print_function
import cx_Oracle
import TestEnv
import DropTest
# connect as SYSDBA
conn = cx_Oracle.connect(TestEnv.GetSysdbaConnectString(),
mode = cx_Oracle.SYSDBA)
# drop existing users and editions, if applicable
DropTest.DropTests(conn)
# create test schemas
print("Creating test schemas...")
TestEnv.RunSqlScript(conn, "SetupTest",
main_user = TestEnv.GetMainUser(),
main_password = TestEnv.GetMainPassword(),
proxy_user = TestEnv.GetProxyUser(),
proxy_password = TestEnv.GetProxyPassword())
print("Done.")