def test_source_acquired(): """Test that a single shell command is executed. This will acquire a source that installs flake8-diff as part of it's acquisition instructions, and then verify that flake8-diff is installed in the task itself. """ actions = [ TaskAction( 'shell_command', name= 'installer', # workspace= 'python3', # workspace_kwargs= { # "delete": False # }, commands= [ 'pip freeze |grep flake8-diff', ] ), ] source = DummySource() executor = Pipeline(source, actions) result = executor.schedule().get() assert result.results['installer'].returncode == 0
def test_shell_command_exit(): """Test that a single shell command functions properly """ actions = [ TaskAction( 'shell_command', name= 'exiter', commands= [ 'exit 1', ] ), ] source = DummySource() executor = Pipeline(source, actions) result = executor.schedule().get() assert result.results['exiter'].returncode == 1