示例#1
0
def test_return_none():
    commands = [{}, 'execute_module_function', 'os.path.isfile',
                    ('/nonexistent/nonexistent.txt', ), {}, {'return_none': True}]
    executor = Executor(commands)
    results = list(executor.execute())
    assert len(results) == 1
    assert results[0] == {'return': None}  # None!
示例#2
0
def test_execute_module_function():
    commands = [{}] + exec_path_join_mod  # [{}] is a header
    executor = Executor(commands)
    results = list(executor.execute())
    assert len(results) == 1
    assert results[0] == {'return': '/foo/bar/baz'}