Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alexander Emmerich
erp5
Commits
0209142c
Commit
0209142c
authored
Jun 05, 2013
by
Benjamin Blanc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update patching method in order to work with runners. Tests passed.
parent
f8337edd
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
19 deletions
+26
-19
erp5/tests/testERP5TestNode.py
erp5/tests/testERP5TestNode.py
+26
-19
No files found.
erp5/tests/testERP5TestNode.py
View file @
0209142c
...
...
@@ -498,29 +498,32 @@ branch = foo
original_sleep
=
time
.
sleep
time
.
sleep
=
doNothing
self
.
generateTestRepositoryList
()
# Patch
original_startTestSuite
=
TaskDistributor
.
startTestSuite
TaskDistributor
.
startTestSuite
=
patch_startTestSuite
original_createTestResult
=
TaskDistributionTool
.
createTestResult
TaskDistributionTool
.
createTestResult
=
patch_createTestResult
test_node
=
self
.
getTestNode
()
# TestNode
test_node
=
self
.
getTestNode
()
runner
=
UnitTestRunner
(
test_node
)
original_prepareSlapOS
=
runner
.
_prepareSlapOS
runner
.
_prepareSlapOS
=
doNothing
# Modify class UnitTestRunner(or more after) method
original_prepareSlapOS
=
UnitTestRunner
.
_prepareSlapOS
original_runTestSuite
=
UnitTestRunner
.
runTestSuite
UnitTestRunner
.
_prepareSlapOS
=
doNothing
UnitTestRunner
.
runTestSuite
=
doNothing
original_runTestSuite
=
runner
.
runTestSuite
runner
.
runTestSuite
=
doNothing
SlapOSControler
.
initializeSlapOSControler
=
doNothing
runner
.
testnode
.
run
()
# Inside test_node a runner is created using new UnitTestRunner methods
test_node
.
run
()
self
.
assertEquals
(
5
,
counter
)
time
.
sleep
=
original_sleep
# Restore old class methods
TaskDistributor
.
startTestSuite
=
original_startTestSuite
TaskDistributionTool
.
createTestResult
=
original_createTestResult
r
unner
.
_prepareSlapOS
=
original_prepareSlapOS
r
unner
.
runTestSuite
=
original_runTestSuite
UnitTestR
unner
.
_prepareSlapOS
=
original_prepareSlapOS
UnitTestR
unner
.
runTestSuite
=
original_runTestSuite
def
test_12_spawn
(
self
):
def
_checkCorrectStatus
(
expected_status
,
*
args
):
...
...
@@ -611,20 +614,24 @@ branch = foo
original_createTestResult
=
TaskDistributionTool
.
createTestResult
TaskDistributionTool
.
createTestResult
=
patch_createTestResult
test_node
=
self
.
getTestNode
()
runner
=
UnitTestRunner
(
test_node
)
original_prepareSlapOS
=
r
unner
.
_prepareSlapOS
r
unner
.
_prepareSlapOS
=
doNothing
original_runTestSuite
=
r
unner
.
runTestSuite
r
unner
.
runTestSuite
=
doNothing
# Change UnitTestRunner class methods
original_prepareSlapOS
=
UnitTestR
unner
.
_prepareSlapOS
UnitTestR
unner
.
_prepareSlapOS
=
doNothing
original_runTestSuite
=
UnitTestR
unner
.
runTestSuite
UnitTestR
unner
.
runTestSuite
=
doNothing
SlapOSControler
.
initializeSlapOSControler
=
doNothing
runner
.
testnode
.
run
()
test_node
.
run
()
self
.
assertEquals
(
counter
,
3
)
checkTestSuite
(
test_node
)
time
.
sleep
=
original_sleep
# Restore old class methods
TaskDistributor
.
startTestSuite
=
original_startTestSuite
TaskDistributionTool
.
createTestResult
=
original_createTestResult
r
unner
.
_prepareSlapOS
=
original_prepareSlapOS
r
unner
.
runTestSuite
=
original_runTestSuite
UnitTestR
unner
.
_prepareSlapOS
=
original_prepareSlapOS
UnitTestR
unner
.
runTestSuite
=
original_runTestSuite
def
test_16_cleanupLogDirectory
(
self
):
# Make sure that we are able to cleanup old log folders
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment