Exemplo n.º 1
0
    def test_reenabled_command(self):
        c = util.command("command", aliases=["foo"])
        c(f3)

        pluginmanager.disable("command")
        pluginmanager.enable("command")
        self.assertTrue(pluginmanager._callbacks["command"].enabled)
        self.assertTrue(pluginmanager._callbacks["foo"].enabled)
        self.assertRaises(ValueError, pluginmanager._handle_message, "user",
        "channel", "!command")
Exemplo n.º 2
0
    def test_reenabled_regex(self):
        regex = compile("command")
        c = util.regex(regex)
        c(regex_f)

        pluginmanager.disable(regex.pattern)
        pluginmanager.enable(regex.pattern)
        self.assertTrue(pluginmanager._regexes[regex].enabled)
        self.assertRaises(ValueError, pluginmanager._handle_message, "user",
        "channel", "command")