alchemy-mock
alchemy-mock copied to clipboard
Fail when call delete if the object doesn't exist.
Hello,
First of all, a lot of thanks for sharing this library! It's very useful.
If I create a session, later I try to delete all the entries of a session mocked with some conditions not accomplished, it returns a UnifiedAlchemyMagicMock instead of returning None.
Do you know if I am doing something wrong or this function is not implemented?
Example:
session = UnifiedAlchemyMagicMock(data=[ ... ( ... [mock.call.query(Model), ... mock.call.filter(Model.name == 'bob', ... Model.age == 29)], ... [Model(name='bob, ... age=29)] ... ), ... ( ... [mock.call.query(Model), ... mock.call.filter(Model.name == 'alice', ... Model.age == 30)], ... [Model(name='alice', ... age=30)] ... ), ... ])
delete is currently not implemented. prs are welcome though! https://github.com/miki725/alchemy-mock/blob/master/alchemy_mock/mocking.py
Thanks!