本文整理汇总了Python中testlink.TestLinkHelper.reportTCResult方法的典型用法代码示例。如果您正苦于以下问题:Python TestLinkHelper.reportTCResult方法的具体用法?Python TestLinkHelper.reportTCResult怎么用?Python TestLinkHelper.reportTCResult使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类testlink.TestLinkHelper
的用法示例。
在下文中一共展示了TestLinkHelper.reportTCResult方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: run_report
# 需要导入模块: from testlink import TestLinkHelper [as 别名]
# 或者: from testlink.TestLinkHelper import reportTCResult [as 别名]
def run_report():
failed_list = []
tls = TestLinkHelper().connect(TestlinkAPIClient) # connect to Testlink
testplan_id_result = tls.getTestPlanByName(test_project, test_plan) # get test plan id
testplan_id = testplan_id_result[0]['id']
testcases = get_testcase()
for i in testcases:
test_result = i[0]
test_notes = i[1]
testcase_name = i[2]
index = i[3]
#
# testcase_id_result = tls.getTestCaseIDByName(testcase_name) # get test case id
# testcase_id = testcase_id_result[0]['id']
# tls.reportTCResult(testcase_id, testplan_id, test_build, test_result, test_notes)
try:
testcase_id_result = tls.getTestCaseIDByName(testcase_name) # get test case id
testcase_id = testcase_id_result[0]['id']
tls.reportTCResult(testcase_id, testplan_id, test_build, test_result, test_notes)
except TestLinkError:
failed_list.append((index, testcase_name))
if len(failed_list) > 0:
log_name = 'logFile_%s.txt' % time.time()
curr_dir = os.path.dirname(os.path.abspath(__file__))
dest_dir = os.path.join(curr_dir, new_dir)
try:
os.makedirs(dest_dir)
except OSError:
pass
log_file = os.path.join(dest_dir, log_name)
with open(log_file, 'w') as f:
for item in failed_list:
f.write(','.join(str(i) for i in item) + '\n')
示例2: TestLinkAPIOnlineTestCase
# 需要导入模块: from testlink import TestLinkHelper [as 别名]
# 或者: from testlink.TestLinkHelper import reportTCResult [as 别名]
#.........这里部分代码省略.........
def test_getTestSuitesForTestPlan_unknownID(self):
with self.assertRaisesRegexp(TLResponseError, '3000.*4711'):
self.client.getTestSuitesForTestPlan(4711)
def test_getTestSuitesForTestSuite_unknownID(self):
with self.assertRaisesRegexp(TLResponseError, '8000.*4711'):
self.client.getTestSuitesForTestSuite(4711)
def test_getTotalsForTestPlan_unknownID(self):
with self.assertRaisesRegexp(TLResponseError, '3000.*4711'):
self.client.getTotalsForTestPlan(4711)
def test_createTestProject_unknownID(self):
with self.assertRaisesRegexp(TLResponseError, '7001.*Empty name'):
self.client.createTestProject('', 'P4711')
def test_createBuild_unknownID(self):
with self.assertRaisesRegexp(TLResponseError, '3000.*4711'):
self.client.createBuild(4711, 'Build 4712', 'note 4713')
def test_createTestPlan_unknownID(self):
with self.assertRaisesRegexp(TLResponseError, '7011.*4712'):
self.client.createTestPlan('plan 4711', 'project 4712')
def test_createTestSuite_unknownID(self):
with self.assertRaisesRegexp(TLResponseError, '7000.*4711'):
self.client.createTestSuite( 4711, 'suite 4712', 'detail 4713')
def test_createTestCase_unknownID(self):
with self.assertRaisesRegexp(TLResponseError, '7000.*4713'):
self.client.createTestCase('case 4711', 4712, 4713,
'Big Bird', 'summary 4714')
def test_reportTCResult_unknownID(self):
with self.assertRaisesRegexp(TLResponseError, '5000.*4711'):
self.client.reportTCResult(4711, 4712, 'build 4713', 'p',
'note 4714')
def test_uploadExecutionAttachment_unknownID(self):
attachemantFile = open(os.path.realpath(__file__), 'r')
with self.assertRaisesRegexp(TLResponseError, '6004.*4712'):
self.client.uploadExecutionAttachment(attachemantFile, 4712,
'title 4713', 'descr. 4714')
def test_getProjectIDByName_unknownID(self):
response = self.client.getProjectIDByName('project 4711')
self.assertEqual(-1, response)
def test_createPlatform_unknownID(self):
with self.assertRaisesRegexp(TLResponseError, '7011.*4711'):
self.client.createPlatform('Project 4711', 'Platform 4712',
notes='note 4713')
def test_addTestCaseToTestPlan_unknownID(self):
with self.assertRaisesRegexp(TLResponseError, '7000.*4711'):
self.client.addTestCaseToTestPlan(4711, 4712, 'N-4713', 1)
def test_updateTestCase_unknownID(self):
with self.assertRaisesRegexp(TLResponseError, '5040.*N-4711'):
self.client.updateTestCase('N-4711', version=1)
def test_createTestCaseSteps_unknownID(self):
steps = [{'actions' : "Step action 6 -b added by updateTestCase" ,
'expected_results' : "Step result 6 - b added",
'step_number' : 6, 'execution_type' : 1}]
with self.assertRaisesRegexp(TLResponseError, '5040.*N-4711'):
示例3: TestLinkAPIOnlineTestCase
# 需要导入模块: from testlink import TestLinkHelper [as 别名]
# 或者: from testlink.TestLinkHelper import reportTCResult [as 别名]
#.........这里部分代码省略.........
self.assertEqual(5000, response[0]['code'])
def test_getTestCaseCustomFieldDesignValue_unknownID(self):
response = self.client.getTestCaseCustomFieldDesignValue(
4712, 1, 4711, 'a_field', 'a_detail')
self.assertIn('4711', response[0]['message'])
self.assertEqual(7000, response[0]['code'])
def test_getTestCaseIDByName_unknownID(self):
response = self.client.getTestCaseIDByName('Big Bird')
self.assertIn('getTestCaseIDByName', response[0]['message'])
self.assertEqual(5030, response[0]['code'])
def test_getTestCasesForTestPlan_unknownID(self):
response = self.client.getTestCasesForTestPlan(4711)
self.assertIn('4711', response[0]['message'])
self.assertEqual(3000, response[0]['code'])
def test_getTestCasesForTestSuite_unknownID(self):
response = self.client.getTestCasesForTestSuite(4711, 2, 'a_detail')
self.assertIn('4711', response[0]['message'])
self.assertEqual(8000, response[0]['code'])
def test_getTestPlanByName_unknownID(self):
response = self.client.getTestPlanByName('project 4711', 'plan 4712')
self.assertIn('4711', response[0]['message'])
self.assertEqual(7011, response[0]['code'])
def test_getTestPlanPlatforms_unknownID(self):
response = self.client.getTestPlanPlatforms(4711)
self.assertIn('4711', response[0]['message'])
self.assertEqual(3000, response[0]['code'])
def test_getTestProjectByName_unknownID(self):
response = self.client.getTestProjectByName('project 4711')
self.assertIn('4711', response[0]['message'])
self.assertEqual(7011, response[0]['code'])
def test_getTestSuiteByID_unknownID(self):
response = self.client.getTestSuiteByID(4711)
self.assertIn('4711', response[0]['message'])
self.assertEqual(8000, response[0]['code'])
def test_getTestSuitesForTestPlan_unknownID(self):
response = self.client.getTestSuitesForTestPlan(4711)
self.assertIn('4711', response[0]['message'])
self.assertEqual(3000, response[0]['code'])
def test_getTestSuitesForTestSuite_unknownID(self):
response = self.client.getTestSuitesForTestSuite(4711)
self.assertIn('4711', response[0]['message'])
self.assertEqual(8000, response[0]['code'])
def test_getTotalsForTestPlan_unknownID(self):
response = self.client.getTotalsForTestPlan(4711)
self.assertIn('4711', response[0]['message'])
self.assertEqual(3000, response[0]['code'])
def test_createTestProject_unknownID(self):
response = self.client.createTestProject('', 'P4711')
self.assertIn('Empty name', response[0]['message'])
self.assertEqual(7001, response[0]['code'])
def test_createBuild_unknownID(self):
response = self.client.createBuild(4711, 'Build 4712', 'note 4713')
self.assertIn('4711', response[0]['message'])
self.assertEqual(3000, response[0]['code'])
def test_createTestPlan_unknownID(self):
response = self.client.createTestPlan('plan 4711', 'project 4712')
self.assertIn('4712', response[0]['message'])
self.assertEqual(7011, response[0]['code'])
def test_createTestSuite_unknownID(self):
response = self.client.createTestSuite( 4711, 'suite 4712', 'detail 4713')
self.assertIn('4711', response[0]['message'])
self.assertEqual(7000, response[0]['code'])
def test_createTestCase_unknownID(self):
response = self.client.createTestCase('case 4711', 4712, 4713,
'Big Bird', 'summary 4714')
self.assertIn('4713', response[0]['message'])
self.assertEqual(7000, response[0]['code'])
def test_reportTCResult_unknownID(self):
response = self.client.reportTCResult(4711, 4712, 'build 4713', 'p',
'note 4714')
# FAILURE in 1.9.3 API message: replacement does not work
# The Test Case ID (testcaseid: %s) provided does not exist!
#self.assertIn('4711', response[0]['message'])
self.assertEqual(5000, response[0]['code'])
# def test_uploadExecutionAttachment_unknownID(self):
# response = self.client.uploadExecutionAttachment('file 4711', 4712,
# 'title 4713', 'descr. 4714')
# self.assertIn('4711', response[0]['message'])
def test_getProjectIDByName_unknownID(self):
response = self.client.getProjectIDByName('project 4711')
self.assertEqual(-1, response)
示例4: TestLinkAPIGenericOnlineTestCase
# 需要导入模块: from testlink import TestLinkHelper [as 别名]
# 或者: from testlink.TestLinkHelper import reportTCResult [as 别名]
#.........这里部分代码省略.........
def test_getTestPlanByName_unknownID(self):
with self.assertRaisesRegex(TLResponseError, '7011.*40000711'):
self.client.getTestPlanByName('project 40000711', 'plan 40000712')
def test_getTestPlanPlatforms_unknownID(self):
with self.assertRaisesRegex(TLResponseError, '3000.*40000711'):
self.client.getTestPlanPlatforms(40000711)
def test_getTestProjectByName_unknownID(self):
with self.assertRaisesRegex(TLResponseError, '7011.*40000711'):
self.client.getTestProjectByName('project 40000711')
def test_getTestSuiteByID_unknownID(self):
with self.assertRaisesRegex(TLResponseError, '8000.*40000711'):
self.client.getTestSuiteByID(40000711)
def test_getTestSuitesForTestPlan_unknownID(self):
with self.assertRaisesRegex(TLResponseError, '3000.*40000711'):
self.client.getTestSuitesForTestPlan(40000711)
def test_getTestSuitesForTestSuite_unknownID(self):
with self.assertRaisesRegex(TLResponseError, '8000.*40000711'):
self.client.getTestSuitesForTestSuite(40000711)
def test_getTotalsForTestPlan_unknownID(self):
with self.assertRaisesRegex(TLResponseError, '3000.*40000711'):
self.client.getTotalsForTestPlan(40000711)
def test_createBuild_unknownID(self):
with self.assertRaisesRegex(TLResponseError, '3000.*40000711'):
self.client.createBuild(40000711, 'Build 40000712', buildnotes='note 40000713')
def test_reportTCResult_unknownID(self):
with self.assertRaisesRegex(TLResponseError, '5000.*40000711'):
self.client.reportTCResult(40000712, 'p', testcaseid=40000711,
buildname='build 40000713', notes='note 40000714' )
def test_uploadExecutionAttachment_unknownID(self):
attachemantFile = open(os.path.realpath(__file__), 'r')
with self.assertRaisesRegex(TLResponseError, '6004.*40000712'):
self.client.uploadExecutionAttachment(attachemantFile, 40000712,
title='title 40000713', description='descr. 40000714')
def test_createPlatform_unknownID(self):
with self.assertRaisesRegex(TLResponseError, '7011.*40000711'):
self.client.createPlatform('Project 40000711', 'Platform 40000712',
notes='note 40000713')
def test_addPlatformToTestPlan_unknownID(self):
with self.assertRaisesRegex(TLResponseError, '3000.*40000711'):
self.client.addPlatformToTestPlan(40000711, 'Platform 40000712')
def test_removePlatformFromTestPlan_unknownID(self):
with self.assertRaisesRegex(TLResponseError, '3000.*40000711'):
self.client.removePlatformFromTestPlan(40000711, 'Platform 40000712')
def test_addTestCaseToTestPlan_unknownID(self):
with self.assertRaisesRegex(TLResponseError, '7000.*40000711'):
self.client.addTestCaseToTestPlan(40000711, 40000712, 'N-40000713', 1)
def test_updateTestCase_unknownID(self):
with self.assertRaisesRegex(TLResponseError, '5040.*N-40000711'):
self.client.updateTestCase('N-40000711', version=1)
def test_createTestCaseSteps_unknownID(self):
示例5: TestLinkAPIGenericOfflineTestCase
# 需要导入模块: from testlink import TestLinkHelper [as 别名]
# 或者: from testlink.TestLinkHelper import reportTCResult [as 别名]
class TestLinkAPIGenericOfflineTestCase(unittest.TestCase):
""" TestCases for TestlinkAPIGeneric - does not interacts with a TestLink Server.
works with DummyAPIGeneric which returns special test data
"""
def setUp(self):
self.api = TestLinkHelper().connect(DummyAPIGeneric)
self.callArgs = None
# def tearDown(self):
# pass
def test_convertPositionalArgs(self):
response = self.api._convertPostionalArgs('DummyMethod', [1,2,3])
self.assertEqual({'Uno' : 1, 'due' :2, 'tre' : 3}, response)
def test__convertPositionalArgs_missingConf(self):
client = self.api
def a_func(a_api): a_api._convertPostionalArgs('NoConfigMethod', [1,2])
self.assertRaises(TLArgError, a_func, client)
def test__convertPositionalArgs_lessValues(self):
client = self.api
def a_func(a_api): a_api._convertPostionalArgs('DummyMethod', [1,2])
self.assertRaises(TLArgError, a_func, client)
def test__convertPositionalArgs_moreValues(self):
client = self.api
def a_func(a_api): a_api._convertPostionalArgs('DummyMethod', [1,2,3,4])
self.assertRaises(TLArgError, a_func, client)
def test_callServerWithPosArgs_pos(self):
self.api.callServerWithPosArgs('DummyMethod', 1,2,3)
self.assertEqual({'Uno' : 1, 'due' :2, 'tre' : 3}, self.api.callArgs)
def test_callServerWithPosArgs_pos_opt(self):
self.api.callServerWithPosArgs('DummyMethod', 1,2,3, quad=4)
self.assertEqual({'Uno' : 1, 'due' :2, 'tre' : 3, 'quad' : 4}, self.api.callArgs)
def test_callServerWithPosArgs_opt(self):
self.api.callServerWithPosArgs('DummyMethod', quad=4)
self.assertEqual({'quad' : 4}, self.api.callArgs)
def test_callServerWithPosArgs_none(self):
self.api.callServerWithPosArgs('DummyMethod')
self.assertEqual({}, self.api.callArgs)
def test_checkResponse_emptyResponse(self):
client = self.api
def a_func(a_api, response):
a_api._checkResponse(response, 'DummyMethod',
{'Uno' : 1, 'due' :2, 'tre' : 3})
self.assertRaises(TLResponseError, a_func, client, '')
self.assertRaises(TLResponseError, a_func, client, [])
def test_checkResponse_errorResponse(self):
client = self.api
responseA = [{'message': '(reportTCResult) - TC ID 709 does not exist!',
'code': 5000}]
def a_func(a_api, response):
a_api._checkResponse(response, 'DummyMethod',
{'Uno' : 1, 'due' :2, 'tre' : 3})
self.assertRaises(TLResponseError, a_func, client, responseA)
def test_checkResponse_okResponse(self):
self.api._checkResponse(
[{'message': 'all fine, cause no key with name code'}],
'DummyMethod', {'Uno' : 1, 'due' :2, 'tre' : 3})
self.api._checkResponse(
'some API Call juts returns one string without codes',
'DummyMethod', {'Uno' : 1, 'due' :2, 'tre' : 3})
def test_checkResponse_booleanResponse(self):
response = True
self.api._checkResponse(response, 'DummyMethod',
{'Uno' : 1, 'due' :2, 'tre' : 3})
def test_checkResponse_dictionaryResponse(self):
response = {'note' : 'uploadAttachment Calls return {..} and not [{..}]'}
self.api._checkResponse(response, 'DummyMethod',
{'Uno' : 1, 'due' :2, 'tre' : 3})
def test_checkResponse_errorResponse_sringCode(self):
client = self.api
responseA = [{'message': '(getUserByID) - Cannot Find User with DB ID (4711).',
'code': 'NO_USER_BY_ID_LOGIN'}]
def a_func(a_api, response):
a_api._checkResponse(response, 'getUserByID',
{'userid' : 4711})
self.assertRaises(TLResponseError, a_func, client, responseA)
def test__apiMethodArgNames_noArgs(self):
response = self.api._apiMethodArgNames('sayHello')
self.assertEqual(response, ([], [], []))
def test_whatArgs_noArgs(self):
response = self.api.whatArgs('sayHello')
self.assertRegex(response, 'sayHello().*')
#.........这里部分代码省略.........
示例6: TestLinkAPIOfflineTestCase
# 需要导入模块: from testlink import TestLinkHelper [as 别名]
# 或者: from testlink.TestLinkHelper import reportTCResult [as 别名]
#.........这里部分代码省略.........
self.assertEqual('21', self.api.callArgs['testprojectid'])
def test_copyTCnewVersion_version(self):
self.api.loadScenario(SCENARIO_A)
self.api.copyTCnewVersion('26', 1, summary = 'The summary has changed',
importance = '33')
self.assertEqual('create_new_version',
self.api.callArgs['actiononduplicatedname'])
self.assertEqual('V1', self.api.callArgs['preconditions'])
self.assertEqual('The summary has changed', self.api.callArgs['summary'])
self.assertEqual('33', self.api.callArgs['importance'])
self.assertEqual('TC-C', self.api.callArgs['testcasename'])
self.assertEqual('25', self.api.callArgs['testsuiteid'])
self.assertEqual('21', self.api.callArgs['testprojectid'])
def test_copyTCnewTestCase(self):
self.api.loadScenario(SCENARIO_A)
self.api.copyTCnewTestCase('26', testsuiteid = '4711')
self.assertEqual('generate_new',
self.api.callArgs['actiononduplicatedname'])
self.assertEqual('V2 None', self.api.callArgs['preconditions'])
self.assertEqual('4711', self.api.callArgs['testsuiteid'])
self.assertEqual('2211', self.api.callArgs['testprojectid'])
def test_copyTCnewTestCase_version(self):
self.api.loadScenario(SCENARIO_A)
self.api.copyTCnewTestCase('26', 1, testsuiteid = '4711')
self.assertEqual('generate_new',
self.api.callArgs['actiononduplicatedname'])
self.assertEqual('V1', self.api.callArgs['preconditions'])
self.assertEqual('4711', self.api.callArgs['testsuiteid'])
self.assertEqual('2211', self.api.callArgs['testprojectid'])
def test_reportTCResult_user(self):
self.api.loadScenario(SCENARIO_A)
response = self.api.reportTCResult(4711, 4712, 'build 4713', 'p',
'note 4714', user='a login name')
self.assertEqual('reportTCResult', response[0]['operation'])
self.assertEqual(self.api.devKey, self.api.callArgs['devKey'])
self.assertEqual('a login name', self.api.callArgs['user'])
def test_whatArgs_reportTCResult(self):
argsDescription = self.api.whatArgs('reportTCResult')
self.assertIn('user=<user>', argsDescription)
def test_getTestCasesForTestSuite_keyWords(self):
self.api.loadScenario(SCENARIO_KEYWORDS)
response = self.api.getTestCasesForTestSuite('deepFalse3', False,
'full', getkeywords=True)
self.assertIn('keywords', response[0])
self.assertNotIn('keywords', response[2])
self.assertEqual(self.api.devKey, self.api.callArgs['devKey'])
def test_whatArgs_getTestCasesForTestSuite(self):
argsDescription = self.api.whatArgs('getTestCasesForTestSuite')
self.assertIn('getkeywords=<getkeywords>', argsDescription)
def test_listKeywordsForTC_FullExternalId(self):
self.api.loadScenario(SCENARIO_KEYWORDS)
response = self.api.listKeywordsForTC('NPROAPI-2')
self.assertEqual(['KeyWord01', 'KeyWord03'], response)
def test_listKeywordsForTC_InternalId_Int(self):
self.api.loadScenario(SCENARIO_KEYWORDS)
response = self.api.listKeywordsForTC(8144)
self.assertEqual(['KeyWord01', 'KeyWord03'], response)
示例7: TestLinkAPIOnlineTestCase
# 需要导入模块: from testlink import TestLinkHelper [as 别名]
# 或者: from testlink.TestLinkHelper import reportTCResult [as 别名]
#.........这里部分代码省略.........
def test_getTestSuitesForTestPlan_unknownID(self):
with self.assertRaisesRegex(TLResponseError, "3000.*40000711"):
self.client.getTestSuitesForTestPlan(40000711)
def test_getTestSuitesForTestSuite_unknownID(self):
with self.assertRaisesRegex(TLResponseError, "8000.*40000711"):
self.client.getTestSuitesForTestSuite(40000711)
def test_getTotalsForTestPlan_unknownID(self):
with self.assertRaisesRegex(TLResponseError, "3000.*40000711"):
self.client.getTotalsForTestPlan(40000711)
def test_createTestProject_unknownID(self):
with self.assertRaisesRegex(TLResponseError, "7001.*Empty name"):
self.client.createTestProject("", "P40000711")
def test_createBuild_unknownID(self):
with self.assertRaisesRegex(TLResponseError, "3000.*40000711"):
self.client.createBuild(40000711, "Build 40000712", "note 40000713")
def test_createTestPlan_projectname_posArg_unknownID(self):
with self.assertRaisesRegex(TLResponseError, "7011.*40000712"):
self.client.createTestPlan("plan 40000711", "project 40000712")
def test_createTestSuite_unknownID(self):
with self.assertRaisesRegex(TLResponseError, "7000.*40000711"):
self.client.createTestSuite(40000711, "suite 40000712", "detail 40000713")
def test_createTestCase_unknownID(self):
with self.assertRaisesRegex(TLResponseError, "7000.*40000713"):
self.client.createTestCase("case 40000711", 40000712, 40000713, "Big Bird", "summary 40000714")
def test_reportTCResult_unknownID(self):
with self.assertRaisesRegex(TLResponseError, "5000.*40000711"):
self.client.reportTCResult(40000711, 40000712, "build 40000713", "p", "note 40000714")
def test_uploadExecutionAttachment_unknownID(self):
attachemantFile = open(os.path.realpath(__file__), "r")
with self.assertRaisesRegex(TLResponseError, "6004.*40000712"):
self.client.uploadExecutionAttachment(attachemantFile, 40000712, "title 40000713", "descr. 40000714")
def test_getProjectIDByName_unknownID(self):
response = self.client.getProjectIDByName("project 40000711")
self.assertEqual(-1, response)
def test_createPlatform_unknownID(self):
with self.assertRaisesRegex(TLResponseError, "7011.*40000711"):
self.client.createPlatform("Project 40000711", "Platform 40000712", notes="note 40000713")
def test_addTestCaseToTestPlan_unknownID(self):
with self.assertRaisesRegex(TLResponseError, "7000.*40000711"):
self.client.addTestCaseToTestPlan(40000711, 40000712, "N-40000713", 1)
def test_updateTestCase_unknownID(self):
with self.assertRaisesRegex(TLResponseError, "5040.*N-40000711"):
self.client.updateTestCase("N-40000711", version=1)
def test_createTestCaseSteps_unknownID(self):
steps = [
{
"actions": "Step action 6 -b added by updateTestCase",
"expected_results": "Step result 6 - b added",
"step_number": 6,
"execution_type": 1,
}
示例8: TestLinkAPIOnlineTestCase
# 需要导入模块: from testlink import TestLinkHelper [as 别名]
# 或者: from testlink.TestLinkHelper import reportTCResult [as 别名]
#.........这里部分代码省略.........
tc_steps = []
with self.assertRaisesRegexp(TLResponseError, '7000.*4713'):
self.client.createTestCase('case 4711', 4712, 4713,
'Big Bird', 'summary 4714', tc_steps)
def test_getBuildsForTestPlan_unknownID(self):
with self.assertRaisesRegexp(TLResponseError, '3000.*4711'):
self.client.getBuildsForTestPlan(4711)
def test_getFirstLevelTestSuitesForTestProject_unknownID(self):
with self.assertRaisesRegexp(TLResponseError, '7000.*4711'):
self.client.getFirstLevelTestSuitesForTestProject(4711)
def test_getFullPath_unknownID(self):
with self.assertRaisesRegexp(TLResponseError, 'getFullPath.*234'):
self.client.getFullPath('4711')
def test_getLastExecutionResult_unknownID(self):
with self.assertRaisesRegexp(TLResponseError, '3000.*4711'):
self.client.getLastExecutionResult(4711, testcaseid=4712)
def test_getLatestBuildForTestPlan_unknownID(self):
with self.assertRaisesRegexp(TLResponseError, '3000.*4711'):
self.client.getLatestBuildForTestPlan(4711)
def test_getProjectTestPlans_unknownID(self):
with self.assertRaisesRegexp(TLResponseError, '7000.*4711'):
self.client.getProjectTestPlans(4711)
def test_getTestCase_unknownID(self):
with self.assertRaisesRegexp(TLResponseError, '5000.*4711'):
self.client.getTestCase(testcaseid=4711)
def test_getTestCase_unknownExternalID(self):
with self.assertRaisesRegexp(TLResponseError, '5040.*GPROAPI-4711'):
self.client.getTestCase(testcaseexternalid='GPROAPI-4711')
def test_getTestCaseAttachments_unknownID(self):
with self.assertRaisesRegexp(TLResponseError, '5000.*4711'):
self.client.getTestCaseAttachments(testcaseid=4711)
def test_getTestCaseCustomFieldDesignValue_unknownID(self):
with self.assertRaisesRegexp(TLResponseError, '7000.*4711'):
self.client.getTestCaseCustomFieldDesignValue(
'TC-4712', 1, 4711, 'a_field', details='a_detail')
def test_getTestCaseIDByName_unknownID(self):
with self.assertRaisesRegexp(TLResponseError, '5030.*Cannot find'):
self.client.getTestCaseIDByName('Big Bird')
def test_getTestCasesForTestPlan_unknownID(self):
with self.assertRaisesRegexp(TLResponseError, '3000.*4711'):
self.client.getTestCasesForTestPlan(4711)
def test_getTestCasesForTestSuite_unknownID(self):
with self.assertRaisesRegexp(TLResponseError, '8000.*4711'):
self.client.getTestCasesForTestSuite(4711)
def test_getTestPlanByName_unknownID(self):
with self.assertRaisesRegexp(TLResponseError, '7011.*4711'):
self.client.getTestPlanByName('project 4711', 'plan 4712')
def test_getTestPlanPlatforms_unknownID(self):
with self.assertRaisesRegexp(TLResponseError, '3000.*4711'):
self.client.getTestPlanPlatforms(4711)
def test_getTestProjectByName_unknownID(self):
with self.assertRaisesRegexp(TLResponseError, '7011.*4711'):
self.client.getTestProjectByName('project 4711')
def test_getTestSuiteByID_unknownID(self):
with self.assertRaisesRegexp(TLResponseError, '8000.*4711'):
self.client.getTestSuiteByID(4711)
def test_getTestSuitesForTestPlan_unknownID(self):
with self.assertRaisesRegexp(TLResponseError, '3000.*4711'):
self.client.getTestSuitesForTestPlan(4711)
def test_getTestSuitesForTestSuite_unknownID(self):
with self.assertRaisesRegexp(TLResponseError, '8000.*4711'):
self.client.getTestSuitesForTestSuite(4711)
def test_getTotalsForTestPlan_unknownID(self):
with self.assertRaisesRegexp(TLResponseError, '3000.*4711'):
self.client.getTotalsForTestPlan(4711)
def test_createBuild_unknownID(self):
with self.assertRaisesRegexp(TLResponseError, '3000.*4711'):
self.client.createBuild(4711, 'Build 4712', buildnotes='note 4713')
def test_reportTCResult_unknownID(self):
with self.assertRaisesRegexp(TLResponseError, '5000.*4711'):
self.client.reportTCResult(4712, 'p', testcaseid=4711,
buildname='build 4713', notes='note 4714' )
def test_uploadExecutionAttachment_unknownID(self):
attachemantFile = open(os.path.realpath(__file__), 'r')
with self.assertRaisesRegexp(TLResponseError, '6004.*4712'):
self.client.uploadExecutionAttachment(attachemantFile, 4712,
title='title 4713', description='descr. 4714')