当前位置: 首页>>代码示例>>Python>>正文


Python TestLinkHelper.getTestCasesForTestPlan方法代码示例

本文整理汇总了Python中testlink.TestLinkHelper.getTestCasesForTestPlan方法的典型用法代码示例。如果您正苦于以下问题:Python TestLinkHelper.getTestCasesForTestPlan方法的具体用法?Python TestLinkHelper.getTestCasesForTestPlan怎么用?Python TestLinkHelper.getTestCasesForTestPlan使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在testlink.TestLinkHelper的用法示例。


在下文中一共展示了TestLinkHelper.getTestCasesForTestPlan方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: TestLinkAPIOnlineTestCase

# 需要导入模块: from testlink import TestLinkHelper [as 别名]
# 或者: from testlink.TestLinkHelper import getTestCasesForTestPlan [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'):
#.........这里部分代码省略.........
开发者ID:Maberi,项目名称:TestLink-API-Python-client,代码行数:103,代码来源:testlinkapi_online_test.py

示例2: TestLinkAPIGenericOnlineTestCase

# 需要导入模块: from testlink import TestLinkHelper [as 别名]
# 或者: from testlink.TestLinkHelper import getTestCasesForTestPlan [as 别名]

#.........这里部分代码省略.........
    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):
        with self.assertRaisesRegex(TLResponseError, '5000.*40000711'):
            self.client.getTestCaseAttachments(testcaseid=40000711)
         
    def test_getTestCaseCustomFieldDesignValue_unknownID(self):
        with self.assertRaisesRegex(TLResponseError, '7000.*40000711'):
            self.client.getTestCaseCustomFieldDesignValue(
                   'TC-40000712', 1, 40000711, 'a_field', details='full')
         
    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)
 
    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):
开发者ID:TommyXie1990,项目名称:TestLink-API-Python-client,代码行数:70,代码来源:testlinkapi_generic_online_test.py

示例3: TestLinkAPIOnlineTestCase

# 需要导入模块: from testlink import TestLinkHelper [as 别名]
# 或者: from testlink.TestLinkHelper import getTestCasesForTestPlan [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):
        response = self.client.doesUserExist('Big Bird')
        self.assertIn('Big Bird', response[0]['message'])
        self.assertEqual(10000, response[0]['code'])
        
    def test_getBuildsForTestPlan_unknownID(self):
        response = self.client.getBuildsForTestPlan(4711)
        self.assertIn('4711', response[0]['message'])
        self.assertEqual(3000, response[0]['code'])
        
    def test_getFirstLevelTestSuitesForTestProject_unknownID(self):
        response = self.client.getFirstLevelTestSuitesForTestProject(4711)
        self.assertIn('4711', response[0]['message'])
        self.assertEqual(7000, response[0]['code'])

    def test_getFullPath_unknownID(self):
        response = self.client.getFullPath(4711)
        self.assertIn('getFullPath', response[0]['message'])
        self.assertEqual(234, response[0]['code'])

    def test_getLastExecutionResult_unknownID(self):
        response = self.client.getLastExecutionResult(4711, 4712)
        self.assertIn('4711', response[0]['message'])
        self.assertEqual(3000, response[0]['code'])
        
    def test_getLatestBuildForTestPlan_unknownID(self):
        response = self.client.getLatestBuildForTestPlan(4711)
        self.assertIn('4711', response[0]['message'])
        self.assertEqual(3000, response[0]['code'])
        
    def test_getProjects(self):
        response = self.client.getProjects()
        self.assertIsNotNone(response)
        
    def test_getProjectTestPlans_unknownID(self):
        response = self.client.getProjectTestPlans(4711)
        self.assertIn('4711', response[0]['message'])
        self.assertEqual(7000, response[0]['code'])
        
    def test_getTestCase_unknownID(self):
        response = self.client.getTestCase(4711)
        # 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_getTestCaseAttachments_unknownID(self):
        response = self.client.getTestCaseAttachments(4711)
        # 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_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')
#.........这里部分代码省略.........
开发者ID:pade,项目名称:TestLink-API-Python-client,代码行数:103,代码来源:testlinkapi_online_test.py

示例4: TestLinkAPIGenericOfflineTestCase

# 需要导入模块: from testlink import TestLinkHelper [as 别名]
# 或者: from testlink.TestLinkHelper import getTestCasesForTestPlan [as 别名]

