Add test for scaled decimal
This commit is contained in:
+9
-2
@@ -57,13 +57,20 @@ class MockTest(unittest.TestCase):
|
||||
result = cursor.fetchone()
|
||||
self.assertEquals(result[0], "1899-12-31")
|
||||
|
||||
def test_simple_decimal(self):
|
||||
self.conn.jconn.mockSimpleDecimalResult(12345)
|
||||
def test_decimal_scale_zero(self):
|
||||
self.conn.jconn.mockBigDecimalResult(12345, 0)
|
||||
cursor = self.conn.cursor()
|
||||
cursor.execute("dummy stmt")
|
||||
result = cursor.fetchone()
|
||||
self.assertEquals(str(result[0]), "12345")
|
||||
|
||||
def test_decimal_places(self):
|
||||
self.conn.jconn.mockBigDecimalResult(12345, 2)
|
||||
cursor = self.conn.cursor()
|
||||
cursor.execute("dummy stmt")
|
||||
result = cursor.fetchone()
|
||||
self.assertEquals(str(result[0]), "123.45")
|
||||
|
||||
def test_sql_exception_on_execute(self):
|
||||
self.conn.jconn.mockExceptionOnExecute("java.sql.SQLException", "expected")
|
||||
cursor = self.conn.cursor()
|
||||
|
||||
Reference in New Issue
Block a user