Quality Center OTA API - 使用Python的TDFilter

时间:2012-05-09 17:22:00

标签: python hp-quality-center

我在VB中有以下代码用于QC API“查找不在任何测试集中的测试”....我只是想知道如何在Python中编写相同的代码?特别是,行testSetFilder.Filter("CY_CYLE") = ">= 0"

VB代码

Public Sub ListUnusedTests()
'Get the list of tests that are not in any test set

Dim testSetF As TestSetFactory
Dim testF As TestFactory
Dim testSetFilter As TDFilter
Dim TestFilter As TDFilter
Dim aTest As Test
Dim testL As List

Set testSetF = tdc.TestSetFactory
Set testSetFilter = testSetF.Filter
' Exclude the default test set.
testSetFilter.Filter("CY_CYCLE") = ">= 0"

Set testF = tdc.TestFactory
Set TestFilter = testF.Filter
TestFilter.SetXFilter "TEST-TESTSET", False, testSetFilter.Text
Set testL = testF.NewList(TestFilter.Text)

Dim Item
For Each Item In testL
    Debug.Print Item.Name
Next Item
End Sub

谢谢

1 个答案:

答案 0 :(得分:0)

简短回答是使用SetFilter()