Package ZenUtils :: Module ZenDocTest :: Class ZenDocTestRunner
[hide private]
[frames] | no frames]

Class ZenDocTestRunner

source code

object --+
         |
        ZenDocTestRunner


Extracts doctests from the docstrings of a Zenoss module
and runs them in an environment similar to that of zendmd.

Example usage:
    zdtr = ZenDocTestRunner()
    zdtr.add_modules("Products.ZenModel.ZenModelBase")
    zdtr.run()



Instance Methods [hide private]
 
setUp(self) source code
 
tearDown(self) source code
 
login(self, name='admin', userfolder=None)
Logs in.
source code
 
logout(self) source code
 
doctest_setUp(self, testObject) source code
 
doctest_tearDown(self, testObject) source code
 
add_modules(self, mods)
Add Zenoss modules to be tested.
source code
 
get_suites(self)
Returns a doctest.DocTestSuite for each module in self.modules.
source code
 
run(self)
Run the doctests found in the modules added to this instance.
source code

Inherited from object: __delattr__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Class Variables [hide private]
  modules = []
  conn = None
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

add_modules(self, mods)

source code 
Add Zenoss modules to be tested.
Parameters:
  • mods (module or list) - One or more module objects or dotted names.

get_suites(self)

source code 

Returns a doctest.DocTestSuite for each module in self.modules.

Provided for integration with existing unittest framework.

run(self)

source code 

Run the doctests found in the modules added to this instance.

This method sets up the zendmd global variables, creates a test suite for each module that has been added, and runs all suites.