#.........这里部分代码省略.........
        response = self.api.getTestSuitesForTestPlan('noSuite')
        self.assertEqual([], response)
        self.assertEqual(self.api.devKey, self.api.callArgs['devKey'])
       
    def test_getTestSuitesForTestSuite_noSuite(self):
        self.api.loadScenario(SCENARIO_A)
        response = self.api.getTestSuitesForTestSuite('noSuite')
        self.assertEqual([], response)
        self.assertEqual(self.api.devKey, self.api.callArgs['devKey'])
        
    def test_getFirstLevelTestSuitesForTestProject_noSuite(self):
        self.api.loadScenario(SCENARIO_A)
        response = self.api.getFirstLevelTestSuitesForTestProject('noSuite')
        self.assertEqual([], response)
        self.assertEqual(self.api.devKey, self.api.callArgs['devKey'])
        
    def test_getTestCasesForTestSuite_noTestCase(self):
        self.api.loadScenario(SCENARIO_A)
        response = self.api.getTestCasesForTestSuite('noTestCase')
        self.assertEqual([], response)
        self.assertEqual(self.api.devKey, self.api.callArgs['devKey'])

    def test_getTestCasesForTestSuite_keyWords(self):
        self.api.loadScenario(SCENARIO_KEYWORDS)
        response = self.api.getTestCasesForTestSuite('keyWords', details='full', 
                                                     getkeywords=True)
        self.assertIn('keywords', response[0])
        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_getTestCasesForTestPlan_noTestCase(self):
        self.api.loadScenario(SCENARIO_A)
        response = self.api.getTestCasesForTestPlan('noTestCase')
        self.assertEqual([], response)
        self.assertEqual(self.api.devKey, self.api.callArgs['devKey'])
        
    def test_getTestCaseIDByName_dictResult(self):
        self.api.loadScenario(SCENARIO_A)
        response = self.api.getTestCaseIDByName('dictResult', 
                                            testprojectname='NEW_PROJECT_API')
        self.assertEqual(dict, type(response))
        self.assertEqual('TESTCASE_B', response['1']['name']) 
        self.assertEqual(self.api.devKey, self.api.callArgs['devKey'])
        
    def test_getTestCaseIDByName_listResult(self):
        self.api.loadScenario(SCENARIO_A)
        response = self.api.getTestCaseIDByName('listResult')
        self.assertEqual(list, type(response))
        self.assertEqual('TESTCASE_AA', response[0]['name']) 
        self.assertEqual(self.api.devKey, self.api.callArgs['devKey'])

    def test_testLinkVersion_beforeTL199(self):
        self.api.loadScenario(SCENARIO_TL198)
        response = self.api.testLinkVersion()
        self.assertEqual('<= 1.9.8', response)
        
    def test_testLinkVersion_withTL199(self):
        self.api.loadScenario(SCENARIO_TL199)
        response = self.api.testLinkVersion()
        self.assertEqual('1.9.9', response)
        
    def test_connectionInfo_beforeTL199(self):
        self.api.loadScenario(SCENARIO_TL198)
开发者ID:manojpkr,项目名称:TestLink-API-Python-client,代码行数:70,代码来源:testlinkapigeneric_offline_test.py

示例5: TestLinkAPIOnlineTestCase

# 需要导入模块: from testlink import TestLinkHelper [as 别名]
# 或者: from testlink.TestLinkHelper import getTestCasesForTestPlan [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):
#.........这里部分代码省略.........
开发者ID:dkentw,项目名称:TestLink-API-Python-client,代码行数:103,代码来源:testlinkapi_online_test.py

示例6: TestLinkAPIOnlineTestCase

# 需要导入模块: from testlink import TestLinkHelper [as 别名]
# 或者: from testlink.TestLinkHelper import getTestCasesForTestPlan [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')
开发者ID:citizen-stig,项目名称:TestLink-API-Python-client,代码行数:104,代码来源:testlinkapigeneric_online_test.py

示例7: TestLinkAPIGenericOfflineTestCase

# 需要导入模块: from testlink import TestLinkHelper [as 别名]
# 或者: from testlink.TestLinkHelper import getTestCasesForTestPlan [as 别名]

#.........这里部分代码省略.........
        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)
        response = self.api.getTestSuitesForTestPlan('noSuite')
        self.assertEqual([], response)
        self.assertEqual(self.api.devKey, self.api.callArgs['devKey'])
       
    def test_getTestSuitesForTestSuite_noSuite(self):
        self.api.loadScenario(SCENARIO_A)
        response = self.api.getTestSuitesForTestSuite('noSuite')
        self.assertEqual([], response)
        self.assertEqual(self.api.devKey, self.api.callArgs['devKey'])
        
    def test_getFirstLevelTestSuitesForTestProject_noSuite(self):
        self.api.loadScenario(SCENARIO_A)
        response = self.api.getFirstLevelTestSuitesForTestProject('noSuite')
        self.assertEqual([], response)
        self.assertEqual(self.api.devKey, self.api.callArgs['devKey'])
        
    def test_getTestCasesForTestSuite_noTestCase(self):
        self.api.loadScenario(SCENARIO_A)
        response = self.api.getTestCasesForTestSuite('noTestCase')
        self.assertEqual([], response)
        self.assertEqual(self.api.devKey, self.api.callArgs['devKey'])
           
    def test_getTestCasesForTestPlan_noTestCase(self):
        self.api.loadScenario(SCENARIO_A)
        response = self.api.getTestCasesForTestPlan('noTestCase')
        self.assertEqual([], response)
        self.assertEqual(self.api.devKey, self.api.callArgs['devKey'])
        
    def test_getTestCaseIDByName_dictResult(self):
        self.api.loadScenario(SCENARIO_A)
        response = self.api.getTestCaseIDByName('dictResult', 
                                            testprojectname='NEW_PROJECT_API')
        self.assertEqual(dict, type(response))
        self.assertEqual('TESTCASE_B', response['1']['name']) 
        self.assertEqual(self.api.devKey, self.api.callArgs['devKey'])
        
    def test_getTestCaseIDByName_listResult(self):
        self.api.loadScenario(SCENARIO_A)
        response = self.api.getTestCaseIDByName('listResult')
        self.assertEqual(list, type(response))
        self.assertEqual('TESTCASE_AA', response[0]['name']) 
        self.assertEqual(self.api.devKey, self.api.callArgs['devKey'])

    def test_testLinkVersion_beforeTL199(self):
        self.api.loadScenario(SCENARIO_TL198)
        response = self.api.testLinkVersion()
        self.assertEqual('<= 1.9.8', response)
        
    def test_testLinkVersion_withTL199(self):
        self.api.loadScenario(SCENARIO_TL199)
        response = self.api.testLinkVersion()
        self.assertEqual('1.9.9', response)
        
    def test_connectionInfo_beforeTL199(self):
        self.api.loadScenario(SCENARIO_TL198)
        response = self.api.connectionInfo()
        self.assertRegexpMatches(response, '\d*\.\d*\.\d*')
