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


Python TestLinkHelper.getRequirementCustomFieldDesignValue方法代码示例

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


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

示例1: TestLinkAPIGenericOfflineTestCase

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

#.........这里部分代码省略.........

    def test_getTestSuiteCustomFieldDesignValue_notAssigned(self):
        self.api.loadScenario(SCENARIO_CUSTOM_FIELDS)
        response = self.api.getTestSuiteCustomFieldDesignValue(
                                            'cf_notAssigned', '7760', '7762') 
        self.assertEqual(None, response)
        self.assertEqual(self.api.devKey, self.api.callArgs['devKey'])

    def test_getTestSuiteCustomFieldDesignValue_full(self):
        self.api.loadScenario(SCENARIO_CUSTOM_FIELDS)
        response = self.api.getTestSuiteCustomFieldDesignValue(
                                                    'cf_full', '7760', '7762') 
        self.assertEqual('a custom TSuite string', response['value'])           
        self.assertEqual('1', response['enable_on_design']) 
        self.assertEqual('0', response['enable_on_testplan_design']) 
        self.assertEqual('0', response['enable_on_execution'])           

    def test_getTestPlanCustomFieldDesignValue_notAssigned(self):
        self.api.loadScenario(SCENARIO_CUSTOM_FIELDS)
        response = self.api.getTestPlanCustomFieldDesignValue(
                                            'cf_notAssigned', '7760', '7761') 
        self.assertEqual(None, response)
        self.assertEqual(self.api.devKey, self.api.callArgs['devKey'])

    def test_getTestPlanCustomFieldDesignValue_full(self):
        self.api.loadScenario(SCENARIO_CUSTOM_FIELDS)
        response = self.api.getTestPlanCustomFieldDesignValue(
                                                    'cf_full', '7760', '7761') 
        self.assertEqual('a custom TPlan string', response['value'])           
        self.assertEqual('1', response['enable_on_design']) 
        self.assertEqual('0', response['enable_on_testplan_design']) 
        self.assertEqual('0', response['enable_on_execution'])           

    def test_getReqSpecCustomFieldDesignValue_notAssigned(self):
        self.api.loadScenario(SCENARIO_CUSTOM_FIELDS)
        response = self.api.getReqSpecCustomFieldDesignValue(
                                            'cf_notAssigned', '7760', '7789') 
        self.assertEqual(None, response)
        self.assertEqual(self.api.devKey, self.api.callArgs['devKey'])

    def test_getReqSpecCustomFieldDesignValue_full(self):
        self.api.loadScenario(SCENARIO_CUSTOM_FIELDS)
        response = self.api.getReqSpecCustomFieldDesignValue(
                                                    'cf_full', '7760', '7789') 
        self.assertEqual('a custom ReqSpec string', response['value'])           
        self.assertEqual('1', response['enable_on_design']) 
        self.assertEqual('0', response['enable_on_testplan_design']) 
        self.assertEqual('0', response['enable_on_execution'])           

    def test_getRequirementCustomFieldDesignValue_notAssigned(self):
        self.api.loadScenario(SCENARIO_CUSTOM_FIELDS)
        response = self.api.getRequirementCustomFieldDesignValue(
                                            'cf_notAssigned', '7760', '7791') 
        self.assertEqual(None, response)
        self.assertEqual(self.api.devKey, self.api.callArgs['devKey'])

    def test_getRequirementCustomFieldDesignValue_full(self):
        self.api.loadScenario(SCENARIO_CUSTOM_FIELDS)
        response = self.api.getRequirementCustomFieldDesignValue(
                                                    'cf_full', '7760', '7791') 
        self.assertEqual('a custom Req string', response['value'])           
        self.assertEqual('1', response['enable_on_design']) 
        self.assertEqual('0', response['enable_on_testplan_design']) 
        self.assertEqual('0', response['enable_on_execution'])   
        
    def test_reportTCResult_user(self):
        self.api.loadScenario(SCENARIO_A)
        response = self.api.reportTCResult(4712, 'p', testcaseid=4711, 
                                    buildname='build 4713', notes='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_whatArgs_getLastExecutionResult(self):
        argsDescription = self.api.whatArgs('getLastExecutionResult')
        self.assertIn('options=<options>', argsDescription)
        self.assertIn('getBugs', argsDescription)

    def test__getAttachmentArgs_textfile(self):
        "py3 issue #39 TypeError: expected bytes-like object, not str"
        NEWATTACHMENT_PY= os.path.realpath(__file__)
        # under py2, on windows text files should be open with 'r' mode and 
        # binary files with 'rb' 
        # see http://docs.python.org/2/tutorial/inputoutput.html#reading-and-writing-files
        # under py3, text files open with 'r' on windows makes problem
        # see https://github.com/lczub/TestLink-API-Python-client/issues/39
        a_file = open(NEWATTACHMENT_PY, BINARY_READ_MODE)
        args = self.api._getAttachmentArgs(a_file)
        self.assertEqual('testlinkapigeneric_offline_test.py', args['filename'])
        if sys.version_info[0] == 2 and sys.version_info[1] == 6:
            self.assertEqual('text/x-python', args['filetype'])
        else:
            self.assertEqual('text/plain', args['filetype'])

        self.assertIsNotNone(args['content'])
开发者ID:manojpkr,项目名称:TestLink-API-Python-client,代码行数:104,代码来源:testlinkapigeneric_offline_test.py

示例2: TestLinkAPIGenericOnlineTestCase

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

#.........这里部分代码省略.........
            self.client.getExecCountersByBuild(40000711)
            
    def test_getTestCaseCustomFieldExecutionValue_unknownID(self):
        with self.assertRaisesRegex(TLResponseError, '236.*version/executionid'):
            self.client.getTestCaseCustomFieldExecutionValue(
                            'cf_full', '40000711', 1, '715', '40000713')
            
    def test_getTestCaseCustomFieldTestPlanDesignValue_unknownID(self):
        with self.assertRaisesRegex(TLResponseError, '7000.*40000711'):
            self.client.getTestCaseCustomFieldTestPlanDesignValue(
                            'cf_full', '40000711', 1, '40000713', '615')
            
    def test_updateTestCaseCustomFieldDesignValue_unknownID(self):
        with self.assertRaisesRegex(TLResponseError, '7000.*40000711'):
            self.client.updateTestCaseCustomFieldDesignValue(
                            'TC-40000712', 1, 40000711, {'cf_field1' : 'value1',
                                                 'cf_field2' : 'value2'})

    def test_getTestSuiteCustomFieldDesignValue_unknownID(self):
        with self.assertRaisesRegex(TLResponseError, '7000.*40000711'):
            self.client.getTestSuiteCustomFieldDesignValue(
                                                    'cf_full', 40000711, 40000713) 
            
    def test_getTestPlanCustomFieldDesignValue_unknownID(self):
        with self.assertRaisesRegex(TLResponseError, '7000.*40000711'):
            self.client.getTestPlanCustomFieldDesignValue(
                                                    'cf_full', 40000711, 40000712)             

    def test_getReqSpecCustomFieldDesignValue_unknownID(self):
        with self.assertRaisesRegex(TLResponseError, '7000.*40000711'):
            self.client.getReqSpecCustomFieldDesignValue(
                                                    'cf_full', 40000711, 4732)             

    def test_getRequirementCustomFieldDesignValue_unknownID(self):
        with self.assertRaisesRegex(TLResponseError, '7000.*40000711'):
            self.client.getRequirementCustomFieldDesignValue(
                                                    'cf_full', 40000711, 4734)  
            
    def test_assignTestCaseExecutionTask_unknownID(self):
        with self.assertRaisesRegex(TLResponseError, '3000.*40000711'):
            self.client.assignTestCaseExecutionTask('username', 40000711, 'TC-40000712', 
                                            buildname='build 40000713', 
                                            platformname='platform 40000714') 
              
    def test_getTestCaseBugs_unknownID(self):
        with self.assertRaisesRegex(TLResponseError, '3000.*40000711'):
            self.client.getTestCaseBugs(40000711, testcaseexternalid='TC-40000712', 
                                        buildname='build 40000713',
                                        platformname='platform 40000714')                         

    def test_getTestCaseAssignedTester_unknownID(self):
        with self.assertRaisesRegex(TLResponseError, '3000.*40000711'):
            self.client.getTestCaseAssignedTester(40000711, 'TC-40000712', 
                                            buildname='build 40000713', 
                                            platformname='platform 40000714') 
              
    def test_unassignTestCaseExecutionTask_unknownID(self):
        with self.assertRaisesRegex(TLResponseError, '3000.*40000711'):
            self.client.unassignTestCaseExecutionTask(40000711, 'TC-40000712', 
                                        buildname='build 40000713', 
                                        platformname='platform 40000714',
                                        user='username',action='unassignOne') 
    
    def test_getProjectKeywords_unknownID(self):
        with self.assertRaisesRegex(TLResponseError, '7000.*40000711'):
            self.client.getProjectKeywords(40000711) 
开发者ID:TommyXie1990,项目名称:TestLink-API-Python-client,代码行数:70,代码来源:testlinkapi_generic_online_test.py

示例3: TestLinkAPIOnlineTestCase

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

#.........这里部分代码省略.........
                ],
            )

    def test_getExecCountersByBuild_unknownID(self):
        with self.assertRaisesRegex(TLResponseError, "3000.*40000711"):
            self.client.getExecCountersByBuild(40000711)

    def test_getTestCaseCustomFieldExecutionValue_unknownID(self):
        with self.assertRaisesRegex(TLResponseError, "236.*version/executionid"):
            self.client.getTestCaseCustomFieldExecutionValue("cf_full", "40000711", 1, "715", "40000713")

    def test_getTestCaseCustomFieldTestPlanDesignValue_unknownID(self):
        with self.assertRaisesRegex(TLResponseError, "7000.*40000711"):
            self.client.getTestCaseCustomFieldTestPlanDesignValue("cf_full", "40000711", 1, "40000713", "615")

    def test_updateTestCaseCustomFieldDesignValue_unknownID(self):
        with self.assertRaisesRegex(TLResponseError, "7000.*40000711"):
            self.client.updateTestCaseCustomFieldDesignValue(
                "TC-40000712", 1, 40000711, {"cf_field1": "value1", "cf_field2": "value2"}
            )

    def test_getTestSuiteCustomFieldDesignValue_unknownID(self):
        with self.assertRaisesRegex(TLResponseError, "7000.*40000711"):
            self.client.getTestSuiteCustomFieldDesignValue("cf_full", 40000711, 40000713)

    def test_getTestPlanCustomFieldDesignValue_unknownID(self):
        with self.assertRaisesRegex(TLResponseError, "7000.*40000711"):
            self.client.getTestPlanCustomFieldDesignValue("cf_full", 40000711, 40000712)

    def test_getReqSpecCustomFieldDesignValue_unknownID(self):
        with self.assertRaisesRegex(TLResponseError, "7000.*40000711"):
            self.client.getReqSpecCustomFieldDesignValue("cf_full", 40000711, 4732)

    def test_getRequirementCustomFieldDesignValue_unknownID(self):
        with self.assertRaisesRegex(TLResponseError, "7000.*40000711"):
            self.client.getRequirementCustomFieldDesignValue("cf_full", 40000711, 4734)

    def test_assignTestCaseExecutionTask_unknownID(self):
        with self.assertRaisesRegex(TLResponseError, "3000.*40000711"):
            self.client.assignTestCaseExecutionTask(
                "username", 40000711, "TC-40000712", buildname="build 40000713", platformname="platform 40000714"
            )

    def test_getTestCaseBugs_unknownID(self):
        with self.assertRaisesRegex(TLResponseError, "3000.*40000711"):
            self.client.getTestCaseBugs(
                40000711, testcaseexternalid="TC-40000712", buildname="build 40000713", platformname="platform 40000714"
            )

    def test_getTestCaseAssignedTester_unknownID(self):
        with self.assertRaisesRegex(TLResponseError, "3000.*40000711"):
            self.client.getTestCaseAssignedTester(
                40000711, "TC-40000712", buildname="build 40000713", platformname="platform 40000714"
            )

    def test_unassignTestCaseExecutionTask_unknownID(self):
        with self.assertRaisesRegex(TLResponseError, "3000.*40000711"):
            self.client.unassignTestCaseExecutionTask(
                40000711,
                "TC-40000712",
                buildname="build 40000713",
                platformname="platform 40000714",
                user="username",
                action="unassignOne",
            )
开发者ID:dkentw,项目名称:TestLink-API-Python-client,代码行数:69,代码来源:testlinkapi_online_test.py


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