Home
About
Blog
Products
Forum
Support
Contact
Sunbelt Computer Software
PL/B Language Development and Support
Home
About
Blog
Products
Forum
Support
Contact
python-cx_Oracle/test/test_1500_types.py at master · ConnectionMaster/python-cx_Oracle · GitHub
Skip to content
Navigation Menu
Sign in
Appearance settings
Platform
AI CODE CREATION
GitHub Copilot
Write better code with AI
GitHub Copilot app
Direct agents from issue to merge
MCP Registry
Integrate external tools
DEVELOPER WORKFLOWS
Actions
Automate any workflow
Codespaces
Instant dev environments
Issues
Plan and track work
Code Review
Manage code changes
Code Quality
Enforce quality at merge
APPLICATION SECURITY
GitHub Advanced Security
Find and fix vulnerabilities
Code security
Secure your code as you build
Secret protection
Stop leaks before they start
EXPLORE
Why GitHub
Documentation
Blog
Changelog
Marketplace
View all features
Solutions
BY COMPANY SIZE
Enterprises
Small and medium teams
Startups
Nonprofits
BY USE CASE
App Modernization
DevSecOps
DevOps
CI/CD
View all use cases
BY INDUSTRY
Healthcare
Financial services
Manufacturing
Government
View all industries
View all solutions
Resources
EXPLORE BY TOPIC
AI
Software Development
DevOps
Security
View all topics
EXPLORE BY TYPE
Customer stories
Events & webinars
Ebooks & reports
Business insights
GitHub Skills
SUPPORT & SERVICES
Documentation
Customer support
Community forum
Trust center
Partners
View all resources
Open Source
COMMUNITY
GitHub Sponsors
Fund open source developers
PROGRAMS
Security Lab
Maintainer Community
GitHub Stars
Archive Program
REPOSITORIES
Topics
Trending
Collections
Enterprise
ENTERPRISE SOLUTIONS
Enterprise platform
AI-powered developer platform
AVAILABLE ADD-ONS
GitHub Advanced Security
Enterprise-grade security features
Copilot for Business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
ConnectionMaster
/
python-cx_Oracle
Public
forked from
oracle/python-cx_Oracle
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
1
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Files
Expand file tree
master
Breadcrumbs
python-cx_Oracle
/
test
/
test_1500_types.py
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
180 lines (144 loc) · 7.8 KB
master
Breadcrumbs
python-cx_Oracle
/
test
/
test_1500_types.py
Copy path
Top
File metadata and controls
Code
Blame
180 lines (144 loc) · 7.8 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
#------------------------------------------------------------------------------
# Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
#------------------------------------------------------------------------------
"""
1500 - Module for testing comparisons with database types and API types,
including the synonyms retained for backwards compatibility. This module also
tests for pickling/unpickling of database types and API types.
"""
import
test_env
import
cx_Oracle
as
oracledb
import
pickle
class
TestCase
(
test_env
.
BaseTestCase
):
requires_connection
=
False
def
__test_compare
(
self
,
db_type
,
api_type
):
self
.
assertEqual
(
db_type
,
db_type
)
self
.
assertEqual
(
db_type
,
api_type
)
self
.
assertEqual
(
api_type
,
db_type
)
self
.
assertNotEqual
(
db_type
,
5
)
self
.
assertNotEqual
(
db_type
,
oracledb
.
DB_TYPE_OBJECT
)
def
__test_pickle
(
self
,
typ
):
self
.
assertIs
(
typ
,
pickle
.
loads
(
pickle
.
dumps
(
typ
)))
def
test_1500_DB_TYPE_BFILE
(
self
):
"1500 - test oracledb.DB_TYPE_BFILE comparisons and pickling"
self
.
assertEqual
(
oracledb
.
DB_TYPE_BFILE
,
oracledb
.
BFILE
)
self
.
__test_pickle
(
oracledb
.
DB_TYPE_BFILE
)
def
test_1501_DB_TYPE_BINARY_DOUBLE
(
self
):
"1501 - test oracledb.DB_TYPE_BINARY_DOUBLE comparisons and pickling"
self
.
__test_compare
(
oracledb
.
DB_TYPE_BINARY_DOUBLE
,
oracledb
.
NUMBER
)
self
.
assertEqual
(
oracledb
.
DB_TYPE_BINARY_DOUBLE
,
oracledb
.
NATIVE_FLOAT
)
self
.
__test_pickle
(
oracledb
.
DB_TYPE_BINARY_DOUBLE
)
def
test_1502_DB_TYPE_BINARY_FLOAT
(
self
):
"1502 - test oracledb.DB_TYPE_BINARY_FLOAT comparisons and pickling"
self
.
__test_compare
(
oracledb
.
DB_TYPE_BINARY_FLOAT
,
oracledb
.
NUMBER
)
self
.
__test_pickle
(
oracledb
.
DB_TYPE_BINARY_FLOAT
)
def
test_1503_DB_TYPE_BINARY_INTEGER
(
self
):
"1503 - test oracledb.DB_TYPE_BINARY_INTEGER comparisons and pickling"
self
.
__test_compare
(
oracledb
.
DB_TYPE_BINARY_INTEGER
,
oracledb
.
NUMBER
)
self
.
assertEqual
(
oracledb
.
DB_TYPE_BINARY_INTEGER
,
oracledb
.
NATIVE_INT
)
self
.
__test_pickle
(
oracledb
.
DB_TYPE_BINARY_INTEGER
)
def
test_1504_DB_TYPE_BLOB
(
self
):
"1504 - test oracledb.DB_TYPE_BLOB comparisons and pickling"
self
.
assertEqual
(
oracledb
.
DB_TYPE_BLOB
,
oracledb
.
BLOB
)
self
.
__test_pickle
(
oracledb
.
DB_TYPE_BLOB
)
def
test_1505_DB_TYPE_BOOLEAN
(
self
):
"1505 - test oracledb.DB_TYPE_BOOLEAN comparisons and pickling"
self
.
assertEqual
(
oracledb
.
DB_TYPE_BOOLEAN
,
oracledb
.
BOOLEAN
)
self
.
__test_pickle
(
oracledb
.
DB_TYPE_BOOLEAN
)
def
test_1506_DB_TYPE_CHAR
(
self
):
"1506 - test oracledb.DB_TYPE_CHAR comparisons and pickling"
self
.
__test_compare
(
oracledb
.
DB_TYPE_CHAR
,
oracledb
.
STRING
)
self
.
assertEqual
(
oracledb
.
DB_TYPE_CHAR
,
oracledb
.
FIXED_CHAR
)
self
.
__test_pickle
(
oracledb
.
DB_TYPE_CHAR
)
def
test_1507_DB_TYPE_CLOB
(
self
):
"1507 - test oracledb.DB_TYPE_CLOB comparisons and pickling"
self
.
assertEqual
(
oracledb
.
DB_TYPE_CLOB
,
oracledb
.
CLOB
)
self
.
__test_pickle
(
oracledb
.
DB_TYPE_CLOB
)
def
test_1508_DB_TYPE_CURSOR
(
self
):
"1508 - test oracledb.DB_TYPE_CURSOR comparisons and pickling"
self
.
assertEqual
(
oracledb
.
DB_TYPE_CURSOR
,
oracledb
.
CURSOR
)
self
.
__test_pickle
(
oracledb
.
DB_TYPE_CURSOR
)
def
test_1509_DB_TYPE_DATE
(
self
):
"1509 - test oracledb.DB_TYPE_DATE comparisons and pickling"
self
.
__test_compare
(
oracledb
.
DB_TYPE_DATE
,
oracledb
.
DATETIME
)
self
.
__test_pickle
(
oracledb
.
DB_TYPE_DATE
)
def
test_1510_DB_TYPE_INTERVAL_DS
(
self
):
"1510 - test oracledb.DB_TYPE_INTERVAL_DS comparisons and pickling"
self
.
assertEqual
(
oracledb
.
DB_TYPE_INTERVAL_DS
,
oracledb
.
INTERVAL
)
self
.
__test_pickle
(
oracledb
.
DB_TYPE_INTERVAL_DS
)
def
test_1511_DB_TYPE_LONG
(
self
):
"1511 - test oracledb.DB_TYPE_LONG comparisons and pickling"
self
.
__test_compare
(
oracledb
.
DB_TYPE_LONG
,
oracledb
.
STRING
)
self
.
assertEqual
(
oracledb
.
DB_TYPE_LONG
,
oracledb
.
LONG_STRING
)
self
.
__test_pickle
(
oracledb
.
DB_TYPE_LONG
)
def
test_1512_DB_TYPE_LONG_RAW
(
self
):
"1512 - test oracledb.DB_TYPE_LONG_RAW comparisons and pickling"
self
.
__test_compare
(
oracledb
.
DB_TYPE_LONG_RAW
,
oracledb
.
BINARY
)
self
.
assertEqual
(
oracledb
.
DB_TYPE_LONG_RAW
,
oracledb
.
LONG_BINARY
)
self
.
__test_pickle
(
oracledb
.
DB_TYPE_LONG_RAW
)
def
test_1513_DB_TYPE_NCHAR
(
self
):
"1513 - test oracledb.DB_TYPE_NCHAR comparisons and pickling"
self
.
__test_compare
(
oracledb
.
DB_TYPE_NCHAR
,
oracledb
.
STRING
)
self
.
assertEqual
(
oracledb
.
DB_TYPE_NCHAR
,
oracledb
.
FIXED_NCHAR
)
self
.
__test_pickle
(
oracledb
.
DB_TYPE_NCHAR
)
def
test_1514_DB_TYPE_NCLOB
(
self
):
"1514 - test oracledb.DB_TYPE_NCLOB comparisons and pickling"
self
.
assertEqual
(
oracledb
.
DB_TYPE_NCLOB
,
oracledb
.
NCLOB
)
self
.
__test_pickle
(
oracledb
.
DB_TYPE_NCLOB
)
def
test_1515_DB_TYPE_NUMBER
(
self
):
"1515 - test oracledb.DB_TYPE_NUMBER comparisons and pickling"
self
.
__test_compare
(
oracledb
.
DB_TYPE_NUMBER
,
oracledb
.
NUMBER
)
self
.
__test_pickle
(
oracledb
.
DB_TYPE_NUMBER
)
def
test_1516_DB_TYPE_NVARCHAR
(
self
):
"1516 - test oracledb.DB_TYPE_NVARCHAR comparisons and pickling"
self
.
__test_compare
(
oracledb
.
DB_TYPE_NVARCHAR
,
oracledb
.
STRING
)
self
.
assertEqual
(
oracledb
.
DB_TYPE_NVARCHAR
,
oracledb
.
NCHAR
)
self
.
__test_pickle
(
oracledb
.
DB_TYPE_NVARCHAR
)
def
test_1517_DB_TYPE_OBJECT
(
self
):
"1517 - test oracledb.DB_TYPE_OBJECT comparisons and pickling"
self
.
assertEqual
(
oracledb
.
DB_TYPE_OBJECT
,
oracledb
.
OBJECT
)
self
.
__test_pickle
(
oracledb
.
DB_TYPE_OBJECT
)
def
test_1518_DB_TYPE_RAW
(
self
):
"1518 - test oracledb.DB_TYPE_RAW comparisons and pickling"
self
.
__test_compare
(
oracledb
.
DB_TYPE_RAW
,
oracledb
.
BINARY
)
self
.
__test_pickle
(
oracledb
.
DB_TYPE_RAW
)
def
test_1519_DB_TYPE_ROWID
(
self
):
"1519 - test oracledb.DB_TYPE_ROWID comparisons and pickling"
self
.
__test_compare
(
oracledb
.
DB_TYPE_ROWID
,
oracledb
.
ROWID
)
self
.
__test_pickle
(
oracledb
.
DB_TYPE_ROWID
)
def
test_1520_DB_TYPE_TIMESTAMP
(
self
):
"1520 - test oracledb.DB_TYPE_TIMESTAMP comparisons and pickling"
self
.
__test_compare
(
oracledb
.
DB_TYPE_TIMESTAMP
,
oracledb
.
DATETIME
)
self
.
assertEqual
(
oracledb
.
DB_TYPE_TIMESTAMP
,
oracledb
.
TIMESTAMP
)
self
.
__test_pickle
(
oracledb
.
DB_TYPE_TIMESTAMP
)
def
test_1521_DB_TYPE_TIMESTAMP_LTZ
(
self
):
"1521 - test oracledb.DB_TYPE_TIMESTAMP_LTZ comparisons and pickling"
self
.
__test_compare
(
oracledb
.
DB_TYPE_TIMESTAMP_LTZ
,
oracledb
.
DATETIME
)
self
.
__test_pickle
(
oracledb
.
DB_TYPE_TIMESTAMP_LTZ
)
def
test_1522_DB_TYPE_TIMESTAMP_TZ
(
self
):
"1522 - test oracledb.DB_TYPE_TIMESTAMP_TZ comparisons and pickling"
self
.
__test_compare
(
oracledb
.
DB_TYPE_TIMESTAMP_TZ
,
oracledb
.
DATETIME
)
self
.
__test_pickle
(
oracledb
.
DB_TYPE_TIMESTAMP_TZ
)
def
test_1523_DB_TYPE_VARCHAR
(
self
):
"1523 - test oracledb.DB_TYPE_VARCHAR comparisons and pickling"
self
.
__test_compare
(
oracledb
.
DB_TYPE_VARCHAR
,
oracledb
.
STRING
)
self
.
__test_pickle
(
oracledb
.
DB_TYPE_VARCHAR
)
def
test_1524_NUMBER
(
self
):
"1524 - test oracledb.NUMBER pickling"
self
.
__test_pickle
(
oracledb
.
NUMBER
)
def
test_1525_STRING
(
self
):
"1525 - test oracledb.STRING pickling"
self
.
__test_pickle
(
oracledb
.
STRING
)
def
test_1526_DATETIME
(
self
):
"1526 - test oracledb.DATETIME pickling"
self
.
__test_pickle
(
oracledb
.
DATETIME
)
def
test_1527_BINARY
(
self
):
"1527 - test oracledb.BINARY pickling"
self
.
__test_pickle
(
oracledb
.
BINARY
)
def
test_1528_ROWID
(
self
):
"1528 - test oracledb.ROWID pickling"
self
.
__test_pickle
(
oracledb
.
ROWID
)
if
__name__
==
"__main__"
:
test_env
.
run_test_cases
()
You can’t perform that action at this time.