本文整理汇总了Python中testlink.TestLinkHelper.countProjects方法的典型用法代码示例。如果您正苦于以下问题:Python TestLinkHelper.countProjects方法的具体用法?Python TestLinkHelper.countProjects怎么用?Python TestLinkHelper.countProjects使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类testlink.TestLinkHelper
的用法示例。
在下文中一共展示了TestLinkHelper.countProjects方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: TestLinkAPIOfflineTestCase
# 需要导入模块: from testlink import TestLinkHelper [as 别名]
# 或者: from testlink.TestLinkHelper import countProjects [as 别名]
class TestLinkAPIOfflineTestCase(unittest.TestCase):
""" TestCases for TestlinkAPIClient - does not interacts with a TestLink Server.
works with DummyAPIClientm which returns special test data
"""
def setUp(self):
self.api = TestLinkHelper().connect(DummyAPIClient)
# def tearDown(self):
# pass
def test_countProjects(self):
self.api.loadScenario(SCENARIO_A)
response = self.api.countProjects()
self.assertEqual(2, response)
def test_countTestPlans(self):
self.api.loadScenario(SCENARIO_A)
response = self.api.countTestPlans()
self.assertEqual(1, response)
def test_countTestSuites(self):
self.api.loadScenario(SCENARIO_A)
response = self.api.countTestSuites()
self.assertEqual(0, response)
def test_countTestCasesTP(self):
self.api.loadScenario(SCENARIO_A)
response = self.api.countTestCasesTP()
self.assertEqual(0, response)
def test_countTestCasesTS(self):
self.api.loadScenario(SCENARIO_A)
response = self.api.countTestCasesTS()
self.assertEqual(0, response)
def test_countPlatforms(self):
self.api.loadScenario(SCENARIO_A)
response = self.api.countPlatforms()
self.assertEqual(0, response)
def test_countBuilds(self):
self.api.loadScenario(SCENARIO_A)
response = self.api.countBuilds()
self.assertEqual(0, response)
# def test_listProjects(self):
# self.api.loadScenario(SCENARIO_A)
# self.api.listProjects()
# no assert check cause method returns nothing
# 'just' prints to stdout
def test_getProjectIDByName(self):
self.api.loadScenario(SCENARIO_A)
response = self.api.getProjectIDByName('NEW_PROJECT_API')
self.assertEqual('21', response)
response = self.api.getProjectIDByName('UNKNOWN_PROJECT')
self.assertEqual(-1, response)
示例2: TestLinkAPIOfflineTestCase
# 需要导入模块: from testlink import TestLinkHelper [as 别名]
# 或者: from testlink.TestLinkHelper import countProjects [as 别名]
class TestLinkAPIOfflineTestCase(unittest.TestCase):
""" TestCases for TestlinkAPIClient - does not interacts with a TestLink Server.
works with DummyAPIClientm which returns special test data
"""
example_steps = [{'step_number' : '1', 'actions' : "action A" ,
'expected_results' : "result A", 'execution_type' : "0"},
{'step_number' : '2', 'actions' : "action B" ,
'expected_results' : "result B", 'execution_type' : "1"},
{'step_number' : '3', 'actions' : "action C" ,
'expected_results' : "result C", 'execution_type' : "0"}]
def setUp(self):
self.api = TestLinkHelper().connect(DummyAPIClient)
# def tearDown(self):
# pass
def test_countProjects(self):
self.api.loadScenario(SCENARIO_A)
response = self.api.countProjects()
self.assertEqual(2, response)
def test_countTestPlans(self):
self.api.loadScenario(SCENARIO_A)
response = self.api.countTestPlans()
self.assertEqual(2, response)
def test_countTestSuites(self):
self.api.loadScenario(SCENARIO_A)
response = self.api.countTestSuites()
self.assertEqual(0, response)
def test_countTestCasesTP(self):
self.api.loadScenario(SCENARIO_A)
response = self.api.countTestCasesTP()
self.assertEqual(0, response)
def test_countTestCasesTS(self):
self.api.loadScenario(SCENARIO_A)
response = self.api.countTestCasesTS()
self.assertEqual(0, response)
def test_countPlatforms(self):
self.api.loadScenario(SCENARIO_A)
response = self.api.countPlatforms()
self.assertEqual(2, response)
def test_countBuilds(self):
self.api.loadScenario(SCENARIO_A)
response = self.api.countBuilds()
self.assertEqual(0, response)
# def test_listProjects(self):
# self.api.loadScenario(SCENARIO_A)
# self.api.listProjects()
# no assert check cause method returns nothing
# 'just' prints to stdout
def test_getProjectIDByName(self):
self.api.loadScenario(SCENARIO_A)
response = self.api.getProjectIDByName('NEW_PROJECT_API')
self.assertEqual('21', response)
response = self.api.getProjectIDByName('UNKNOWN_PROJECT')
self.assertEqual(-1, response)
def test_initStep(self):
self.api.initStep("action A", "result A", 0)
steps = self.example_steps[:1]
self.assertEqual(steps, self.api.stepsList)
def test_appendStep(self):
steps = self.example_steps
self.api.stepsList = steps[:1]
self.api.appendStep("action B", "result B", 1)
self.api.appendStep("action C", "result C", 0)
self.assertEqual(steps, self.api.stepsList)
def test_createTestCaseWithSteps(self):
self.api.loadScenario(SCENARIO_STEPS)
self.api.initStep("action A", "result A", 0)
self.api.appendStep("action B", "result B", 1)
self.api.appendStep("action C", "result C", 0)
self.api.createTestCase('case 4711', 4712, 4713, 'Big Bird',
'summary 4714')
self.assertEqual(self.example_steps, self.api.callArgs['steps'])
self.assertEqual([], self.api.stepsList)
def test_createTestCaseWithConfusingSteps(self):
self.api.loadScenario(SCENARIO_STEPS)
self.api.initStep("action A", "result A", 0)
self.api.appendStep("action B", "result B", 1)
self.api.appendStep("action C", "result C", 0)
with self.assertRaisesRegexp(TLArgError, 'confusing createTestCase*'):
self.api.createTestCase('case 4711', 4712, 4713, 'Big Bird',
'summary 4714', steps=[])
def test_getTestCaseIDByName_dictResult(self):
"test that getTestCaseIDByName converts dictionary result into a list"
self.api.loadScenario(SCENARIO_A)
#.........这里部分代码省略.........
示例3: TestLinkAPIOfflineTestCase
# 需要导入模块: from testlink import TestLinkHelper [as 别名]
# 或者: from testlink.TestLinkHelper import countProjects [as 别名]
class TestLinkAPIOfflineTestCase(unittest.TestCase):
""" TestCases for TestlinkAPIClient - does not interacts with a TestLink Server.
works with DummyAPIClientm which returns special test data
"""
example_steps = [{'step_number' : '1', 'actions' : "action A" ,
'expected_results' : "result A", 'execution_type' : "0"},
{'step_number' : '2', 'actions' : "action B" ,
'expected_results' : "result B", 'execution_type' : "1"},
{'step_number' : '3', 'actions' : "action C" ,
'expected_results' : "result C", 'execution_type' : "0"}]
def setUp(self):
self.api = TestLinkHelper().connect(DummyAPIClient)
# def tearDown(self):
# pass
def test_countProjects(self):
self.api.loadScenario(SCENARIO_A)
response = self.api.countProjects()
self.assertEqual(2, response)
def test_countTestPlans(self):
self.api.loadScenario(SCENARIO_A)
response = self.api.countTestPlans()
self.assertEqual(2, response)
def test_countTestSuites(self):
self.api.loadScenario(SCENARIO_A)
response = self.api.countTestSuites()
self.assertEqual(0, response)
def test_countTestCasesTP(self):
self.api.loadScenario(SCENARIO_A)
response = self.api.countTestCasesTP()
self.assertEqual(0, response)
def test_countTestCasesTS(self):
self.api.loadScenario(SCENARIO_A)
response = self.api.countTestCasesTS()
self.assertEqual(0, response)
def test_countPlatforms(self):
self.api.loadScenario(SCENARIO_A)
response = self.api.countPlatforms()
self.assertEqual(2, response)
def test_countBuilds(self):
self.api.loadScenario(SCENARIO_A)
response = self.api.countBuilds()
self.assertEqual(0, response)
# def test_listProjects(self):
# self.api.loadScenario(SCENARIO_A)
# self.api.listProjects()
# no assert check cause method returns nothing
# 'just' prints to stdout
def test_getProjectIDByName(self):
self.api.loadScenario(SCENARIO_A)
response = self.api.getProjectIDByName('NEW_PROJECT_API')
self.assertEqual('21', response)
response = self.api.getProjectIDByName('UNKNOWN_PROJECT')
self.assertEqual(-1, response)
def test_initStep(self):
self.api.initStep("action A", "result A", 0)
steps = self.example_steps[:1]
self.assertEqual(steps, self.api.stepsList)
def test_appendStep(self):
steps = self.example_steps
self.api.stepsList = steps[:1]
self.api.appendStep("action B", "result B", 1)
self.api.appendStep("action C", "result C", 0)
self.assertEqual(steps, self.api.stepsList)
def test_createTestCaseWithSteps(self):
self.api.loadScenario(SCENARIO_STEPS)
self.api.initStep("action A", "result A", 0)
self.api.appendStep("action B", "result B", 1)
self.api.appendStep("action C", "result C", 0)
self.api.createTestCase('case 4711', 4712, 4713, 'Big Bird',
'summary 4714')
self.assertEqual(self.example_steps, self.api.callArgs['steps'])
self.assertEqual([], self.api.stepsList)
def test_getTestCaseIDByName_dictResult(self):
"test that getTestCaseIDByName converts dictionary result into a list"
self.api.loadScenario(SCENARIO_A)
# v0.4.0 version for optional args testsuitename + testprojectname
#response = self.api.getTestCaseIDByName('dictResult', None, 'NEW_PROJECT_API')
# v0.4.5 version
response = self.api.getTestCaseIDByName('dictResult',
testprojectname='NEW_PROJECT_API')
self.assertEqual(list, type(response))
self.assertEqual('TESTCASE_B', response[0]['name'])
self.assertEqual(self.api.devKey, self.api.callArgs['devKey'])
#.........这里部分代码省略.........
示例4: TestLinkAPIOfflineTestCase
# 需要导入模块: from testlink import TestLinkHelper [as 别名]
# 或者: from testlink.TestLinkHelper import countProjects [as 别名]
class TestLinkAPIOfflineTestCase(unittest.TestCase):
""" TestCases for TestlinkAPIClient - does not interacts with a TestLink Server.
works with DummyAPIClientm which returns special test data
"""
example_steps = [{'step_number' : '1', 'actions' : "action A" ,
'expected_results' : "result A", 'execution_type' : "0"},
{'step_number' : '2', 'actions' : "action B" ,
'expected_results' : "result B", 'execution_type' : "1"},
{'step_number' : '3', 'actions' : "action C" ,
'expected_results' : "result C", 'execution_type' : "0"}]
def setUp(self):
self.api = TestLinkHelper().connect(DummyAPIClient)
# def tearDown(self):
# pass
def test_countProjects(self):
self.api.loadScenario(SCENARIO_A)
response = self.api.countProjects()
self.assertEqual(2, response)
def test_countTestPlans(self):
self.api.loadScenario(SCENARIO_A)
response = self.api.countTestPlans()
self.assertEqual(2, response)
def test_countTestSuites(self):
self.api.loadScenario(SCENARIO_A)
response = self.api.countTestSuites()
self.assertEqual(0, response)
def test_countTestCasesTP(self):
self.api.loadScenario(SCENARIO_A)
response = self.api.countTestCasesTP()
self.assertEqual(0, response)
def test_countTestCasesTS(self):
self.api.loadScenario(SCENARIO_A)
response = self.api.countTestCasesTS()
self.assertEqual(0, response)
def test_countPlatforms(self):
self.api.loadScenario(SCENARIO_A)
response = self.api.countPlatforms()
self.assertEqual(2, response)
def test_countBuilds(self):
self.api.loadScenario(SCENARIO_A)
response = self.api.countBuilds()
self.assertEqual(0, response)
# def test_listProjects(self):
# self.api.loadScenario(SCENARIO_A)
# self.api.listProjects()
# no assert check cause method returns nothing
# 'just' prints to stdout
def test_getProjectIDByName(self):
self.api.loadScenario(SCENARIO_A)
response = self.api.getProjectIDByName('NEW_PROJECT_API')
self.assertEqual('21', response)
response = self.api.getProjectIDByName('UNKNOWN_PROJECT')
self.assertEqual(-1, response)
def test_initStep(self):
self.api.initStep("action A", "result A", 0)
steps = self.example_steps[:1]
self.assertEqual(steps, self.api.stepsList)
def test_appendStep(self):
steps = self.example_steps
self.api.stepsList = steps[:1]
self.api.appendStep("action B", "result B", 1)
self.api.appendStep("action C", "result C", 0)
self.assertEqual(steps, self.api.stepsList)
def test_createTestCaseWithSteps(self):
self.api.loadScenario(SCENARIO_STEPS)
self.api.initStep("action A", "result A", 0)
self.api.appendStep("action B", "result B", 1)
self.api.appendStep("action C", "result C", 0)
self.api.createTestCase('case 4711', 4712, 4713, 'Big Bird',
'summary 4714')
self.assertEqual(self.example_steps, self.api.callArgs['steps'])
self.assertEqual([], self.api.stepsList)
def test_createTestCaseWithConfusingSteps(self):
self.api.loadScenario(SCENARIO_STEPS)
self.api.initStep("action A", "result A", 0)
self.api.appendStep("action B", "result B", 1)
self.api.appendStep("action C", "result C", 0)
with self.assertRaisesRegexp(TLArgError, 'confusing createTestCase*'):
self.api.createTestCase('case 4711', 4712, 4713, 'Big Bird',
'summary 4714', steps=[])
def test_getTestCaseIDByName_dictResult(self):
"test that getTestCaseIDByName converts dictionary result into a list"
self.api.loadScenario(SCENARIO_A)
#.........这里部分代码省略.........