Changeset 23fd63d for .tests/test1.py
- Timestamp:
- 2021-03-16T13:54:34Z (4 years ago)
- Children:
- a4623f4
- Parents:
- e98404d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
.tests/test1.py
re98404d r23fd63d 8 8 OFFLINETEST = False 9 9 RENAMETEST = True 10 BURPTEST = True 10 11 11 12 FAILED = False … … 16 17 self.pwd = pwd 17 18 self.log = '' 19 self.tmplog = '' 18 20 self.sck = socket.socket(socket.AF_INET, socket.SOCK_STREAM) 19 21 … … 23 25 print('FROM '+ self.nick + '|| ' + msg) 24 26 self.log += msg+'\r\n' 27 self.tmplog += msg+'\r\n' 25 28 self.sck.send((msg+'\r\n').encode()) 26 29 … … 65 68 break 66 69 self.log += text 70 self.tmplog += text 67 71 return text 68 72 … … 91 95 for cli in clis: 92 96 cli.connect() 97 98 if BURPTEST: 99 print("Test: Yes") 100 ret = False 101 for _ in range(100): 102 clis[0].send_raw("yes") 103 clis[0].receive() 104 if (not ret) and clis[0].log.find("Did I ask you something?"): 105 ret = True 106 if clis[0].log.find("Buuuuuuuuuuuuuuuurp"): 107 print("The RNG gods smile upon us") 108 break 109 if ret: 110 print("Test passed") 111 else: 112 print("Test failed") 113 114 for cli in clis: 93 115 cli.jabber_login() 94 95 116 clis[0].add_jabber_buddy(clis[1].nick) 96 117 … … 127 148 ret = clis[1].receive().find(message) != -1 128 149 129 clis[0].rename_jabber_buddy( newname, clis[1].nick)150 clis[0].rename_jabber_buddy("-del", newname) 130 151 ret = ret & test_send_message(clis[0], clis[1], "rawr") 131 152 if ret:
Note: See TracChangeset
for help on using the changeset viewer.