def test_include():
    import modules
    reload(modules)
    parser = parser.parser()
    modules.startup(parser)
    assert modules.modules.keys()[0] == 'admin_disconnect'
    modules.shutdown(parser)
def test_includes_excludes_both_not_empty():
    import modules
    reload(modules)
    parser = parser.parser()
    modules.startup(parser)
    assert modules.modules == {}
    modules.shutdown(parser)
示例#3
0
    def handle_close(self):
        """Called when the socket is closed."""

        logging.info('Saving channels')
        modules.shutdown(self.msg_parser)
        self.close()
        exit()
def test_startup_shutdown():
    import modules
    parser = parser.parser()
    assert modules.modules == {}
    modules.startup(parser)
    assert modules.modules != {}
    modules.shutdown(parser)
    assert modules.modules == {}
示例#5
0
	def onDisconnected(self):
		modules.fire_hook("disconnected", self)
		IrcClient.onDisconnected(self)
		global connections

		connections -= 1

		if connections == 0:
			self.logger.info("Shutting down.")
			modules.shutdown()
示例#6
0
    def disconnect(self):
        """Disconnects from the IRC server."""

        self.send_data("QUIT :Disconnecting")
        modules.shutdown(self.msg_parser)
        self.close()