python-cx_Oracle/test/SetupTest.py
Anthony Tuininga cd9c7e3fa3 Adjust test suite so that it runs unchanged against Oracle Cloud databases:
- administrative user is ADMIN on the Oracle Cloud databases and SYSTEM on
  local databases (SYSDBA is not available on the Oracle Cloud database)
- environment variables CX_ORACLE_TEST_SYSDBA_USER and
  CX_ORACLE_TEST_SYSDBA_PASSWORD are replaced with CX_ORACLE_TEST_ADMIN_USER
  and CX_ORACLE_TEST_ADMIN_PASSWORD
- skip tests that change passwords as passwords on Oracle Cloud database are
  strictly controlled
- skip tests that check subscriptions as these are not currently supported on
  Oracle Cloud database
2019-11-13 16:43:49 -07:00

34 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 administrative user (usually SYSTEM or ADMIN)
conn = cx_Oracle.connect(TestEnv.GetAdminConnectString())
# 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.")