Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
common_helper_process
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fact-gitdep
common_helper_process
Commits
8f8011d8
Commit
8f8011d8
authored
May 28, 2019
by
Jörg Stucke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added test for new parameter
parent
2db6987c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
test_fail_safe_subprocess.py
test/test_fail_safe_subprocess.py
+7
-0
No files found.
test/test_fail_safe_subprocess.py
View file @
8f8011d8
import
os
import
os
import
unittest
import
unittest
from
subprocess
import
CalledProcessError
from
time
import
time
from
time
import
time
from
common_helper_files
import
get_dir_of_file
from
common_helper_files
import
get_dir_of_file
...
@@ -30,6 +31,12 @@ class TestProcessHelperPublic(unittest.TestCase):
...
@@ -30,6 +31,12 @@ class TestProcessHelperPublic(unittest.TestCase):
self
.
assertEqual
(
output
,
'test 123
\n
'
,
'result not correct'
)
self
.
assertEqual
(
output
,
'test 123
\n
'
,
'result not correct'
)
self
.
assertEqual
(
rc
,
2
,
'return code not correct'
)
self
.
assertEqual
(
rc
,
2
,
'return code not correct'
)
def
test_execute_shell_command_with_check
(
self
):
with
self
.
assertRaises
(
CalledProcessError
):
execute_shell_command
(
"exit 1"
,
check
=
True
)
with
self
.
assertRaises
(
CalledProcessError
):
execute_shell_command
(
"exit 255"
,
check
=
True
)
def
test_execute_shell_command_time_out
(
self
):
def
test_execute_shell_command_time_out
(
self
):
start_time
=
time
()
start_time
=
time
()
output
,
rc
=
execute_shell_command_get_return_code
(
'echo
\'
test 123
\'
&& for i in {1..10}; do sleep 1; done'
,
timeout
=
1
)
output
,
rc
=
execute_shell_command_get_return_code
(
'echo
\'
test 123
\'
&& for i in {1..10}; do sleep 1; done'
,
timeout
=
1
)
...
...
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