'L{IRCPerson.sendMessage}'

def test_sendMessage(self):

    self.proto.makeConnection(self.transport)
    person = self.proto.getPerson('alice')
    self.assertRaises(OfflineError, person.sendMessage, 'Some    message')
    person.account.client = self.proto
    self.transport.clear()
    person.sendMessage('Some    message    2')
    self.assertEqual(self.transport.io.getvalue(), 'PRIVMSG    alice    :Some    message    2\r\n')
    self.transport.clear()
    person.sendMessage('smiles', {'style': 'emote'})
    self.assertEqual(self.transport.io.getvalue(), 'PRIVMSG    alice    :\x01ACTION    smiles\x01\r\n')
