本文整理汇总了Python中testlink.TestLinkHelper.getProjectPlatforms方法的典型用法代码示例。如果您正苦于以下问题:Python TestLinkHelper.getProjectPlatforms方法的具体用法?Python TestLinkHelper.getProjectPlatforms怎么用?Python TestLinkHelper.getProjectPlatforms使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类testlink.TestLinkHelper
的用法示例。
在下文中一共展示了TestLinkHelper.getProjectPlatforms方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: TestLinkAPIOnlineTestCase
# 需要导入模块: from testlink import TestLinkHelper [as 别名]
# 或者: from testlink.TestLinkHelper import getProjectPlatforms [as 别名]
class TestLinkAPIOnlineTestCase(unittest.TestCase):
""" TestCases for TestlinkAPIClient - interacts with a TestLink Server.
works with the example project NEW_PROJECT_API (see TestLinkExample.py)
"""
def setUp(self):
self.client = TestLinkHelper().connect(TestlinkAPIClient)
# def tearDown(self):
# pass
def test_checkDevKey(self):
response = self.client.checkDevKey()
self.assertEqual(True, response)
def test_about(self):
response = self.client.about()
self.assertIn('Testlink API', response)
def test_ping(self):
response = self.client.ping()
self.assertEqual('Hello!', response)
def test_echo(self):
response = self.client.echo('Yellow Submarine')
self.assertEqual('You said: Yellow Submarine', response)
def test_doesUserExist_unknownID(self):
with self.assertRaisesRegexp(TLResponseError, '10000.*Big Bird'):
self.client.doesUserExist('Big Bird')
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, 4712)
def test_getLatestBuildForTestPlan_unknownID(self):
with self.assertRaisesRegexp(TLResponseError, '3000.*4711'):
self.client.getLatestBuildForTestPlan(4711)
def test_getProjects(self):
response = self.client.getProjects()
self.assertIsNotNone(response)
def test_getProjectTestPlans_unknownID(self):
with self.assertRaisesRegexp(TLResponseError, '7000.*4711'):
self.client.getProjectTestPlans(4711)
def test_getProjectPlatforms_unknownID(self):
with self.assertRaisesRegexp(TLResponseError, '7000.*4711'):
self.client.getProjectPlatforms(4711)
def test_getTestCase_unknownID(self):
with self.assertRaisesRegexp(TLResponseError, '5000.*4711'):
self.client.getTestCase(4711)
def test_getTestCase_unknownExternalID(self):
with self.assertRaisesRegexp(TLResponseError, '5040.*N-2'):
self.client.getTestCase(testcaseexternalid='N-2')
def test_getTestCaseAttachments_unknownID(self):
with self.assertRaisesRegexp(TLResponseError, '5000.*4711'):
self.client.getTestCaseAttachments(4711)
def test_getTestCaseCustomFieldDesignValue_unknownID(self):
with self.assertRaisesRegexp(TLResponseError, '7000.*4711'):
self.client.getTestCaseCustomFieldDesignValue(
'TC-4712', 1, 4711, 'a_field', '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, 2, 'a_detail')
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'):
#.........这里部分代码省略.........
示例2: TestLinkAPIGenericOnlineTestCase
# 需要导入模块: from testlink import TestLinkHelper [as 别名]
# 或者: from testlink.TestLinkHelper import getProjectPlatforms [as 别名]
class TestLinkAPIGenericOnlineTestCase(unittest.TestCase):
""" TestCases for TestlinkAPIClient - interacts with a TestLink Server.
works with the example project NEW_PROJECT_API (see TestLinkExample.py)
"""
def setUp(self):
self.client = TestLinkHelper().connect(TestlinkAPIGeneric)
# def tearDown(self):
# pass
def test_checkDevKey(self):
response = self.client.checkDevKey()
self.assertEqual(True, response)
def test_checkDevKey_unknownKey(self):
with self.assertRaisesRegex(TLResponseError, '2000.*invalid'):
self.client.checkDevKey(devKey='unknownKey')
def test_sayHello(self):
response = self.client.sayHello()
self.assertEqual('Hello!', response)
def test_repeat(self):
response = self.client.repeat('Yellow Submarine')
self.assertEqual('You said: Yellow Submarine', response)
def test_about(self):
response = self.client.about()
self.assertIn('Testlink API', response)
def test_doesUserExist_unknownID(self):
with self.assertRaisesRegex(TLResponseError, '10000.*Big Bird'):
self.client.doesUserExist('Big Bird')
def test_createTestProject_unknownID(self):
with self.assertRaisesRegex(TLResponseError, '7001.*Empty name'):
self.client.createTestProject(testprojectname='',
testcaseprefix='P40000711')
def test_createTestProject_unknownITS(self):
with self.assertRaisesRegex(TLResponseError, '13000.*Unable to find'):
self.client.createTestProject(testprojectname='aProject',
testcaseprefix='aPrefix', itsname='unknownITS')
def test_getProjects(self):
response = self.client.getProjects()
self.assertIsNotNone(response)
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):
tc_steps = []
with self.assertRaisesRegex(TLResponseError, '7000.*40000713'):
self.client.createTestCase('case 40000711', 40000712, 40000713,
'Big Bird', 'summary 40000714', tc_steps)
def test_getBuildsForTestPlan_unknownID(self):
with self.assertRaisesRegex(TLResponseError, '3000.*40000711'):
self.client.getBuildsForTestPlan(40000711)
def test_getFirstLevelTestSuitesForTestProject_unknownID(self):
with self.assertRaisesRegex(TLResponseError, '7000.*40000711'):
self.client.getFirstLevelTestSuitesForTestProject(40000711)
def test_getFullPath_unknownID(self):
with self.assertRaisesRegex(TLResponseError, 'getFullPath.*234'):
self.client.getFullPath('40000711')
def test_getLastExecutionResult_unknownID(self):
with self.assertRaisesRegex(TLResponseError, '3000.*40000711'):
self.client.getLastExecutionResult(40000711, testcaseid=40000712)
def test_getLatestBuildForTestPlan_unknownID(self):
with self.assertRaisesRegex(TLResponseError, '3000.*40000711'):
self.client.getLatestBuildForTestPlan(40000711)
def test_getProjectTestPlans_unknownID(self):
with self.assertRaisesRegex(TLResponseError, '7000.*40000711'):
self.client.getProjectTestPlans(40000711)
def test_getProjectPlatforms_unknownID(self):
with self.assertRaisesRegex(TLResponseError, '7000.*40000711'):
self.client.getProjectPlatforms(40000711)
def test_getTestCase_unknownID(self):
with self.assertRaisesRegex(TLResponseError, '5000.*40000711'):
self.client.getTestCase(testcaseid=40000711)
def test_getTestCase_unknownExternalID(self):
with self.assertRaisesRegex(TLResponseError, '5040.*GPROAPI-40000711'):
self.client.getTestCase(testcaseexternalid='GPROAPI-40000711')
def test_getTestCaseAttachments_unknownID(self):
#.........这里部分代码省略.........
示例3: TestLinkAPIOnlineTestCase
# 需要导入模块: from testlink import TestLinkHelper [as 别名]
# 或者: from testlink.TestLinkHelper import getProjectPlatforms [as 别名]
class TestLinkAPIOnlineTestCase(unittest.TestCase):
""" TestCases for TestlinkAPIClient - interacts with a TestLink Server.
works with the example project NEW_PROJECT_API (see TestLinkExample.py)
"""
def setUp(self):
self.client = TestLinkHelper().connect(TestlinkAPIClient)
# def tearDown(self):
# pass
def test_checkDevKey(self):
response = self.client.checkDevKey()
self.assertEqual(True, response)
def test_about(self):
response = self.client.about()
self.assertIn("Testlink API", response)
def test_ping(self):
response = self.client.ping()
self.assertEqual("Hello!", response)
def test_echo(self):
response = self.client.echo("Yellow Submarine")
self.assertEqual("You said: Yellow Submarine", response)
def test_doesUserExist_unknownID(self):
with self.assertRaisesRegex(TLResponseError, "10000.*Big Bird"):
self.client.doesUserExist("Big Bird")
def test_getBuildsForTestPlan_unknownID(self):
with self.assertRaisesRegex(TLResponseError, "3000.*40000711"):
self.client.getBuildsForTestPlan(40000711)
def test_getFirstLevelTestSuitesForTestProject_unknownID(self):
with self.assertRaisesRegex(TLResponseError, "7000.*40000711"):
self.client.getFirstLevelTestSuitesForTestProject(40000711)
def test_getFullPath_unknownID(self):
with self.assertRaisesRegex(TLResponseError, "getFullPath.*234"):
self.client.getFullPath("40000711")
def test_getLastExecutionResult_unknownID(self):
with self.assertRaisesRegex(TLResponseError, "3000.*40000711"):
self.client.getLastExecutionResult(40000711, 40000712)
def test_getLatestBuildForTestPlan_unknownID(self):
with self.assertRaisesRegex(TLResponseError, "3000.*40000711"):
self.client.getLatestBuildForTestPlan(40000711)
def test_getProjects(self):
response = self.client.getProjects()
self.assertIsNotNone(response)
def test_getProjectTestPlans_unknownID(self):
with self.assertRaisesRegex(TLResponseError, "7000.*40000711"):
self.client.getProjectTestPlans(40000711)
def test_getProjectPlatforms_unknownID(self):
with self.assertRaisesRegex(TLResponseError, "7000.*40000711"):
self.client.getProjectPlatforms(40000711)
def test_getTestCase_unknownID(self):
with self.assertRaisesRegex(TLResponseError, "5000.*40000711"):
self.client.getTestCase(40000711)
def test_getTestCase_unknownExternalID(self):
with self.assertRaisesRegex(TLResponseError, "5040.*N-2"):
self.client.getTestCase(testcaseexternalid="N-2")
def test_getTestCaseAttachments_unknownID(self):
with self.assertRaisesRegex(TLResponseError, "5000.*40000711"):
self.client.getTestCaseAttachments(40000711)
def test_getTestCaseCustomFieldDesignValue_unknownID(self):
with self.assertRaisesRegex(TLResponseError, "7000.*40000711"):
self.client.getTestCaseCustomFieldDesignValue("TC-40000712", 1, 40000711, "a_field", "a_detail")
def test_getTestCaseIDByName_unknownID(self):
with self.assertRaisesRegex(TLResponseError, "5030.*Cannot find"):
self.client.getTestCaseIDByName("Big Bird")
def test_getTestCasesForTestPlan_unknownID(self):
with self.assertRaisesRegex(TLResponseError, "3000.*40000711"):
self.client.getTestCasesForTestPlan(40000711)
def test_getTestCasesForTestSuite_unknownID(self):
with self.assertRaisesRegex(TLResponseError, "8000.*40000711"):
self.client.getTestCasesForTestSuite(40000711, 2, "a_detail")
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):
#.........这里部分代码省略.........
示例4: TestLinkAPIGenericOfflineTestCase
# 需要导入模块: from testlink import TestLinkHelper [as 别名]
# 或者: from testlink.TestLinkHelper import getProjectPlatforms [as 别名]
#.........这里部分代码省略.........
def test_noWrapperName_apiMethods(self):
" decorator test: API Methods internal function name should be unchanged "
# apiMethod with decorator @decoApiCallWithoutArgs
self.assertEqual('sayHello', self.api.sayHello.__name__)
# apiMethod with decorator @decoApiCallWithArgs
self.assertEqual('repeat', self.api.repeat.__name__)
# apiMethod with decorator @decoApiCallAddDevKey
self.assertEqual('createBuild', self.api.createBuild.__name__)
# apiMethod with decorator @decoMakerApiCallReplaceTLResponseError()
self.assertEqual('getProjectTestPlans', self.api.getProjectTestPlans.__name__)
# apiMethod with decorator @decoApiCallAddAttachment
self.assertEqual('uploadExecutionAttachment', self.api.uploadExecutionAttachment.__name__)
def test_ping(self):
self.api.loadScenario(SCENARIO_A)
response = self.api.ping()
self.assertEqual('Hey Folks!', response)
def test_getProjectTestPlans_noPlan(self):
self.api.loadScenario(SCENARIO_A)
response = self.api.getProjectTestPlans('noPlan')
self.assertEqual([], response)
self.assertEqual(self.api.devKey, self.api.callArgs['devKey'])
def test_getProjectTestPlans_onePlan(self):
self.api.loadScenario(SCENARIO_A)
response = self.api.getProjectTestPlans('onePlan')
self.assertEqual('21', response[0]['testproject_id'])
self.assertEqual(1, len(response))
def test_getProjectPlatforms_noPlatform(self):
self.api.loadScenario(SCENARIO_A)
response = self.api.getProjectPlatforms('noPlatform')
self.assertEqual({}, response)
self.assertEqual(self.api.devKey, self.api.callArgs['devKey'])
def test_getProjectPlatforms_twoPlatforms(self):
self.api.loadScenario(SCENARIO_A)
response = self.api.getProjectPlatforms('twoPlatforms')
self.assertEqual('1', response['dutch']['id'])
self.assertEqual(2, len(response))
def test_getBuildsForTestPlan_noBuild(self):
self.api.loadScenario(SCENARIO_A)
response = self.api.getBuildsForTestPlan('noBuild')
self.assertEqual([], response)
self.assertEqual(self.api.devKey, self.api.callArgs['devKey'])
def test_getTestPlanPlatforms_noPlatform(self):
self.api.loadScenario(SCENARIO_A)
response = self.api.getTestPlanPlatforms('noPlatform')
self.assertEqual([], response)
self.assertEqual(self.api.devKey, self.api.callArgs['devKey'])
def test_getTestPlanPlatforms_twoPlatforms(self):
self.api.loadScenario(SCENARIO_A)
response = self.api.getTestPlanPlatforms('twoPlatforms')
self.assertEqual('dutch', response[0]['name'])
self.assertEqual(2, len(response))
def test_getTestSuitesForTestPlan_noSuite(self):
self.api.loadScenario(SCENARIO_A)
示例5: TestLinkAPIGenericOfflineTestCase
# 需要导入模块: from testlink import TestLinkHelper [as 别名]
# 或者: from testlink.TestLinkHelper import getProjectPlatforms [as 别名]
#.........这里部分代码省略.........
def test_noWrapperName_apiMethods(self):
" decorator test: API Methods internal function name should be unchanged "
# apiMethod with decorator @decoApiCallWithoutArgs
self.assertEqual('sayHello', self.api.sayHello.__name__)
# apiMethod with decorator @decoApiCallWithArgs
self.assertEqual('repeat', self.api.repeat.__name__)
# apiMethod with decorator @decoApiCallAddDevKey
self.assertEqual('createBuild', self.api.createBuild.__name__)
# apiMethod with decorator @decoMakerApiCallReplaceTLResponseError()
self.assertEqual('getProjectTestPlans', self.api.getProjectTestPlans.__name__)
# apiMethod with decorator @decoApiCallAddAttachment
self.assertEqual('uploadExecutionAttachment', self.api.uploadExecutionAttachment.__name__)
def test_ping(self):
self.api.loadScenario(SCENARIO_A)
response = self.api.ping()
self.assertEqual('Hey Folks!', response)
def test_getProjectTestPlans_noPlan(self):
self.api.loadScenario(SCENARIO_A)
response = self.api.getProjectTestPlans('noPlan')
self.assertEqual([], response)
self.assertEqual(self.api.devKey, self.api.callArgs['devKey'])
def test_getProjectTestPlans_onePlan(self):
self.api.loadScenario(SCENARIO_A)
response = self.api.getProjectTestPlans('onePlan')
self.assertEqual('21', response[0]['testproject_id'])
self.assertEqual(1, len(response))
def test_getProjectPlatforms_noPlatform(self):
self.api.loadScenario(SCENARIO_A)
response = self.api.getProjectPlatforms('noPlatform')
self.assertEqual({}, response)
self.assertEqual(self.api.devKey, self.api.callArgs['devKey'])
def test_getProjectPlatforms_twoPlatforms(self):
self.api.loadScenario(SCENARIO_A)
response = self.api.getProjectPlatforms('twoPlatforms')
self.assertEqual('1', response['dutch']['id'])
self.assertEqual(2, len(response))
def test_getBuildsForTestPlan_noBuild(self):
self.api.loadScenario(SCENARIO_A)
response = self.api.getBuildsForTestPlan('noBuild')
self.assertEqual([], response)
self.assertEqual(self.api.devKey, self.api.callArgs['devKey'])
def test_getTestPlanPlatforms_noPlatform(self):
self.api.loadScenario(SCENARIO_A)
response = self.api.getTestPlanPlatforms('noPlatform')
self.assertEqual([], response)
self.assertEqual(self.api.devKey, self.api.callArgs['devKey'])
def test_getTestPlanPlatforms_twoPlatforms(self):
self.api.loadScenario(SCENARIO_A)
response = self.api.getTestPlanPlatforms('twoPlatforms')
self.assertEqual('dutch', response[0]['name'])
self.assertEqual(2, len(response))
def test_getTestSuitesForTestPlan_noSuite(self):
self.api.loadScenario(SCENARIO_A)