Commit c0ac5f74 authored by Jérome Perrin's avatar Jérome Perrin

testERP5TestNode: undo patch in try/finally

otherwise it's not executed when test has an error.

We should consider using mock library here.
parent 38731317
...@@ -1126,29 +1126,31 @@ shared = true ...@@ -1126,29 +1126,31 @@ shared = true
RunnerClass.getDictionaryFromFile = patch_getDictionaryFromFile RunnerClass.getDictionaryFromFile = patch_getDictionaryFromFile
RunnerClass._createInstance = doNothing RunnerClass._createInstance = doNothing
RunnerClass._waitInstanceCreation = doNothing RunnerClass._waitInstanceCreation = doNothing
# Run try:
test_node = self.getTestNode() # Run
test_node.run() test_node = self.getTestNode()
# Restore methods test_node.run()
TaskDistributor.getSlaposAccountKey = original_getSlaposAccountKey finally:
TaskDistributor.getSlaposAccountCertificate = original_getSlaposAccountCertificate # Restore methods
TaskDistributor.getSlaposUrl = original_getSlaposUrl TaskDistributor.getSlaposAccountKey = original_getSlaposAccountKey
TaskDistributor.getSlaposHateoasUrl = original_getSlaposHateoasUrl TaskDistributor.getSlaposAccountCertificate = original_getSlaposAccountCertificate
TaskDistributor.generateConfiguration = original_generateConfiguration TaskDistributor.getSlaposUrl = original_getSlaposUrl
TaskDistributor.isMasterTestnode = original_isMasterTestnode TaskDistributor.getSlaposHateoasUrl = original_getSlaposHateoasUrl
TaskDistributor.startTestSuite = original_startTestSuite TaskDistributor.generateConfiguration = original_generateConfiguration
TaskDistributor.createTestResult = original_createTestResult TaskDistributor.isMasterTestnode = original_isMasterTestnode
TaskDistributor.subscribeNode = original_subscribeNode TaskDistributor.startTestSuite = original_startTestSuite
TaskDistributor.getTestType = original_getTestType TaskDistributor.createTestResult = original_createTestResult
RunnerClass._prepareSlapOS = original_prepareSlapOS TaskDistributor.subscribeNode = original_subscribeNode
RunnerClass.runTestSuite = original_runTestSuite TaskDistributor.getTestType = original_getTestType
SlapOSControler.supply = original_supply RunnerClass._prepareSlapOS = original_prepareSlapOS
SlapOSControler.request = original_request RunnerClass.runTestSuite = original_runTestSuite
SlapOSControler.updateInstanceXML = original_updateInstanceXML SlapOSControler.supply = original_supply
SlapOSMasterCommunicator.__init__ = original_SlapOSMasterCommunicator__init__ SlapOSControler.request = original_request
time.sleep =original_sleep SlapOSControler.updateInstanceXML = original_updateInstanceXML
RunnerClass.generateProfilePasswordAccess = original_generateProfilePasswordAccess SlapOSMasterCommunicator.__init__ = original_SlapOSMasterCommunicator__init__
RunnerClass.getDictionaryFromFile = original_getDictionaryFromFile time.sleep =original_sleep
RunnerClass.updateDictionaryFile = original_updateDictionaryFile RunnerClass.generateProfilePasswordAccess = original_generateProfilePasswordAccess
RunnerClass._createInstance = original__createInstance RunnerClass.getDictionaryFromFile = original_getDictionaryFromFile
RunnerClass._waitInstanceCreation = original__waitInstanceCreation RunnerClass.updateDictionaryFile = original_updateDictionaryFile
RunnerClass._createInstance = original__createInstance
RunnerClass._waitInstanceCreation = original__waitInstanceCreation
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment