Re: Mock object but also assert method calls?

2015-08-15 Thread Thomas Lehmann via Python-list
Am Freitag, 14. August 2015 04:53:56 UTC+2 schrieb Steven D'Aprano: > On Fri, 14 Aug 2015 07:21 am, Ben Finney wrote: > > >> If find following totally different to the normal API which > >> is provided by the mock library: > >> > >> assert call().test2("hello") in mocked_objects.mock_calls > > >

Mock object but also assert method calls?

2015-08-13 Thread Thomas Lehmann via Python-list
Hi, How about asserting that test2 of class Bar is called? Of course I can do a patch for a concrete method but I was looking for something like: mocked_object.assert_method_called_with(name="test2", "hello") If find following totally different to the normal API which is provided by the mock