Ejemplo n.º 1
0
    def setUpClass(cls):
        global p, joe, conf

        ## create an instance of the plugin to test
        p = TeamspeakbfPlugin(fakeConsole, conf)
        p.onLoadConfig()
        p.onStartup()
        joe.connects('Joe')

        timeout = time.time() + 10
        while not p.tsconnection and time.time() < timeout:
            time.sleep(.1)
        if not p.tsconnection:
            raise AssertionError("Could not connect to TeamSpeak server")

        if not p.tsGetClient(joe):
            raise unittest.SkipTest(
                "please connect to the test Teamspeak server first and make sure your ip is %s as set in config.ini"
                % config.get("me", "ip"))

        channellist = p.tsSendCommand('channellist')
        cls.tsDefaultChannel = p.tsGetChannelIdByName(u'Default Channel',
                                                      channellist)
        if not cls.tsDefaultChannel:
            raise unittest.SkipTest("Could not get default teamspeak channel")
    def setUpClass(cls):
        global p, joe, conf

        ## create an instance of the plugin to test
        p = TeamspeakbfPlugin(fakeConsole, conf)
        p.onLoadConfig()
        p.onStartup()
        joe.connects('Joe')

        timeout = time.time() + 10
        while not p.tsconnection and time.time() < timeout:
            time.sleep(.1)
        if not p.tsconnection:
            raise AssertionError("Could not connect to TeamSpeak server")

        if not p.tsGetClient(joe):
            raise unittest.SkipTest("please connect to the test Teamspeak server first and make sure your ip is %s as set in config.ini" % config.get("me", "ip"))

        channellist = p.tsSendCommand('channellist')
        cls.tsDefaultChannel= p.tsGetChannelIdByName(u'Default Channel', channellist)
        if not cls.tsDefaultChannel:
            raise unittest.SkipTest("Could not get default teamspeak channel")