kaste / mockito-python

Mockito is a spying framework
MIT License
123 stars 12 forks source link

Update `expect` to support dotted paths #78

Closed Oracking closed 6 months ago

Oracking commented 6 months ago

Ref #77

kaste commented 6 months ago

Looks promising. You just mix two concerns here. Make the proper commit fixed up for the dotted path here because I can pick that straight away.

The doc change is okay but only somewhat. This is not really the lenient feature, I think. So that would be misleading or I'm mistaken here. Partly their "lenient" is just setting strict=False here. (Historical pun, I "invented", in: had the idea, for the strict mode.) More importantly if we make such official statement of how to achieve something, like using between here, we add a test for this as well. Wouldn't it be interesting to add open bounds to between for this use-case? (I.e. between=(0,) .) Or should we actually check the used strict-ness in the verify function? (I don't think so but I have to write it down at least.)

kaste commented 6 months ago

So, that's the first commit checked in

Oracking commented 6 months ago

Thanks for merging the changes :). And I agree that Java mockito's lenient is a superset of the behaviour being described here so the wording could be improved. Given that, I think it will be worth having the lenient keyword somewhere in the doc as other Java devs in search of this feature will likely grep the keyword.

Re: adding open bounds to between - that does sound cool and will probably be a more fitting way to specify the intended behaviour. Just wondering if that overlaps with the atleast behaviour though. I will continue conversation on the original issue though.