I am not what I am doing wrong...I have following code and sometime it work but most of the time its doesn't..
def _syncRequirements(self, test, reqId):
"""Synchronize the QC Test fields with the client test.
Parameters
test: OTA.COM.Test (the QC Test to be sync'd)
"""
print >>log, "updating requirement %s for %s" % (reqId, test.ID)
# Look for proper requirement....
try:
rFact = self.com.ReqFactory
req = rFact.Item(reqId)
print "Got req"
except Exception,ex:
raise ValueError("cannot find REQUIREMENT record '%s' in QC Requirements" % reqId)
return
# Get list of current requirements...
coverList = req.GetCoverageTestsByReqFilter("")
for coverageId in coverList:
if test.ID == coverageId.ID:
print "synctest: warning: requirement for %s in %s already exists" % (test.ID, reqId)
return
try:
if req:
req.AddCoverage(test.ID, -4)
#test.CoverRequirement(ReqList, 0))
#ReqList.AddTestToCoverage(test.ID)
time.sleep(1)
except Exception,ex:
print "ex : " + str(ex)
raise ValueError("synctest: Error in adding Coverage test %s to REQUIREMENT ID %s " % (test.ID, reqId))
req.Post
Thanks and Regards
Hemadri