Search code examples
pythonhp-quality-center

Quality Center OTA API - TDFilter using Python


I have the following code in VB for the QC API to "Find tests that are not in any test set".... I just wish to know how I can write the same in Python? Especially, the line testSetFilder.Filter("CY_CYLE") = ">= 0"

VB Code

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

Thank you


Solution

  • Short answer is to use SetFilter()