Skip to content

Commit 3527685

Browse files
author
Luiko Czub
committed
comments for not supported api method setTestMode #14
1 parent f97cccd commit 3527685

File tree

3 files changed

+29
-2
lines changed

3 files changed

+29
-2
lines changed

src/testlink/testlinkapigeneric.py

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,9 +228,24 @@ def reportTCResult(self):
228228
# * @param struct $args
229229
# * @return boolean
230230
# * @access protected
231-
# */
231+
# */ testmode
232232
# public function setTestMode($args)
233233

234+
235+
#FIXME: LC 20140202 makes setTestMode sense in python client?
236+
# xmlrpc calls are isolated transactions.
237+
# the second call works with another TL api instance than the frist one
238+
# so the second call works with default TestMode settings (false), even if
239+
# the first call has active the TestMode.
240+
# So using setTestMode make only sense, if the php api instance is directly
241+
# used
242+
# @decoMakerApiCallWithArgs(['testmode'])
243+
# def setTestMode(self):
244+
# """ turn on/off testMode
245+
# This method is meant primarily for testing and debugging during development
246+
# """
247+
248+
234249
@decoMakerApiCallReplaceTLResponseError()
235250
@decoApiCallAddDevKey
236251
@decoMakerApiCallWithArgs(['testplanid'],
@@ -1000,7 +1015,7 @@ def _checkResponse(self, response, methodNameAPI, argsOptional):
10001015
raise testlinkerrors.TLResponseError(
10011016
methodNameAPI, argsOptional,
10021017
response[0]['message'], response[0]['code'])
1003-
except (TypeError, KeyError), msg:
1018+
except (TypeError, KeyError):
10041019
# if the reponse has not a [{..}] structure, the check
10051020
# 'code' in response[0]
10061021
# raise an error. Following causes are ok

test/utest-online/testlinkapi_online_test.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,13 @@ def test_testLinkVersion(self):
259259
def test_getUserByLogin_unknownKey(self):
260260
with self.assertRaisesRegexp(TLResponseError, '10000.*User Login'):
261261
self.client.getUserByLogin(user='unknownUser')
262+
263+
# def test_setTestMode(self):
264+
# response = self.client.setTestMode(True)
265+
# self.assertTrue(response)
266+
# response = self.client.setTestMode(False)
267+
# self.assertTrue(response)
268+
262269

263270
if __name__ == "__main__":
264271
#import sys;sys.argv = ['', 'Test.testName']

test/utest-online/testlinkapigeneric_online_test.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,11 @@ def test_getUserByID_unknownKey(self):
277277
with self.assertRaisesRegexp(TLResponseError, 'NO_USER_BY_ID_LOGIN.*User with DB ID'):
278278
self.client.getUserByID(4711)
279279

280+
# def test_setTestMode(self):
281+
# response = self.client.setTestMode(True)
282+
# self.assertTrue(response)
283+
# response = self.client.setTestMode(False)
284+
# self.assertTrue(response)
280285

281286

282287
if __name__ == "__main__":

0 commit comments

Comments
 (0)