Skip to content

Instantly share code, notes, and snippets.

@foxmask
Created October 25, 2016 09:53
Show Gist options
  • Save foxmask/c99447466a3c78f62b3056bf53d36f9a to your computer and use it in GitHub Desktop.
Save foxmask/c99447466a3c78f62b3056bf53d36f9a to your computer and use it in GitHub Desktop.
mocker l'appel à __init__ d'une classe
with patch('instapush.Instapush') as mock_save_data:
with patch('instapush.App') as mock_save_data2:
se = ServiceInstapush(self.token)
se.save_data(self.trigger_id, **self.data)
mock_save_data2.assert_called_once_with(user_token=self.token)
mock_save_data.assert_called_once_with(appid='app_id',
secret='secret')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment