def test_unknown_formatting(): try: utils.clean_formatting('\x19A01Wat') assert False, 'should have thrown an error' except NotImplementedError: # good pass
def msg_sys_buffer_line_added(self, msg): """When a message is received, notify if appropriate.""" # All lines, if they match the notify critera. for line in (l for l in msg[0]['values'] if self._should_notify(l)): buf_name = self.weechat_buffers[line['buffer']] notify(clean_formatting('{buf_name} - {prefix} - {message}' .format(buf_name=buf_name, **line)))
def msg_sys_buffer_line_added(self, msg): """When a message is received, notify if appropriate.""" # All lines, if they match the notify critera. for line in (l for l in msg[0]['values'] if self._should_notify(l)): buf_name = self.weechat_buffers[line['buffer']] notify( clean_formatting('{buf_name} - {prefix} - {message}'.format( buf_name=buf_name, **line)))
def test_clean_formatting(): # One format eq_(utils.clean_formatting('Hey \x19F12you!'), 'Hey you!') # Two format eq_(utils.clean_formatting('\x19F20Hey \x19F12you!'), 'Hey you!')