Module EDFactoryPluginTest :: Class EDFactoryPluginTest
[hide private]
[frames] | no frames]

Class EDFactoryPluginTest

source code

             object --+            
                      |            
      EDObject.EDObject --+        
                          |        
        EDLogging.EDLogging --+    
                              |    
EDFactoryPlugin.EDFactoryPlugin --+
                                  |
                                 EDFactoryPluginTest

This subclass of EDFactoryPlugin provides a factory for loading test cases for the EDNA testing framework. The function of EDFactoryPluginTest is very similar to EDFactoryPlugin, the main differences are that only files starting with "EDTest" are considered as test cases to be loaded, and that the "src" and "plugin" directories are added to the python path from two possible locations of the test case:

EDNA application, e.g. mxv1, or plugin collection e.g. mxExecPlugins:

|
|-datamodel
|-src
|-tests
|   |-data
|   |-testsuite
|   |    |- EDTestSuiteXXX.py
|
|-plugins
|   |-EDPlugin[name of plugin]-v1.0
|   |   |-plugins
|   |   |   |-EDPlugin[name of plugin]v10.py
|   |   |   |-EDPlugin[another name of plugin]v10.py
|   |   |-tests
|   |   |   |-data
|   |   |   |-testsuite
|   |   |   |    |-EDTestSuiteYYY.py

The "src" directory is searched relatively from both the EDTestSuiteXXX.py and EDTestSuiteYYY.py locations, i.e. "../../src" and "../../../../src".

The "plugins" directory is searched only from the EDTestSuiteYYY.py location, i.e. "../../plugins".

Instance Methods [hide private]
 
isPlugin(self, _strFileName)
For the testing framework, the plugins are test cases and test suites which starts with "EDTest" and ends with ".py".
source code
 
appendPath(self, _strPluginTestLocation)
For the tests, both the plugin directory and its corresponding "src" directory must be on the python path (see the class documentation for EDFactoryPluginTest).
source code

Inherited from EDFactoryPlugin.EDFactoryPlugin: __init__, addPluginRootDirectory, checkDirectoriesForIgnoreFile, getModuleLocation, getProjectName, getProjectRootDirectory, loadModule, loadModuleDictionaryFromDisk, loadPlugin, saveModuleDictionaryToDisk

Inherited from EDLogging.EDLogging: ASSERT, DEBUG, ERROR, WARNING, error, isVerboseDebug, log, screen, setAllLogLevels, setLogFileName, setLogFileOff, setLogLevel, setTestOff, setTestOn, setVerboseDebugOff, setVerboseDebugOn, setVerboseOff, setVerboseOn, unitTest, warning, writeErrorTrace

Inherited from EDObject.EDObject: getClassName, getId, getRunTime, getSemaphoreValue, getTimeEnd, getTimeInit, locked, setTimeEnd, setTimeInit, synchronizeOff, synchronizeOn

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Methods [hide private]

Inherited from EDFactoryPlugin.EDFactoryPlugin: getFactoryPlugin, preImport, unImport

Class Variables [hide private]

Inherited from EDFactoryPlugin.EDFactoryPlugin: IGNORE_FILE

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

isPlugin(self, _strFileName)

source code 

For the testing framework, the plugins are test cases and test suites which starts with "EDTest" and ends with ".py".

Parameters:
  • _strFileName (python string) - Name of the file
Returns:
True or False
Overrides: EDFactoryPlugin.EDFactoryPlugin.isPlugin

appendPath(self, _strPluginTestLocation)

source code 

For the tests, both the plugin directory and its corresponding "src" directory must be on the python path (see the class documentation for EDFactoryPluginTest). This method appends the plugin "src" directory to the system path, if it's not already present.

Parameters:
  • _strModuleLocation (python string) - Path to the module location
Overrides: EDFactoryPlugin.EDFactoryPlugin.appendPath