-
Notifications
You must be signed in to change notification settings - Fork 196
/
Copy pathtest_116_ConnActive.py
93 lines (85 loc) · 1.79 KB
/
test_116_ConnActive.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#
# Licensed Materials - Property of IBM
#
# (c) Copyright IBM Corp. 2007-2008
#
from __future__ import print_function
import sys
import unittest
import ibm_db
import config
import platform
from testfunctions import IbmDbTestFunctions
class IbmDbTestCase(unittest.TestCase):
@unittest.skipIf(platform.system() == 'z/OS',"Test fails with z/OS ODBC driver")
def test_116_ConnActive(self):
obj = IbmDbTestFunctions()
obj.assert_expect(self.run_test_116)
def run_test_116(self):
conn = None
is_alive = ibm_db.active(conn)
if is_alive:
print("Is active")
else:
print("Is not active")
conn = ibm_db.connect(config.database, config.user, config.password)
is_alive = ibm_db.active(conn)
if is_alive:
print("Is active")
else:
print("Is not active")
ibm_db.close(conn)
is_alive = ibm_db.active(conn)
if is_alive:
print("Is active")
else:
print("Is not active")
# Executing active method multiple times to reproduce a customer reported defect
print(ibm_db.active(conn))
print(ibm_db.active(conn))
print(ibm_db.active(conn))
conn = ibm_db.connect(config.database, config.user, config.password)
print(ibm_db.active(conn))
print(ibm_db.active(conn))
print(ibm_db.active(conn))
#__END__
#__LUW_EXPECTED__
#Is not active
#Is active
#Is not active
#False
#False
#False
#True
#True
#True
#__ZOS_EXPECTED__
#Is not active
#Is active
#Is not active
#False
#False
#False
#True
#True
#True
#__SYSTEMI_EXPECTED__
#Is not active
#Is active
#Is not active
#False
#False
#False
#True
#True
#True
#__IDS_EXPECTED__
#Is not active
#Is active
#Is not active
#False
#False
#False
#True
#True
#True