Exemple #1
0
def test_accepts_returns_true_if_arguments_match_those_set_by_with_args():
    call = Call('save')
    call.with_args(1, 2, name="Bob")
    assert not call.accepts((), {}, [])
    assert not call.accepts((1, 2, 3), {"name": "Bob"}, [])
    assert not call.accepts((1, ), {"name": "Bob"}, [])
    assert call.accepts((1, 2), {"name": "Bob"}, [])
Exemple #2
0
def test_error_is_raised_if_called_with_wrong_arguments():
    call = Call('save')
    call.with_args("positional")
    call("positional")
    assert_raises_str(FunkyError, "Called with wrong arguments", lambda: call(["wrong"], {}))