raiseAssertionError('The standard output of the command "{}" does not include the following correct result:\n{}\cmd result in shell:\n{}'.format(''.join(cmd),real.stdout,std_stdout))
defget_cwd(self):
returnself.shell_ps.cwd()
# check standard error
ifstd_stderr:
raiseAssertionError('The standard error of the command "{}" shouldbe empty but contains:\n{}'.format(std_stderr))
raiseAssertionError('The standard output of the command "{}" does not include the following correct result:\n{}\cmd result in shell:\n{}'.format(''.join(cmd),real.stderr,std_stderr))
# TODO combine the two tests (the one below) in one fonction
shell_stdout=shell.read_stdout()
iftest_stdout=='include':
ifnotreal.stdoutinshell_stdout:
raiseAssertionError('The standard output of the command "{}" does not include the following correct result:\n{}\cmd result in shell:\n{}'.format(''.join(cmd),real.stdout,shell_stdout))
eliftest_stdout=='empty':
ifshell_stdout:
raiseAssertionError('The standard error of the command "{}" shouldbe empty but contains:\n{}'.format(shell_stderr))
# do not check if stdout is empty because it will contain return code...
# check standard output
shell_stderr=shell.read_stderr()
iftest_stderr=='include':
ifnotreal.stderrinshell_stderr:
raiseAssertionError('The standard output of the command "{}" does not include the following correct result:\n{}\cmd result in shell:\n{}'.format(''.join(cmd),real.stderr,shell_stderr))
eliftest_stdout=='empty':
ifshell_stderr:
raiseAssertionError('The standard error of the command "{}" shouldbe empty but contains:\n{}'.format(shell_stderr))