コード例 #1
0
    def test_channel_message(self, mock_msg):
        firefly_irc = FireflyIRC(Server(self.hostname, self.config))

        dest = containers.Destination(firefly_irc, '#testchan')
        firefly_irc.msg(dest, 'Hello, world!')

        mock_msg.assert_called_once_with(firefly_irc, '#testchan', 'Hello, world!', None)
コード例 #2
0
    def test_user_message(self, mock_msg):
        firefly_irc = FireflyIRC(Server(self.hostname, self.config))

        host = containers.Hostmask('[email protected]')
        firefly_irc.msg(host, 'Hello, world!')

        mock_msg.assert_called_once_with(firefly_irc, 'test_nick', 'Hello, world!', None)