Module EDTestCaseEDFactoryPlugin
[hide private]
[frames] | no frames]

Source Code for Module EDTestCaseEDFactoryPlugin

  1  # 
  2  #    Project: The EDNA Kernel 
  3  #             http://www.edna-site.org 
  4  # 
  5  #    File: "$Id$" 
  6  # 
  7  #    Copyright (C) 2008-2009 European Synchrotron Radiation Facility 
  8  #                            Grenoble, France 
  9  # 
 10  #    Principal authors: Marie-Francoise Incardona (incardon@esrf.fr) 
 11  #                       Olof Svensson (svensson@esrf.fr)  
 12  # 
 13  #    This program is free software: you can redistribute it and/or modify 
 14  #    it under the terms of the GNU Lesser General Public License as published 
 15  #    by the Free Software Foundation, either version 3 of the License, or 
 16  #    (at your option) any later version. 
 17  # 
 18  #    This program is distributed in the hope that it will be useful, 
 19  #    but WITHOUT ANY WARRANTY; without even the implied warranty of 
 20  #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
 21  #    GNU Lesser General Public License for more details. 
 22  # 
 23  #    You should have received a copy of the GNU General Public License 
 24  #    and the GNU Lesser General Public License  along with this program.   
 25  #    If not, see <http://www.gnu.org/licenses/>. 
 26  # 
 27   
 28  __authors__ = [ "Marie-Francoise Incardona", "Olof Svensson" ] 
 29  __contact__ = "svensson@esrf.fr" 
 30  __license__ = "LGPLv3+" 
 31  __copyright__ = "European Synchrotron Radiation Facility, Grenoble, France" 
 32   
 33  from EDTestCase import EDTestCase 
 34  from EDAssert import EDAssert 
 35  from EDFactoryPlugin import EDFactoryPlugin 
 36  from EDUtilsPath import EDUtilsPath 
 37   
38 -class EDTestCaseEDFactoryPlugin(EDTestCase):
39 40
41 - def __init__(self, _strTestName=None):
42 EDTestCase.__init__(self, _strTestName) 43 self.__edConfiguration = None
44 45
47 edFactoryPlugin = EDFactoryPlugin() 48 strEdnaHome = EDUtilsPath.getEdnaHome() 49 strTestProjectRootDirectoryReference = EDUtilsPath.appendListOfPaths(strEdnaHome, [ "kernel", "tests", "data", "EDFactoryPlugin", "testProject" ]) 50 strTestProjectRootDirectory1 = edFactoryPlugin.getProjectRootDirectory("EDPluginTestPluginFactory") 51 EDAssert.equal(strTestProjectRootDirectoryReference, strTestProjectRootDirectory1) 52 strTestProjectRootDirectory2 = edFactoryPlugin.getProjectRootDirectory("XSDataTestProject") 53 EDAssert.equal(strTestProjectRootDirectoryReference, strTestProjectRootDirectory2) 54 strTestProjectRootDirectory3 = edFactoryPlugin.getProjectRootDirectory("PluginThatNotExists") 55 EDAssert.equal(None, strTestProjectRootDirectory3)
56 57
58 - def testGetProjectName(self):
59 edFactoryPlugin = EDFactoryPlugin() 60 strProjectName = edFactoryPlugin.getProjectName("EDPluginTestPluginFactory") 61 EDAssert.equal("testProject", strProjectName)
62 63
64 - def testLoadPlugin(self):
65 edFactoryPlugin = EDFactoryPlugin() 66 edPluginTest = edFactoryPlugin.loadPlugin("EDPluginTestPluginFactory") 67 EDAssert.equal("TestReturnValue", edPluginTest.getTestValue())
68 69
71 edFactoryPlugin = EDFactoryPlugin() 72 edPluginTest = edFactoryPlugin.loadPlugin("EDPluginTestPluginFactory") 73 edFactoryPlugin.saveModuleDictionaryToDisk("testDictionary.xml")
74 75 76 80 81 82 83 84 85
86 - def process(self):
94 95 96 97 98 if __name__ == '__main__': 99 100 edTestCaseEDFactoryPlugin = EDTestCaseEDFactoryPlugin("EDTestCaseEDFactoryPlugin") 101 edTestCaseEDFactoryPlugin.execute() 102