-4

I have a problem with dumping testsets list from HP QC. I'm using TestSetFactory object and simple SQL query and I receive > object (I'd love to receive dictionary filled base dump. What is wrong with this code? If you have a questions about implementation some function, write.

 def create(self):
        self._report_connector.connect()
        self.qc_test_set_factory = self._report_connector._get_factory(self._path)
        test_sets = self.qc_test_set_factory.NewList("SELECT * FROM CYCLE ")
        if test_sets == None:
            print " no results"
        for test in test_sets:
            pprint.pprint(test)    #<---- it print me <COMOBject <unknow>>
            print len(test_sets)   #<---- it print me 1
Ashoka Lella
  • 6,631
  • 1
  • 30
  • 39
Pawel
  • 11
  • 1
  • It's not clear what you're trying to do here. What is the `create` function trying to do - ie: what is it creating? Also, what do you expect the size of the list to be, is 1 incorrect? – munk Aug 07 '14 at 14:12
  • Thanks for interest! Task of create function is creating dictionary, which contain records from quality centre database. It is impossible, that their length is 1. basically I want create XML with all records from db. _report_connector is dispatched TDConnector from HP API, qc_test_set_factory is TestSetFactory (I want use it to stretch records from db) and test_sets is dictionary which has stucture as like database's table. – Pawel Aug 07 '14 at 14:32
  • It's not impossible that the length is 1. You've shown by printing len(test_sets) that it is 1. What is the result of `type(test_sets)`? – munk Aug 07 '14 at 14:49
  • The result of type function is " – Pawel Aug 08 '14 at 06:38
  • You should post your solution so others can avoid similar problems. – munk Aug 08 '14 at 11:32

1 Answers1

0

Not certain about the accuracy of the rest of the code, but you do not pass a SQL query to the TestSetFactory.NewList method. If you want everything, pass an empty string.

test_sets = self.qc_test_set_factory.NewList("")
HgCoder
  • 1,243
  • 9
  • 14