Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion leapp/libraries/stdlib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import os


def check_output(args, split=True):
def call(args, split=True):
"""
Call an external program, capture and automatically utf-8 decode its ouput.
Then, supress output to stderr and redirect to /dev/null.
Expand Down
10 changes: 5 additions & 5 deletions tests/scripts/test_stdlib.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
from leapp.libraries.stdlib import check_output
from leapp.libraries.stdlib import call


def test_check_single_line_output():
a_command = ['echo', 'This a single line test!']
assert check_output(a_command) == [u'This a single line test!']
assert call(a_command) == [u'This a single line test!']


def test_check_single_line_output_no_split():
a_command = ['echo', 'This a single line No Split test!']
assert check_output(a_command, split=False) == u'This a single line No Split test!\n'
assert call(a_command, split=False) == u'This a single line No Split test!\n'


def test_check_multiline_output():
a_command = ['echo', 'This a multi-\nline test!']
assert check_output(a_command) == [u'This a multi-', u'line test!']
assert call(a_command) == [u'This a multi-', u'line test!']


def test_check_multiline_output_no_split():
a_command = ['echo', 'This a multi-\nline No Split test!']
assert check_output(a_command, split=False) == u'This a multi-\nline No Split test!\n'
assert call(a_command, split=False) == u'This a multi-\nline No Split test!\n'