Modify

Opened 9 months ago

Closed 9 months ago

#11462 closed enhancement (fixed)

List "Root Catalogs"

Reported by: anonymous Owned by: seccanj
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 9 months ago by anonymous

  • Type changed from defect to enhancement

comment:2 Changed 9 months ago by seccanj

  • Resolution set to fixed
  • Status changed from new to closed

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

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.