Changeset 2c03d0c
- Timestamp:
- 2021-02-25T17:57:21Z (4 years ago)
- Children:
- 484e460
- Parents:
- 5a1b05c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
.tests/test1.py
r5a1b05c r2c03d0c 70 70 71 71 def testSendMessage(sender, receiver, message, shouldreceive = True): 72 sender.sendPrivMsg( b.nick, message)72 sender.sendPrivMsg(receiver.nick, message) 73 73 received = receiver.receive().find(message) != -1 74 74 if shouldreceive ^ received: 75 75 print('Test failed: Message from ' + sender.nick + ' to ' + receiver.nick) 76 print('Sender Log:' + a.log)77 print('Receiver Log:' + b.log)76 print('Sender Log:' + sender.log) 77 print('Receiver Log:' + receiver.log) 78 78 sys.exit(1) 79 79 … … 89 89 90 90 print("Test: Send message") 91 testSendMessage(clis[0], clis[1]),'ohai <3')92 testSendMessage(clis[1], clis[0]),'uwu *pounces*')91 testSendMessage(clis[0], clis[1], 'ohai <3') 92 testSendMessage(clis[1], clis[0], 'uwu *pounces*') 93 93 print("Test passed") 94 94 95 95 print("Test: Block/Unblock") 96 96 clis[0].blockJabberBuddy(clis[1].nick) 97 testSendMessage(clis[1], clis[0]),'m-meow?', shouldreceive = False)97 testSendMessage(clis[1], clis[0], 'm-meow?', shouldreceive = False) 98 98 clis[0].unblockJabberBuddy(clis[1].nick) 99 testSendMessage(clis[1], clis[0]),'*purrs*')99 testSendMessage(clis[1], clis[0], '*purrs*') 100 100 print("Test passed") 101 101
Note: See TracChangeset
for help on using the changeset viewer.