fandango.test.testmodule module

class fandango.test.testmodule.TestModule(module, tests={})[source]

Bases: fandango.objects.Object

The TestModule allows generic testing of modules and classes.

Specific tests will be setup using the __test__ dictionary declared on each module.

on __init__.py : __test__ = [‘submodule’,’submodule2’] on submodule.py :

__test__ = {‘method1’:[result,callable,callable],’method2’:[result,args,kwargs]} __test__[‘kmap’] = [

{‘args’:[str.lower,’BCA’,’YZX’,False], ‘result’:[(‘A’, ‘x’), (‘B’, ‘y’), (‘C’, ‘z’)]} ]

aliases = {‘hdb’:’PyTangoArchiving.ArchivingAPI’} tests = {} tests[‘module.class.method’] = [

(args,kwargs,result or None), (args,kwargs,result or None), ...]

tests[‘PyTangoArchiving.ArchivingAPI’] = [(None,[‘hdb’],{‘load’:False})]}

tc = TestModule(‘PyTangoArchiving’,tests) tc.test()

get_all_callables(module=None)[source]
get_module_callables(module)[source]
get_submodules(module=None, nr=0)[source]
static is_local(obj, module)[source]
static is_module(module)[source]
static load_module(module)[source]
load_object(obj)[source]
test(tests=[])[source]

Tests would be a list of (name,result,args,kwargs) values

test_all(module=None)[source]
test_object(obj, result=None, *args, **kwargs)[source]
class fandango.test.testmodule.TestModuleSet(module, include=[], exclude=[])[source]

Bases: fandango.test.testmodule.TestModule

Class that allows filtered testing on python Modules

get_module_callables(module=None)[source]
get_submodules(module=None, nr=0)[source]
fandango.test.testmodule.main(args)[source]