Skip to content

Commit 62965df

Browse files
author
Luiko Czub
committed
examples testLinkVersion and connectionInfo lczub#16
1 parent add121d commit 62965df

2 files changed

Lines changed: 22 additions & 6 deletions

File tree

example/TestLinkExample.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,13 @@
102102
this_file_dirname=os.path.dirname(NEWATTACHMENT_PY)
103103
NEWATTACHMENT_PNG=os.path.join(this_file_dirname, 'PyGreat.png')
104104

105+
# Servers TestLink Version
106+
myTLVersion = myTestLink.testLinkVersion()
107+
108+
# used connection settings
109+
print myTestLink.connectionInfo()
110+
print ""
111+
105112
# example asking the api client about methods arguments
106113
print myTestLink.whatArgs('createTestCase')
107114

@@ -126,7 +133,7 @@
126133
# -- END CHANGE v0.4.5 --
127134

128135

129-
print "Number of Projects in TestLink: %s " % (myTestLink.countProjects(),)
136+
print "Number of Projects in TestLink: %s " % (myTestLink.countProjects())
130137
print ""
131138
myTestLink.listProjects()
132139
print ""
@@ -144,9 +151,10 @@
144151
# else:
145152
# print "Error creating the project '%s': %s " % (NEWPROJECT,isOk)
146153
# sys.exit(-1)
154+
projInfo = 'Example created with Python API class %s in TL %s' % \
155+
( myApiVersion, myTLVersion )
147156
newProject = myTestLink.createTestProject(NEWPROJECT, NEWPREFIX,
148-
notes='Example created with Python API class %s' % myApiVersion,
149-
active=1, public=1,
157+
notes=projInfo, active=1, public=1,
150158
options={'requirementsEnabled' : 0, 'testPriorityEnabled' : 1,
151159
'automationEnabled' : 1, 'inventoryEnabled' : 0})
152160
print "createTestProject", newProject

example/TestLinkExampleGenericApi.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,13 @@
9191
this_file_dirname=os.path.dirname(NEWATTACHMENT_PY)
9292
NEWATTACHMENT_PNG=os.path.join(this_file_dirname, 'PyGreat.png')
9393

94+
# Servers TestLink Version
95+
myTLVersion = myTestLink.testLinkVersion()
96+
97+
# used connection settings
98+
print myTestLink.connectionInfo()
99+
print ""
100+
94101
# example asking the api client about methods arguments
95102
print myTestLink.whatArgs('createTestCase')
96103

@@ -114,10 +121,11 @@
114121
print "Name: %(name)s ID: %(id)s " % project
115122
print ""
116123

117-
# # Creates the project
124+
# Creates the project
125+
projInfo = 'Example created with Python API class %s in TL %s' % \
126+
( myApiVersion, myTLVersion )
118127
newProject = myTestLink.createTestProject(NEWPROJECT, NEWPREFIX,
119-
notes='Example created with Python API class %s' % myApiVersion,
120-
active=1, public=1,
128+
notes=projInfo, active=1, public=1,
121129
options={'requirementsEnabled' : 1, 'testPriorityEnabled' : 1,
122130
'automationEnabled' : 1, 'inventoryEnabled' : 1})
123131
print "createTestProject", newProject

0 commit comments

Comments
 (0)