command = shutil.which('true')
operation = commandline.cli(command=[command], shell=False)
- # Note: 'stdout' and 'stderr' not mapped.
# Note: getitem not implemented.
- # assert not 'stdout' in operation.output
- # assert not 'stderr' in operation.output
- assert not hasattr(operation.output, 'stdout')
- assert not hasattr(operation.output, 'stderr')
-
- # Check for the attributes that we _do_ expect.
- assert hasattr(operation.output, 'erroroutput')
+ # assert 'stdout' in operation.output
+ # assert 'stderr' in operation.output
+ assert hasattr(operation.output, 'stdout')
+ assert hasattr(operation.output, 'stderr')
+ assert not hasattr(operation.output, 'erroroutput')
assert hasattr(operation.output, 'returncode')
operation.run()
def test_true(self):
operation = commandline.commandline_operation(executable='true')
- # Note: 'stdout' and 'stderr' not mapped.
# Note: getitem not implemented.
- # assert not 'stdout' in operation.output
- # assert not 'stderr' in operation.output
- assert not hasattr(operation.output, 'stdout')
- assert not hasattr(operation.output, 'stderr')
+ # assert 'stdout' in operation.output
+ # assert 'stderr' in operation.output
+ assert not hasattr(operation.output, 'erroroutput')
assert hasattr(operation.output, 'file')
- assert hasattr(operation.output, 'erroroutput')
+ assert hasattr(operation.output, 'stdout')
+ assert hasattr(operation.output, 'stderr')
assert hasattr(operation.output, 'returncode')
assert operation.output.returncode.result() == 0