add mock testcase

This commit is contained in:
Hongjiang Zhang
2020-06-02 07:46:36 +08:00
parent b921a6d480
commit b662b14e01
2 changed files with 25 additions and 0 deletions
+7
View File
@@ -57,6 +57,13 @@ class MockTest(unittest.TestCase):
result = cursor.fetchone()
self.assertEquals(result[0], "1899-12-31")
def test_simple_decimal(self):
self.conn.jconn.mockSimpleDecimalResult(12345)
cursor = self.conn.cursor()
cursor.execute("dummy stmt")
result = cursor.fetchone()
self.assertEquals(result[0], 12345)
def test_sql_exception_on_execute(self):
self.conn.jconn.mockExceptionOnExecute("java.sql.SQLException", "expected")
cursor = self.conn.cursor()