Skip to content

Commit 6b9a7b0

Browse files
Rename "base" to "test_env" to be clearer as to the purpose of the module.
1 parent c76492e commit 6b9a7b0

29 files changed

+263
-246
lines changed

test/DropTest.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@
99
#------------------------------------------------------------------------------
1010

1111
import cx_Oracle
12-
import base
12+
import test_env
1313

1414
def drop_tests(conn):
1515
print("Dropping test schemas...")
16-
base.run_sql_script(conn, "DropTest",
17-
main_user=base.get_main_user(),
18-
proxy_user=base.get_proxy_user())
16+
test_env.run_sql_script(conn, "DropTest",
17+
main_user=test_env.get_main_user(),
18+
proxy_user=test_env.get_proxy_user())
1919

2020
if __name__ == "__main__":
21-
conn = cx_Oracle.connect(base.get_admin_connect_string())
21+
conn = cx_Oracle.connect(test_env.get_admin_connect_string())
2222
drop_tests(conn)
2323
print("Done.")

test/SetupTest.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,20 @@
1111

1212
import cx_Oracle
1313

14-
import base
14+
import test_env
1515
import DropTest
1616

1717
# connect as administrative user (usually SYSTEM or ADMIN)
18-
conn = cx_Oracle.connect(base.get_admin_connect_string())
18+
conn = cx_Oracle.connect(test_env.get_admin_connect_string())
1919

2020
# drop existing users and editions, if applicable
2121
DropTest.drop_tests(conn)
2222

2323
# create test schemas
2424
print("Creating test schemas...")
25-
base.run_sql_script(conn, "SetupTest",
26-
main_user=base.get_main_user(),
27-
main_password=base.get_main_password(),
28-
proxy_user=base.get_proxy_user(),
29-
proxy_password=base.get_proxy_password())
25+
test_env.run_sql_script(conn, "SetupTest",
26+
main_user=test_env.get_main_user(),
27+
main_password=test_env.get_main_password(),
28+
proxy_user=test_env.get_proxy_user(),
29+
proxy_password=test_env.get_proxy_password())
3030
print("Done.")

test/test_1000_module.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
1000 - Module for testing top-level module methods
77
"""
88

9-
import base
9+
import test_env
1010

1111
import cx_Oracle as oracledb
1212
import datetime
1313
import time
1414

15-
class TestCase(base.BaseTestCase):
15+
class TestCase(test_env.BaseTestCase):
1616
requires_connection = False
1717

1818
def test_1000_date_from_ticks(self):
@@ -42,4 +42,4 @@ def test_1003_unsupported_functions(self):
4242
100)
4343

4444
if __name__ == "__main__":
45-
base.run_test_cases()
45+
test_env.run_test_cases()

test/test_1100_connection.py

Lines changed: 76 additions & 71 deletions
Large diffs are not rendered by default.

test/test_1200_cursor.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
1200 - Module for testing cursors
1212
"""
1313

14-
import base
14+
import test_env
1515
import cx_Oracle as oracledb
1616
import decimal
1717

18-
class TestCase(base.BaseTestCase):
18+
class TestCase(test_env.BaseTestCase):
1919

2020
def test_1200_create_scrollable_cursor(self):
2121
"1200 - test creating a scrollable cursor"
@@ -594,7 +594,7 @@ def test_1252_string_format(self):
594594
"1252 - test string format of cursor"
595595
format_string = "<cx_Oracle.Cursor on <cx_Oracle.Connection to %s@%s>>"
596596
expected_value = format_string % \
597-
(base.get_main_user(), base.get_connect_string())
597+
(test_env.get_main_user(), test_env.get_connect_string())
598598
self.assertEqual(str(self.cursor), expected_value)
599599

600600
def test_1253_cursor_fetch_raw(self):
@@ -934,4 +934,4 @@ def test_1278_execute_with_incorrect_bind_values(self):
934934
statement, value=var, value2=var, value3=var)
935935

936936
if __name__ == "__main__":
937-
base.run_test_cases()
937+
test_env.run_test_cases()

