Here are the examples of the python api mock.assert_called_once taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
1 Examples
3
Source : test_weight_trend_notif.py
with Apache License 2.0
from jlapenna
with Apache License 2.0
from jlapenna
def _assert_send(self, mock, title, body):
mock.assert_called_once()
send_args, send_kwargs = mock.call_args
message = send_args[-1]({'token': 'XYZ_TOKEN'})
self.assertEqual(message.notification.title, title)
self.assertEqual(message.notification.body, body)