Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail when call delete if the object doesn't exist. #32

Open
kiliancm94 opened this issue Feb 7, 2020 · 2 comments · May be fixed by #39
Open

Fail when call delete if the object doesn't exist. #32

kiliancm94 opened this issue Feb 7, 2020 · 2 comments · May be fixed by #39

Comments

@kiliancm94
Copy link

kiliancm94 commented Feb 7, 2020

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)]
... ),
... ])

@miki725
Copy link
Owner

miki725 commented Feb 7, 2020

delete is currently not implemented. prs are welcome though! https://github.com/miki725/alchemy-mock/blob/master/alchemy_mock/mocking.py

@kiliancm94
Copy link
Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants