how to mock a function in python

preview_player
Показать описание
mocks a function within a function in python without using the decorative method.
Рекомендации по теме
Комментарии
Автор

Thx. Is their a way to mock an image to upload? Tried to create an object (for django - webtest) of MagicMock(spec=ImageFile) giving it attrs:size, name. But PIL lib does not accept it as a valid image. Thanks in advance.

zakchips
visit shbcf.ru