Modify

Opened 11 years ago

Closed 11 years ago

#11462 closed enhancement (fixed)

List "Root Catalogs"

Reported by: anonymous Owned by: Roberto Longobardi
Priority: normal Component: TestManagerForTracPlugin
Severity: normal Keywords:
Cc: Trac Release:

Description

The listSubCatalogs XMLRPC (at least) does not allow listing the root Catalogs, because one need to already specify a known id and this already restricts listing to the subcatalogs of a root catalog.

Since Ids grow from 0 upwards, -1 could be used as an indicator that listSubCatalogs must list the root catalogs.

The following 3 lines in TestCatalog.init do the trick

 if id == '-1':
            self.exists = True
            self.values['page_name'] = 'TC'

listSubCatalogs can then be called as follows:

for v in server.testmanager.listSubCatalogs('-1'):
    print v

And the root catalogs will be returned (in my case):

['3', 'TC_TT3', 'catalog1', '\n']
['4', 'TC_TT4', 'catalog2', '\n']

Attachments (0)

Change History (2)

comment:1 Changed 11 years ago by anonymous

Type: defectenhancement

comment:2 Changed 11 years ago by Roberto Longobardi

Resolution: fixed
Status: newclosed

I have added a listRootCatalogs function to the RPC API.

This seems to me a cleaner solution than using '-1' as the catalog ID. Also, I didn't want to set "self.exists = True" to the "TC" vistual catalog, as this may have unpredictable results.

Please, take a look at the updated rpc_example.py file for an example usage of this new function.

Released with 1.8.1: https://sourceforge.net/projects/testman4trac/files

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Roberto Longobardi.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.