Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Info
titleAbout the example on this page

The examples on this pages are written in Python for simplicity.

Code Block
languagepy
titleExample of initialization
import xmlrpclib
 
_host = "http://localhost:8080"
proxy = xmlrpclib.ServerProxy(_host + "/rpc/xmlrpc?handler=greenpepper1")
gp = proxy.greenpepper1
Table of Content Zone

 

Table of Contents

...

Code Block
languagepy
titleExample usage
specRepo = cf._greenpeppergp.getAllSpecificationRepositories()[6];
sut = cfgp._greenpepper.getSystemUnderTestsOfProject('GREENPEPPERDEMO')[4];
doctree = cf._greenpeppergp.getSpecificationHierarchy(specRepo, sut);
 
# How do we visit this result ?
def visit(node):
    yield node[0],node[1]
    for child in node[3].values():
        for name, executable in visit(child):
            yield name, executable
 
i=0
for pageName, executable in visit(doctree):
    # I want only the executable ones
    if executable == True:
        i+=1
        print "[%s][%s] %s "% (i,executable,pageName)

...