-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRowsWithKeyTest.py
28 lines (24 loc) · 1.23 KB
/
RowsWithKeyTest.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
from test.StratumTestCase import StratumTestCase
class RowsWithKeyTest(StratumTestCase):
# ------------------------------------------------------------------------------------------------------------------
def test1(self):
"""
Stored routine with designation type rows_with_key must return multi dimensional array.
"""
rows = self._dl.tst_test_rows_with_key1(100)
self.assertIsInstance(rows, dict)
self.assertEqual(1, len(rows))
self.assertTrue('a' in rows)
self.assertTrue('b' in rows['a'])
self.assertNotEqual(0, len(rows['a']['b']))
self.assertTrue('c1' in rows['a']['b'])
self.assertNotEqual(0, len(rows['a']['b']['c1']))
# ------------------------------------------------------------------------------------------------------------------
def test2(self):
"""
Stored routine with designation type rows_with_key must return empty array when no rows are selected.
"""
rows = self._dl.tst_test_rows_with_key1(0)
self.assertIsInstance(rows, dict)
self.assertEqual(0, len(rows))
# ----------------------------------------------------------------------------------------------------------------------