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

Diff for: test/DropTest.py

+5-5
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.")

Diff for: test/SetupTest.py

+7-7
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.")

Diff for: test/test_1000_module.py

+3-3
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()

Diff for: test/test_1100_connection.py

+76-71
Large diffs are not rendered by default.

Diff for: test/test_1200_cursor.py

+4-4
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()

Diff for: test/test_1300_cursor_var.py

+5-5
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()

Diff for: test/test_1400_datetime_var.py

+3-3
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()

Diff for: test/test_1500_types.py

+3-3
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()

Diff for: test/test_1600_dml_returning.py

+3-3
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()

Diff for: test/test_1700_error.py

+3-3
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()

Diff for: test/test_1800_interval_var.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111
1800 - Module for testing interval variables
1212
"""
1313

14-
import base
14+
import test_env
1515

1616
import cx_Oracle as oracledb
1717
import datetime
1818

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

2121
def setUp(self):
2222
super().setUp()
@@ -152,4 +152,4 @@ def test_1810_fetchone(self):
152152
self.assertEqual(self.cursor.fetchone(), None)
153153

154154
if __name__ == "__main__":
155-
base.run_test_cases()
155+
test_env.run_test_cases()

Diff for: test/test_1900_lob_var.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
1900 - Module for testing LOB (CLOB and BLOB) variables
1212
"""
1313

14-
import base
14+
import test_env
1515

1616
import cx_Oracle as oracledb
1717

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

2020
def __get_temp_lobs(self, sid):
2121
cursor = self.connection.cursor()
@@ -234,9 +234,9 @@ def test_1914_nclob_direct(self):
234234

235235
def test_1915_nclob_different_encodings(self):
236236
"1915 - test binding and fetching NCLOB data (different encodings)"
237-
connection = oracledb.connect(base.get_main_user(),
238-
base.get_main_password(),
239-
base.get_connect_string(),
237+
connection = oracledb.connect(test_env.get_main_user(),
238+
test_env.get_main_password(),
239+
test_env.get_connect_string(),
240240
encoding="UTF-8", nencoding="UTF-16")
241241
value = "\u03b4\u4e2a"
242242
cursor = connection.cursor()
@@ -286,4 +286,4 @@ def test_1919_AssignStringBeyondArraySize(self):
286286
self.assertRaises(IndexError, nclobVar.setvalue, 1, "test char")
287287

288288
if __name__ == "__main__":
289-
base.run_test_cases()
289+
test_env.run_test_cases()

Diff for: test/test_2000_long_var.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
2000 - Module for testing long and long raw variables
1212
"""
1313

14-
import base
14+
import test_env
1515

1616
import cx_Oracle as oracledb
1717

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

2020
def __perform_test(self, typ):
2121
name_part = "Long" if typ is oracledb.DB_TYPE_LONG else "LongRaw"
@@ -102,4 +102,4 @@ def test_2005_array_size_too_large(self):
102102
"select * from TestLongRaws")
103103

104104
if __name__ == "__main__":
105-
base.run_test_cases()
105+
test_env.run_test_cases()

Diff for: test/test_2100_nchar_var.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
2100 - Module for testing NCHAR variables
1212
"""
1313

14-
import base
14+
import test_env
1515

1616
import cx_Oracle as oracledb
1717

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

2020
def setUp(self):
2121
super().setUp()
@@ -237,4 +237,4 @@ def test_2117_fetchone(self):
237237
self.assertEqual(self.cursor.fetchone(), None)
238238

239239
if __name__ == "__main__":
240-
base.run_test_cases()
240+
test_env.run_test_cases()

Diff for: test/test_2200_number_var.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@
1111
2200 - Module for testing number variables
1212
"""
1313

14-
import base
14+
import test_env
1515

1616
import cx_Oracle as oracledb
1717
import decimal
1818
import sys
1919

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

2222
def output_type_handler_binary_int(self, cursor, name, default_type, size,
2323
precision, scale):
@@ -407,4 +407,4 @@ def test_2232_fetch_binary_int(self):
407407
self.assertEqual(value, fetched_value)
408408

409409
if __name__ == "__main__":
410-
base.run_test_cases()
410+
test_env.run_test_cases()

Diff for: test/test_2300_object_var.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@
1111
2300 - Module for testing object variables
1212
"""
1313

14-
import base
14+
import test_env
1515

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

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

2222
def __get_object_as_tuple(self, obj):
2323
if obj.type.iscollection:
@@ -435,7 +435,7 @@ def test_2313_setting_var_wrong_object_type(self):
435435
def test_2314_string_format(self):
436436
"2314 - test object string format"
437437
obj_type = self.connection.gettype("UDT_OBJECT")
438-
user = base.get_main_user()
438+
user = test_env.get_main_user()
439439
self.assertEqual(str(obj_type),
440440
"<cx_Oracle.ObjectType %s.UDT_OBJECT>" % user.upper())
441441
self.assertEqual(str(obj_type.attributes[0]),
@@ -463,4 +463,4 @@ def test_2315_trim_collection_list(self):
463463
self.assertEqual(self.__get_object_as_tuple(array_obj), [])
464464

465465
if __name__ == "__main__":
466-
base.run_test_cases()
466+
test_env.run_test_cases()

0 commit comments

Comments
 (0)