def test_args_str_default(): assert argsCaller(do_something_default, "a").args_str() == "<name> [<family> = Black]"
def test_too_many_arguments(): with pytest.raises(TooManyArgument) as pytest_wrapped_e: argsCaller(do_something, "a", "b") assert pytest_wrapped_e.value.argument_value == "b"
def test_args_str_single(): assert argsCaller(do_something, "a").args_str() == "<name>"
def test_single_default_argument(): assert argsCaller(do_something_default, "Joe").call() == "Joe Black"
def test_missing_argument(): with pytest.raises(MissingArgument) as pytest_wrapped_e: argsCaller(do_something) assert pytest_wrapped_e.value.argument_name == "name"
def test_many_kwarguments(): assert argsCaller(do_something, a=12, b=15, c=5).call() == "a12:b15:c5"
def test_single_argument(): assert argsCaller(do_something, "a").call() == "A"
def test_single_argument(): with pytest.raises(TooManyArgument) as pytest_wrapped_e: assert argsCaller(do_something, "a") assert pytest_wrapped_e.value.argument_value == "a"
def test_single_kwargument(): assert argsCaller(do_something, a=12).call() == "a12"
def test_many_kwarguments(): assert argsCaller(sum_int, *args).call() == 3 assert argsCaller(sum_str, *args).call() == "12"
def test_missing_argument(): a_caller = argsCaller(do_something) assert (a_caller.call()) == ""
def test_unsupported_keyword(): with pytest.raises(UnsupportedKeyArgument) as pytest_wrapped_e: argsCaller(do_something, name="Joe", color="red") assert pytest_wrapped_e.value.argument_name == "color"
def test_keyword_arguments(): with pytest.raises(UnsupportedKeyArgument) as pytest_wrapped_e: argsCaller(do_something, name="Joe") assert pytest_wrapped_e.value.argument_name == "name"
def test_many_arguments(): assert argsCaller(do_something, "a", "b", "c").call() == "a:b:c"
def test_default_argument(): assert argsCaller(do_something_default).call() == "JOE"
def test_no_arguments(): assert argsCaller(do_something).call() == "A"