コード例 #1
0
 def testStaticEDConfiguration(self):
     # This test make sure that changing an instatiation of EDConfiguration does not change the
     # corresponding plugin configuration for EDConfigurationStatic
     strPathToTestConfigFile = os.path.join(self.strDataPath, "XSConfiguration_testNonStatic.xml")
     edConfiguration = EDConfiguration(strPathToTestConfigFile)
     strParam1 = edConfiguration.getStringValue("EDPluginTestPluginFactory", "testItemName")
     EDUtilsPath.setEdnaSite("TestStaticConfiguration") 
     strParam2 = EDConfigurationStatic.getStringValue("EDPluginTestPluginFactory", "testItemName")
     EDAssert.equal(False, strParam1 == strParam2, "Static config is not equal to local config")
コード例 #2
0
 def testGetPathToProjectConfigurationFile(self):
     edConfiguration = EDConfiguration()
     strPathToConfigurationFile1 = edConfiguration.getPathToProjectConfigurationFile("EDPluginTestPluginFactory")
     strPathToConfigurationFileReference1 = EDUtilsPath.appendListOfPaths(EDUtilsPath.getEdnaHome(),
                                                                               [ "kernel", "tests", "data", "EDFactoryPlugin", \
                                                                                "testProject", "conf", "XSConfiguration_TestSite.xml" ])
     EDAssert.equal(strPathToConfigurationFileReference1, strPathToConfigurationFile1)
     EDUtilsPath.setEdnaSite("NonexistingTestSite")
     strPathToConfigurationFile2 = edConfiguration.getPathToProjectConfigurationFile("EDPluginTestPluginFactory")
     strPathToConfigurationFileReference2 = None
     EDAssert.equal(strPathToConfigurationFileReference2, strPathToConfigurationFile2)
コード例 #3
0
 def testStaticEDConfiguration(self):
     # This test make sure that changing an instatiation of EDConfiguration does not change the
     # corresponding plugin configuration for EDConfigurationStatic
     strPathToTestConfigFile = os.path.join(
         self.strDataPath, "XSConfiguration_testNonStatic.xml")
     edConfiguration = EDConfiguration(strPathToTestConfigFile)
     strParam1 = edConfiguration.getStringValue("EDPluginTestPluginFactory",
                                                "testItemName")
     EDUtilsPath.setEdnaSite("TestStaticConfiguration")
     strParam2 = EDConfigurationStatic.getStringValue(
         "EDPluginTestPluginFactory", "testItemName")
     EDAssert.equal(False, strParam1 == strParam2,
                    "Static config is not equal to local config")
コード例 #4
0
 def testGetPathToProjectConfigurationFile(self):
     edConfiguration = EDConfiguration()
     strPathToConfigurationFile1 = edConfiguration.getPathToProjectConfigurationFile(
         "EDPluginTestPluginFactory")
     strPathToConfigurationFileReference1 = EDUtilsPath.appendListOfPaths(EDUtilsPath.getEdnaHome(),
                                                                               [ "kernel", "tests", "data", "EDFactoryPlugin", \
                                                                                "testProject", "conf", "XSConfiguration_TestSite.xml" ])
     EDAssert.equal(strPathToConfigurationFileReference1,
                    strPathToConfigurationFile1)
     EDUtilsPath.setEdnaSite("NonexistingTestSite")
     strPathToConfigurationFile2 = edConfiguration.getPathToProjectConfigurationFile(
         "EDPluginTestPluginFactory")
     strPathToConfigurationFileReference2 = None
     EDAssert.equal(strPathToConfigurationFileReference2,
                    strPathToConfigurationFile2)
コード例 #5
0
 def testGetPathToProjectConfigurationFile(self):
     EDUtilsPath.setEdnaSite("TestSite")
     edFactoryPlugin = EDFactoryPlugin()
     strPathToConfigurationFile1 = edFactoryPlugin.getPathToProjectConfigurationFile("EDPluginTestPluginFactory")
     strPathToConfigurationFileReference1 = EDUtilsPath.appendListOfPaths(EDUtilsPath.getEdnaHome(),
                                                                               [ "edna-kernel", "tests", "data", "EDFactoryPlugin", \
                                                                                "testProject", "conf", "XSConfiguration_TestSite.xml" ])
     EDAssert.equal(strPathToConfigurationFileReference1, strPathToConfigurationFile1)
     EDUtilsPath.setEdnaSite("NonexistingTestSite")
     strPathToConfigurationFile2 = edFactoryPlugin.getPathToProjectConfigurationFile("EDPluginTestPluginFactory")
     strPathToConfigurationFileReference2 = None
     EDAssert.equal(strPathToConfigurationFileReference2, strPathToConfigurationFile2)
     # Since this is a static variable we need to reset it to None in order not to break any other tests...
     EDUtilsPath.setEdnaSite(None)
コード例 #6
0
 def preProcess(self):
     """Set EDNA_SITE to TestSite for these tests"""
     EDUtilsPath.setEdnaSite("TestSite")
コード例 #7
0
 def finallyProcess(self):
     """Restores EDNA_SITE"""
     EDUtilsPath.setEdnaSite(self.strEdnaSiteOrig)
コード例 #8
0
 def finallyProcess(self):
     """Restores EDNA_SITE"""
     EDUtilsPath.setEdnaSite(self.strEdnaSiteOrig)
コード例 #9
0
 def preProcess(self):
     """Set EDNA_SITE to TestSite for these tests"""
     EDUtilsPath.setEdnaSite("TestSite")