diff --git a/test/testbot b/test/testbot index 380524d..35b345a 100755 --- a/test/testbot +++ b/test/testbot @@ -37,11 +37,13 @@ def allmsgsrecv(): # Print results and exit def printandexit(): print("Results of test:") + print("Room1 -> Room2:") for i in results1: if i[2] == 0: print(i[0] + " : Not recieved") else: print(i[0].rstrip() + " : " + str(round(i[2]-i[1],2)) + " secounds") + print("Room2 -> Room1:") for i in results2: if i[2] == 0: print(i[0] + " : Not recieved") @@ -122,6 +124,13 @@ if __name__ == '__main__': NICK = config.get('credentials', 'NICK') ROOM1 = config.get('credentials', 'ROOM1') ROOM2 = config.get('credentials', 'ROOM2') + HOST = None + PORT = 5222 + if "host" in config.options('credentials'): + HOST = config.get('credentials', 'HOST') + if "port" in config.options('credentials'): + PORT = config.get('credentials', 'PORT') + xmpp = MUCBot(JID, PASSWORD, NICK, ROOM1, ROOM2) @@ -130,6 +139,9 @@ if __name__ == '__main__': xmpp.register_plugin('xep_0199') # XMPP Ping # Connect to the XMPP server and start processing XMPP stanzas. - xmpp.connect(address=("127.0.0.1",25222)) + if HOST != None: + xmpp.connect(address=(HOST,int(PORT))) + else: + xmpp.connect() xmpp.process(forever=False)