def test_not_a_substitute(): user = user_info('user', None, None) channel = '#channel' plugin = SedPlugin() plugin.history[channel][user.nick] = 'doesnt matter' assert plugin.substitute(user, channel, 'foobar') == None
def test_substitute_modifiers(message, new_message): user = user_info('user', None, None) channel = '#channel' plugin = SedPlugin() plugin.history[channel][user.nick] = 'this is a test message' assert plugin.substitute(user, channel, message) == new_message
def test_substitute_escaping(message, new_message): user = user_info('user', None, None) channel = '#channel' plugin = SedPlugin() plugin.history[channel][user.nick] = 'hi/hey/hello' assert plugin.substitute(user, channel, message) == new_message
def test_substitution_doesnt_match(): user = user_info('user', None, None) channel = '#channel' plugin = SedPlugin() plugin.history[channel][user.nick] = 'doesnt matter' assert plugin.substitute(user, channel, 's/foo/bar/') == 'doesnt matter'