-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSingleton0Test.py
31 lines (25 loc) · 1.3 KB
/
Singleton0Test.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
from pystratum_middle.exception.ResultException import ResultException
from test.StratumTestCase import StratumTestCase
class Singleton0Test(StratumTestCase):
# ------------------------------------------------------------------------------------------------------------------
def test1(self):
"""
Stored routine with designation type singleton0 must return null.
"""
ret = self._dl.tst_test_singleton0a(0)
self.assertIsNone(ret)
# ------------------------------------------------------------------------------------------------------------------
def test2(self):
"""
Stored routine with designation type singleton0 must return 1 value.
"""
ret = self._dl.tst_test_singleton0a(1)
self.assertIsInstance(ret, (str, int, float))
# ------------------------------------------------------------------------------------------------------------------
def test3(self):
"""
An exception must be thrown when a stored routine with designation type singleton0 returns more than 1 values.
"""
with self.assertRaises(ResultException):
self._dl.tst_test_singleton0a(2)
# ----------------------------------------------------------------------------------------------------------------------