async def test_send__reply(self): message = Mock() message.is_reply = True message.type = 'text' with self.assertRaises(StrangerSenderError): await self.sender.send(message) self.sender.sendMessage.assert_not_called()
async def test_send__unknown_content_type(self): message = Mock() message.is_reply = False message.type = 'foo_type' with self.assertRaises(StrangerSenderError): await self.sender.send(message) self.sender.sendMessage.assert_not_called()
async def test_send__text(self): message = Mock() message.is_reply = False message.type = 'text' message.sending_kwargs = { 'foo': 'bar', 'baz': 'boo', } await self.sender.send(message) self.sender.sendMessage.assert_called_once_with(**message.sending_kwargs)
async def test_send__text(self): message = Mock() message.is_reply = False message.type = 'text' message.sending_kwargs = { 'foo': 'bar', 'baz': 'boo', } await self.sender.send(message) self.sender.sendMessage.assert_called_once_with( **message.sending_kwargs)