Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(2)  |  Call(0)  |  Derive(0)  |  Import(2)
decorator for test functions that call Process.run() 

        def process_fails(exit_code, str_to_search=""):
    """ decorator for test functions that call Process.run() """
    def decorator(func):
        @functools.wraps(func)
        def wrapped():
            try:
                func()
                assert False, "SubprocessExecutionException expected, but not raised!"
            except SubprocessExecutionException as e:
                assert exit_code == e.proc.exit_code, 'Wrong exit code. expected: %s, actual: %s' % (exit_code, e.proc.exit_code)
                assert str_to_search in e.proc.stderr.get_string(), 'string "%s" was not found.' % str_to_search
        return wrapped
    return decorator
        


src/s/b/sbgsdk-0.5.4/sbgsdk/tests/cli_test/job_submit/test_job_submit.py   sbgsdk(Download)
import os
import json
 
from sbgsdk import errors
from sbgsdk.process import process_fails

src/s/b/sbgsdk-0.5.4/sbgsdk/tests/cli_test/execute_single/test_execute_single.py   sbgsdk(Download)
import os
import json
 
from sbgsdk import errors
from sbgsdk.process import process_fails