test/test_1300_cursor_var.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111
1300 - Module for testing cursor variables
1212
"""
1313

14-
import base
14+
import test_env
1515

1616
import cx_Oracle as oracledb
1717
import sys
1818

19-
class TestCase(base.BaseTestCase):
19+
class TestCase(test_env.BaseTestCase):
2020

2121
def test_1300_bind_cursor(self):
2222
"1300 - test binding in a cursor"
@@ -29,7 +29,7 @@ def test_1300_bind_cursor(self):
2929
cursor=cursor)
3030
expected_value = [
3131
('STRINGVALUE', oracledb.DB_TYPE_CHAR, 1,
32-
base.get_charset_ratio(), None, None, 1)
32+
test_env.get_charset_ratio(), None, None, 1)
3333
]
3434
self.assertEqual(cursor.description, expected_value)
3535
self.assertEqual(cursor.fetchall(), [('X',)])
@@ -42,7 +42,7 @@ def test_1301_bind_cursor_in_package(self):
4242
expected_value = [
4343
('INTCOL', oracledb.DB_TYPE_NUMBER, 10, None, 9, 0, 0),
4444
('STRINGCOL', oracledb.DB_TYPE_VARCHAR, 20,
45-
20 * base.get_charset_ratio(), None, None, 0)
45+
20 * test_env.get_charset_ratio(), None, None, 0)
4646
]
4747
self.assertEqual(cursor.description, expected_value)
4848
self.assertEqual(cursor.fetchall(), [(1, 'String 1'), (2, 'String 2')])
@@ -95,4 +95,4 @@ def test_1304_fetch_cursor(self):
9595
self.assertEqual(cursor.fetchall(), [(i + 1,)])
9696

9797
if __name__ == "__main__":
98-
base.run_test_cases()
98+
test_env.run_test_cases()

test/test_1400_datetime_var.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@
1111
1400 - Module for testing date/time variables
1212
"""
1313

14-
import base
14+
import test_env
1515

1616
import cx_Oracle as oracledb
1717
import datetime
1818
import time
1919

20-
class TestCase(base.BaseTestCase):
20+
class TestCase(test_env.BaseTestCase):
2121

2222
def setUp(self):
2323
super().setUp()
@@ -246,4 +246,4 @@ def test_1417_fetchone(self):
246246
self.assertEqual(self.cursor.fetchone(), None)
247247

248248
if __name__ == "__main__":
249-
base.run_test_cases()
249+
test_env.run_test_cases()

test/test_1500_types.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
tests for pickling/unpickling of database types and API types.
99
"""
1010

11-
import base
11+
import test_env
1212

1313
import cx_Oracle as oracledb
1414
import pickle
1515

16-
class TestCase(base.BaseTestCase):
16+
class TestCase(test_env.BaseTestCase):
1717
requires_connection = False
1818

1919
def __test_compare(self, db_type, api_type):
@@ -177,4 +177,4 @@ def test_1528_ROWID(self):
177177
self.__test_pickle(oracledb.ROWID)
178178

179179
if __name__ == "__main__":
180-
base.run_test_cases()
180+
test_env.run_test_cases()

test/test_1600_dml_returning.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
1600 - Module for testing DML returning clauses
77
"""
88

9-
import base
9+
import test_env
1010

1111
import cx_Oracle as oracledb
1212

13-
class TestCase(base.BaseTestCase):
13+
class TestCase(test_env.BaseTestCase):
1414

1515
def test_1600_insert(self):
1616
"1600 - test insert (single row) with DML returning"
@@ -270,4 +270,4 @@ def test_1611_delete_returning_no_rows_after_many_rows(self):
270270
self.assertEqual(int_var.getvalue(), [])
271271

272272
if __name__ == "__main__":
273-
base.run_test_cases()
273+
test_env.run_test_cases()

test/test_1700_error.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111
1700 - Module for testing error objects
1212
"""
1313

14-
import base
14+
import test_env
1515

1616
import cx_Oracle as oracledb
1717
import pickle
1818

19-
class TestCase(base.BaseTestCase):
19+
class TestCase(test_env.BaseTestCase):
2020

2121
def test_1700_parse_error(self):
2222
"1700 - test parse error returns offset correctly"
@@ -47,4 +47,4 @@ def test_1701_pickle_error(self):
4747
self.assertTrue(new_error_obj.isrecoverable == error_obj.isrecoverable)
4848

4949
if __name__ == "__main__":
50-
base.run_test_cases()
50+
test_env.run_test_cases()

0 commit comments

Comments
 (0)