- Timestamp:
- 2021-03-16T15:03:06Z (4 years ago)
- Children:
- da75c3d
- Parents:
- d28ca33
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
.tests/test1.py
rd28ca33 r0167270 23 23 self.sck = socket.socket(socket.AF_INET, socket.SOCK_STREAM) 24 24 25 def send_raw(self, msg, loud = False ):25 def send_raw(self, msg, loud = False, log = True): 26 26 self.receive() 27 27 if loud: 28 28 print('FROM '+ self.nick + '|| ' + msg) 29 self.log += msg+'\r\n' 30 self.tmplog += msg+'\r\n' 29 if log: 30 self.log += msg+'\r\n' 31 self.tmplog += msg+'\r\n' 31 32 self.sck.send((msg+'\r\n').encode()) 32 33 … … 112 113 print("Test Log "+ cli.nick+":") 113 114 print(cli.tmplog) 114 115 115 print(SEPARATOR) 116 116 … … 118 118 ret = False 119 119 for _ in range(100): 120 clis[0].send_raw(" yes", loud= False)120 clis[0].send_raw("PRIVMSG yes", loud = False, log = False) 121 121 clis[0].receive() 122 if (not ret) and clis[0].log.find("Did I ask you something?"):122 if (not ret) and (clis[0].log.find("Did I ask you something?") != -1): 123 123 ret = True 124 if clis[0].log.find("Buuuuuuuuuuuuuuuurp"): 124 if clis[0].log.find("Buuuuuuuuuuuuuuuurp") != -1: 125 ret = True 125 126 print("The RNG gods smile upon us") 126 127 break … … 161 162 perform_test(failed, clis, yes_test, "Yes") 162 163 164 print("") 163 165 for cli in clis: 164 166 cli.jabber_login()
Note: See TracChangeset
for help on using the changeset viewer.