示例#1
0
 def test_build_privmsgs_in_without_newline(self):
     fromm = 'f'
     to = 't'
     line = 'line1'
     result = weechat_otr.build_privmsgs_in(fromm, to, line)
     self.assertEqual(result,
             weechat_otr.build_privmsg_in(fromm, to, line))
示例#2
0
 def test_build_privmsgs_in_with_newline(self):
     fromm = 'f'
     to = 't'
     result = weechat_otr.build_privmsgs_in(fromm, to, 'line1\nline2')
     self.assertEqual(result, '{msg1}\r\n{msg2}'.format(
         msg1=weechat_otr.build_privmsg_in(fromm, to, 'line1'),
         msg2=weechat_otr.build_privmsg_in(fromm, to, 'line2')))
示例#3
0
 def test_build_privmsgs_in_without_newline_prefix(self):
     fromm = 'f'
     to = 't'
     line = 'line1'
     prefix = 'Some prefix: '
     result = weechat_otr.build_privmsgs_in(fromm, to, line, prefix)
     self.assertEqual(result,
             weechat_otr.build_privmsg_in(fromm, to, prefix+line))
示例#4
0
 def test_build_privmsgs_in_with_newline(self):
     fromm = 'f'
     to = 't'
     result = weechat_otr.build_privmsgs_in(fromm, to, 'line1\nline2')
     self.assertEqual(
         result, '{msg1}\r\n{msg2}'.format(
             msg1=weechat_otr.build_privmsg_in(fromm, to, 'line1'),
             msg2=weechat_otr.build_privmsg_in(fromm, to, 'line2')))
示例#5
0
 def test_build_privmsgs_in_without_newline_prefix(self):
     fromm = 'f'
     to = 't'
     line = 'line1'
     prefix = 'Some prefix: '
     result = weechat_otr.build_privmsgs_in(fromm, to, line, prefix)
     self.assertEqual(
         result,
         weechat_otr.build_privmsg_in(
             fromm, to, '{prefix}{line}'.format(prefix=prefix, line=line)))
示例#6
0
 def test_build_privmsgs_in_with_newline_prefix(self):
     fromm = 'f'
     to = 't'
     prefix = 'Some prefix: '
     result = weechat_otr.build_privmsgs_in(fromm, to, 'line1\nline2',
             prefix)
     self.assertEqual(result, '{msg1}\r\n{msg2}'.format(
         msg1=weechat_otr.build_privmsg_in(fromm, to,
             '{}line1'.format(prefix)),
         msg2=weechat_otr.build_privmsg_in(fromm, to,
             '{}line2'.format(prefix))))
示例#7
0
 def test_build_privmsgs_in_with_newline_prefix(self):
     fromm = 'f'
     to = 't'
     prefix = 'Some prefix: '
     result = weechat_otr.build_privmsgs_in(fromm, to, 'line1\nline2',
                                            prefix)
     self.assertEqual(
         result, '{msg1}\r\n{msg2}'.format(
             msg1=weechat_otr.build_privmsg_in(fromm, to,
                                               '{}line1'.format(prefix)),
             msg2=weechat_otr.build_privmsg_in(fromm, to,
                                               '{}line2'.format(prefix))))
示例#8
0
 def test_build_privmsgs_in_without_newline(self):
     fromm = 'f'
     to = 't'
     line = 'line1'
     result = weechat_otr.build_privmsgs_in(fromm, to, line)
     self.assertEqual(result, weechat_otr.build_privmsg_in(fromm, to, line))