Changeset 314c3f8 for .tests/test1.py
- Timestamp:
- 2021-02-25T09:57:46Z (4 years ago)
- Children:
- ed1f97c9
- Parents:
- 4d7b9a3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
.tests/test1.py
r4d7b9a3 r314c3f8 16 16 17 17 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 19 24 self.sendRaw('USER ' + (self.nick + " ")*3) 20 25 self.sendRaw('NICK ' + self.nick) 21 26 self.sendRaw('JOIN &bitlbee') 22 27 23 def bitlbeeLogin(self):28 def jabberLogin(self): 24 29 self.sendPrivMsg("&bitlbee", "account add jabber "+self.nick+"@localhost "+self.pw) 25 30 time.sleep(0.3) 26 31 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) 27 37 28 38 def receive(self): … … 46 56 for cli in clis: 47 57 cli.connect() 48 cli. bitlbeeLogin()58 cli.jabberLogin() 49 59 a, b = clis[0], clis[1] 50 60 a.sendPrivMsg(b.nick, 'ohai qtie') 51 a.receive()52 b.receive()61 print("Sender: " + a.receive()) 62 print("Receiver: " + b.receive()) 53 63 if not b.log.find('ohai qtie') == -1: 54 64 print('yay!')
Note: See TracChangeset
for help on using the changeset viewer.