Example #1
0
def test_args_str_default():
    assert argsCaller(do_something_default,
                      "a").args_str() == "<name> [<family> = Black]"
Example #2
0
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"
Example #3
0
def test_args_str_single():
    assert argsCaller(do_something, "a").args_str() == "<name>"
Example #4
0
def test_single_default_argument():
    assert argsCaller(do_something_default, "Joe").call() == "Joe Black"
Example #5
0
def test_missing_argument():
    with pytest.raises(MissingArgument) as pytest_wrapped_e:
        argsCaller(do_something)
    assert pytest_wrapped_e.value.argument_name == "name"
Example #6
0
def test_many_kwarguments():
    assert argsCaller(do_something, a=12, b=15, c=5).call() == "a12:b15:c5"
Example #7
0
def test_single_argument():
    assert argsCaller(do_something, "a").call() == "A"
Example #8
0
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"
Example #9
0
def test_single_kwargument():
    assert argsCaller(do_something, a=12).call() == "a12"
Example #10
0
def test_many_kwarguments():
    assert argsCaller(sum_int, *args).call() == 3
    assert argsCaller(sum_str, *args).call() == "12"
Example #11
0
def test_missing_argument():
    a_caller = argsCaller(do_something)
    assert (a_caller.call()) == ""
Example #12
0
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"
Example #13
0
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"
Example #14
0
def test_many_arguments():
    assert argsCaller(do_something, "a", "b", "c").call() == "a:b:c"
Example #15
0
def test_default_argument():
    assert argsCaller(do_something_default).call() == "JOE"
Example #16
0
def test_no_arguments():
    assert argsCaller(do_something).call() == "A"