Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.toolbox
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
Lu Xu
slapos.toolbox
Commits
4589806c
Commit
4589806c
authored
Aug 12, 2016
by
Nicolas Wavrant
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test / runner: the open function shouldn't always be mocked
parent
f6b529a1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
slapos/test/test_runner.py
slapos/test/test_runner.py
+2
-1
No files found.
slapos/test/test_runner.py
View file @
4589806c
...
@@ -17,7 +17,7 @@ class TestRunnerBackEnd(unittest.TestCase):
...
@@ -17,7 +17,7 @@ class TestRunnerBackEnd(unittest.TestCase):
def
setUp
(
self
):
def
setUp
(
self
):
self
.
sup_process
=
runner_utils
.
sup_process
self
.
sup_process
=
runner_utils
.
sup_process
self
.
sup_process
.
reset_mock
()
self
.
sup_process
.
reset_mock
()
runner_utils
.
open
=
mock
.
mock_open
()
runner_utils
.
open
=
open
def
tearDown
(
self
):
def
tearDown
(
self
):
htpasswd_file
=
os
.
path
.
join
(
*
(
os
.
getcwd
(),
'.htpasswd'
))
htpasswd_file
=
os
.
path
.
join
(
*
(
os
.
getcwd
(),
'.htpasswd'
))
...
@@ -154,6 +154,7 @@ class TestRunnerBackEnd(unittest.TestCase):
...
@@ -154,6 +154,7 @@ class TestRunnerBackEnd(unittest.TestCase):
# If projectpath exist, .project file should be overwritten
# If projectpath exist, .project file should be overwritten
mock_path_exists
.
return_value
=
True
mock_path_exists
.
return_value
=
True
runner_utils
.
open
=
mock
.
mock_open
()
result
=
runner_utils
.
configNewSR
(
config
,
projectpath
)
result
=
runner_utils
.
configNewSR
(
config
,
projectpath
)
self
.
assertTrue
(
result
)
self
.
assertTrue
(
result
)
runner_utils
.
open
.
assert_has_calls
([
mock
.
call
().
write
(
projectpath
)])
runner_utils
.
open
.
assert_has_calls
([
mock
.
call
().
write
(
projectpath
)])
...
...
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