protection agains incorrect usage

Issue #5 resolved
Carlos Ble repo owner created an issue

spy = empty_spy() spy.foo(1) assert_that_was_called(spy.foo).with_params(2) # should be with_args

It is OK because any unexistent method works quietly, and that is dangerous.

Comments (3)

  1. David Villa Alises

    Hi Carlos:

    The doublex wrapper for pyDoubles defines assert_that_method_called as a normal class (assert_that_was_called() is just a trivial factory). It does not create methods automatically, so this behaviour can not happen. If you try the code above you will get:

    AttibuteError: 'assert_that_method' object has no attribute 'with_params'

    Next pyDoubles release will fix[1]

    [1] https://bitbucket.org/DavidVilla/python-doublex/src/99f13aaf0e54/test/pyDoubles/unit.py#cl-463

  2. Log in to comment