def test_recursive_callable_partial_none(xonsh_execer, xonsh_builtins): ales = Aliases({"rtn": _return_to_sender_none, "rtn-recurse": ["rtn"]}) alias = ales.get("rtn-recurse") assert callable(alias) args, obs = alias() assert args == "wakka" assert len(obs) == 0
def test_recursive_callable_partial_none(xonsh_execer, xonsh_builtins): ales = Aliases({"rtn": _return_to_sender_none, "rtn-recurse": ["rtn"]}) alias = ales.get("rtn-recurse") assert callable(alias) args, obs = alias() assert args == "wakka" assert len(obs) == 0
def test_recursive_callable_partial_handles(xonsh_execer, xonsh_builtins): ales = Aliases({"rtn": _return_to_sender_handles, "rtn-recurse": ["rtn", "arg1"]}) alias = ales.get("rtn-recurse") assert callable(alias) args, obs = alias(["arg2"], stdin="a", stdout="b", stderr="c") assert args == ["arg1", "arg2"] assert len(obs) == 3 exp = {"stdin": "a", "stdout": "b", "stderr": "c"} assert obs == exp
def test_recursive_callable_partial_handles(xonsh_execer, xonsh_builtins): ales = Aliases({"rtn": _return_to_sender_handles, "rtn-recurse": ["rtn", "arg1"]}) alias = ales.get("rtn-recurse") assert callable(alias) args, obs = alias(["arg2"], stdin="a", stdout="b", stderr="c") assert args == ["arg1", "arg2"] assert len(obs) == 3 exp = {"stdin": "a", "stdout": "b", "stderr": "c"} assert obs == exp
def test_recursive_callable_partial_all(xonsh_builtins): ales = Aliases({ "rtn": _return_to_sender_all, "rtn-recurse": ["rtn", "arg1"] }) alias = ales.get("rtn-recurse") assert callable(alias) args, obs = alias(["arg2"], stdin="a", stdout="b", stderr="c", spec="d", stack="e") assert args == ["arg1", "arg2"] assert len(obs) == 5 exp = { "stdin": "a", "stdout": "b", "stderr": "c", "spec": "d", "stack": "e" } assert obs == exp