Changes between Version 8 and Version 9 of TestManagerForTracPluginRPCApi
- Timestamp:
- Jan 20, 2011, 7:27:01 PM (13 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TestManagerForTracPluginRPCApi
v8 v9 103 103 {{{ 104 104 import xmlrpclib 105 105 106 # Remember to change the following URL with your information!!! 107 106 108 server = xmlrpclib.ServerProxy("http://user@yourserver:port/yourproject/rpc") 109 107 110 108 111 print ">> Creating test catalog" … … 174 177 175 178 # Recursive function to print a whole sub-catalog and its contained test cases 176 def printSubCatalog(cat_id): 179 def printSubCatalog(cat_id, indent): 180 tcat = server.testmanager.getTestCatalog(cat_id) 181 182 indent_blanks = '' 183 for i in range(indent): 184 indent_blanks += ' ' 185 186 print indent_blanks + tcat[1] 187 177 188 for subc in server.testmanager.listSubCatalogs(cat_id): 178 189 subc_id = subc[0] 179 print subc[2] 180 printSubCatalog(subc_id) 190 printSubCatalog(subc_id, indent + 1) 181 191 182 192 for tc in server.testmanager.listTestCases(cat_id): 183 print tc[2] 193 tc_title = tc[2] 194 print indent_blanks + ' ' + tc_title 184 195 185 196 # Recursive function to print a whole sub-catalog and its contained test cases with status 186 197 def printSubPlan(cat_id, plan_id, indent): 187 198 tcat = server.testmanager.getTestCatalog(cat_id) 188 print str([' ' for i in range(indent)]) + tcat[1] 199 200 indent_blanks = '' 201 for i in range(indent): 202 indent_blanks += ' ' 203 204 print indent_blanks + tcat[1] 189 205 190 206 for subc in server.testmanager.listSubCatalogs(cat_id): … … 197 213 tc = server.testmanager.getTestCase(tc_id) 198 214 tc_title = tc[1] 199 print str([' ' for i in range(indent)])+ tc_title + ": "+tc_status215 print indent_blanks + ' ' + tc_title + ": "+tc_status 200 216 201 217 # Entry point to print a whole test plan and its contained test cases with status … … 211 227 212 228 print ">> Printing complete test catalog tree" 213 printSubCatalog(root_cat )229 printSubCatalog(root_cat, 0) 214 230 215 231 print ">> Printing complete test plan tree" … … 230 246 print v 231 247 248 print ">> Printing again complete test plan tree, showing modified test case status" 249 printPlan(root_cat, tplan) 250 232 251 }}}