def test_bits_without_header(expected, bits): line = frame_to_line(bits) with patch('fileinput.lineno', return_value='0'): with patch('parser.IridiumMessage._pretty_header', return_value='-'): parser.freqclass = False p = parser.Message(line).upgrade() assert p.pretty().strip() == expected
def do_test_frame(bits): line = frame_to_line(bits) with patch('fileinput.lineno', return_value='0'): with patch('parser.IridiumMessage._pretty_header', return_value='-'): p = parser.Message(line).upgrade() if p.error: return "ERR:" + ", ".join(p.error_msg) else: return p.pretty()
def onnotice(connection, args, prefix): msg = parser.Message(connection, args, prefix, "NOTICE") on_msg(msg, connection)
def test_bits_header(expected, bits): line = frame_to_line(bits) with patch('fileinput.lineno', return_value='0'): p = parser.Message(line).upgrade() assert p._pretty_header() == expected
def onprivmsg(connection, args, prefix): msg = parser.Message(connection, args, prefix, "PRIVMSG") on_msg(msg, connection)