Skip to content

Commit 603633b

Browse files
author
Greg Turnquist
committed
[SESPRINGPYTHONPY-159] Rolled to version 1.2.1, and added test case for insert_and_return_id.
1 parent b33e52b commit 603633b

File tree

2 files changed

+16
-12
lines changed

2 files changed

+16
-12
lines changed

springpython.properties

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
# Collection of properties involved in managing Spring Python testing and packaging.
22

33
# Don't forget to update docs/sphinx/source/conf.py's version properties.
4-
version=1.2.0
4+
version=1.2.1
55
natural.name=se-springpython-py
66
project.key=EXTPY
77

88
# release, milestone or snapshot. Trunk is always snapshot for CI build
9-
#release.type=snapshot
9+
release.type=snapshot
1010

1111
# This property is only un-commented and set for official tagged releases.
12-
release.type=release
13-
build.stamp=FINAL
12+
#release.type=release
13+
#build.stamp=FINAL
1414

1515
# This property is uncommented for milestone releases.
1616
#release.type=milestone

test/springpythontest/databaseCoreTestCases.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -132,11 +132,7 @@ def testQueryingOracleWithValidlyFormattedArguments(self):
132132
del(sys.modules["cx_Oracle"])
133133

134134
def testInsertingIntoOracleWithInvalidlyFormattedArguments(self):
135-
cursor = self.mock()
136-
conn = self.mock()
137-
138135
sys.modules["cx_Oracle"] = self.mock()
139-
sys.modules["cx_Oracle"].expects(once()).method("connect").will(return_value(conn))
140136

141137
connection_factory = factory.cxoraConnectionFactory(username="foo", password="bar", hostname="localhost", db="mock")
142138
dt = DatabaseTemplate(connection_factory)
@@ -148,11 +144,7 @@ def testInsertingIntoOracleWithInvalidlyFormattedArguments(self):
148144
del(sys.modules["cx_Oracle"])
149145

150146
def testInsertingIntoOracleWithInvalidlyFormattedArgumentsWithUpdateApi(self):
151-
cursor = self.mock()
152-
conn = self.mock()
153-
154147
sys.modules["cx_Oracle"] = self.mock()
155-
sys.modules["cx_Oracle"].expects(once()).method("connect").will(return_value(conn))
156148

157149
connection_factory = factory.cxoraConnectionFactory(username="foo", password="bar", hostname="localhost", db="mock")
158150
dt = DatabaseTemplate(connection_factory)
@@ -163,6 +155,18 @@ def testInsertingIntoOracleWithInvalidlyFormattedArgumentsWithUpdateApi(self):
163155

164156
del(sys.modules["cx_Oracle"])
165157

158+
def testInsertingIntoOracleWithInvalidlyFormattedArgumentsWithInsertApi(self):
159+
sys.modules["cx_Oracle"] = self.mock()
160+
161+
connection_factory = factory.cxoraConnectionFactory(username="foo", password="bar", hostname="localhost", db="mock")
162+
dt = DatabaseTemplate(connection_factory)
163+
164+
self.assertRaises(InvalidArgumentType, dt.insert_and_return_id,
165+
"INSERT INTO T_UNIT (F_UNIT_PK, F_UNIT_ID, F_NAME) VALUES (?, ?, ?)",
166+
(1,1,1))
167+
168+
del(sys.modules["cx_Oracle"])
169+
166170
class DatabaseTemplateMockTestCase(MockTestCase):
167171
"""Testing the DatabaseTemplate utilizes stubbing and mocking, in order to isolate from different
168172
vendor implementations. This reduces the overhead in making changes to core functionality."""

0 commit comments

Comments
 (0)