-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNoneTest.py
49 lines (40 loc) · 2.04 KB
/
NoneTest.py
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
from test.StratumTestCase import StratumTestCase
class NoneTest(StratumTestCase):
# ------------------------------------------------------------------------------------------------------------------
def test_sp1(self):
"""
Stored routine with designation type none must return the number of rows affected.
"""
self._dl.tst_test_none1(0)
ret = self._dl.tst_test_none2()
self.assertEqual(0, ret)
# ------------------------------------------------------------------------------------------------------------------
def test_sp2(self):
"""
Stored routine with designation type none must return the number of rows affected.
"""
self._dl.tst_test_none1(1)
ret = self._dl.tst_test_none2()
self.assertEqual(1, ret)
# ------------------------------------------------------------------------------------------------------------------
def test_sp3(self):
"""
Stored routine with designation type none must return the number of rows affected.
"""
self._dl.tst_test_none1(20)
ret = self._dl.tst_test_none2()
self.assertEqual(20, ret)
# ------------------------------------------------------------------------------------------------------------------
def test1(self):
"""
Stored routine with designation type none must return the number of rows affected.
"""
self._dl.execute_none('drop temporary table if exists TMP_TMP')
self._dl.execute_none('create temporary table TMP_TMP( c bigint )')
ret = self._dl.execute_none('insert into TMP_TMP( c ) values(1)')
self.assertEqual(1, ret, 'insert 1 row')
ret = self._dl.execute_none('insert into TMP_TMP( c ) values(2), (3)')
self.assertEqual(2, ret, 'insert 2 rows')
ret = self._dl.execute_none('delete from TMP_TMP')
self.assertEqual(3, ret, 'delete 3 rows')
# ----------------------------------------------------------------------------------------------------------------------