Changeset 314c3f8 for .tests/test1.py


Ignore:
Timestamp:
2021-02-25T09:57:46Z (4 years ago)
Author:
/ <>
Children:
ed1f97c9
Parents:
4d7b9a3
Message:

moar error output

File:
1 edited

Legend:

Unmodified
Added
Removed
  • .tests/test1.py

    r4d7b9a3 r314c3f8  
    1616
    1717    def connect(self):
    18         self.sck.connect(('127.0.0.1', 6667))
     18        try:
     19            self.sck.connect(('127.0.0.1', 6667))
     20        except:
     21            print("Connection failed")
     22            sys.exit(1)
     23
    1924        self.sendRaw('USER ' + (self.nick + " ")*3)
    2025        self.sendRaw('NICK ' + self.nick)
    2126        self.sendRaw('JOIN &bitlbee')
    2227
    23     def bitlbeeLogin(self):
     28    def jabberLogin(self):
    2429        self.sendPrivMsg("&bitlbee", "account add jabber "+self.nick+"@localhost "+self.pw)
    2530        time.sleep(0.3)
    2631        self.sendPrivMsg("&bitlbee", "account on")
     32        time.sleep(1)
     33        self.receive()
     34        if self.log.find('Logged in') == -1:
     35            print("Jabber Login failed")
     36            sys.exit(1)
    2737
    2838    def receive(self):
     
    4656    for cli in clis:
    4757        cli.connect()
    48         cli.bitlbeeLogin()
     58        cli.jabberLogin()
    4959    a, b = clis[0], clis[1]
    5060    a.sendPrivMsg(b.nick, 'ohai qtie')
    51     a.receive()
    52     b.receive()
     61    print("Sender: " + a.receive())
     62    print("Receiver: " + b.receive())
    5363    if not b.log.find('ohai qtie') == -1:
    5464        print('yay!')
Note: See TracChangeset for help on using the changeset viewer.