开发者ID:charz,项目名称:TestLink-API-Python-client,代码行数:104,代码来源:testlinkapigeneric_offline_test.py

示例8: TestClass

# 需要导入模块: from testlink import TestLinkHelper [as 别名]
# 或者: from testlink.TestLinkHelper import getTestCasesForTestPlan [as 别名]
class TestClass():
    def setUp(self):
        """Initialisation
        """

        # precondition - SERVEUR_URL and KEY are defined in environment
        # TESTLINK_API_PYTHON_SERVER_URL=http://localhost/testlink/lib/api/xmlrpc.php
        # TESTLINK_API_PYTHON_DEVKEY=7ec252ab966ce88fd92c25d08635672b
        self.client = TestLinkHelper().connect(TestLink)

    def test_getTestCaseIDByName(self):
        """ getTestCaseIDByName test
        """
        val = self.client.getTestCaseIDByName("Fin de programme", "Séquence 2", "Test 2")
        # 31 is test case id
        assert_equal(val, '31' )

        # Check if an error is raised in case of bad parameters
        assert_raises(TestLinkError, self.client.getTestCaseIDByName, "Initialisation", "Séquence 1", "Test 2")

    def test_getTestProjectByName(self):
        project = self.client.getTestProjectByName("Test 2")
        assert_equals(type(project), dict)
        # Check if an error is raised in case of bad parameters
        assert_raises(TestLinkError, self.client.getTestProjectByName, "Unknown project")

    def test_getTestPlanByName(self):
        plan_ok = self.client.getTestPlanByName("Test 2", "Full")

        # Assume that plan id is 33
        assert_equal(plan_ok['id'], '33')

        assert_raises(TestLinkError, self.client.getTestPlanByName, "Test 2", "Name Error")

    def test_getBuildByName(self):
        pass

    def test_reportResult(self):
        dico = {'testPlanName': 'FullAuto',
                'buildName': 'V0.1'}
        execid = self.client.reportResult("p", "test1", "S1", "An example of note", **dico)
        assert_equal(type(execid), str)

        execid = self.client.reportResult("f", "test2", "S1", **dico)
        assert_equal(type(execid), str)

    def test_getTestCasesForTestPlan(self):
        results = self.client.getTestCasesForTestPlan("Automatique", "FullAuto")
        for result in results:
            print result
        #TODO
#        assert_equal(type(results), list)

        #for elem in results:
            #assert_equal(type(elem), dict)

    def test_getTestCaseCustomFieldDesignValue(self):
        test_list = self.client.getTestCasesForTestPlan("Automatique", "FullAuto")
        for test in test_list:
            #print test
            results = self.client.getTestCaseCustomFieldDesignValue("AutomaticTestFunction", "Automatique", test )
            if results != '':
                assert_equal(results, 'Fonction_auto-5')

    def test_getProjectIDByName(self):
        projectid = self.client.getProjectIDByName("Automatique")
        assert_equal(projectid, '52')

    def test_getTestCaseByExtID(self):
        """getTestCaseByExtID test method"""

        assert_raises(TestLinkErrors, self.client.getTestCaseByExtID, 'Id not known')

        extid = 'auto-5'
        tc = self.client.getTestCaseByExtID(extid)
        assert_equal(tc.extid, extid)

    def test_getTestCase(self):
        """getTestCase test method"""

        tc = self.client.getTestCase(testcaseexternalid='auto-5')

        # tc must be an TestCase object
        assert_equal(tc.extid, 'auto-5')

        # Test failed Return
        assert_raises(TestLinkErrors, self.client.getTestCase, 'Id not known')
开发者ID:pade,项目名称:TestLink-API-Python-client,代码行数:89,代码来源:test.py


注:本文中的testlink.TestLinkHelper.getTestCasesForTestPlan方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。