Changeset 23fd63d for .tests/test1.py


Ignore:
Timestamp:
2021-03-16T13:54:34Z (4 years ago)
Author:
/ <>
Children:
a4623f4
Parents:
e98404d
Message:

burp

File:
1 edited

Legend:

Unmodified
Added
Removed
  • .tests/test1.py

    re98404d r23fd63d  
    88OFFLINETEST = False
    99RENAMETEST = True
     10BURPTEST = True
    1011
    1112FAILED = False
     
    1617        self.pwd = pwd
    1718        self.log = ''
     19        self.tmplog = ''
    1820        self.sck = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    1921
     
    2325            print('FROM '+ self.nick + '|| ' + msg)
    2426        self.log += msg+'\r\n'
     27        self.tmplog += msg+'\r\n'
    2528        self.sck.send((msg+'\r\n').encode())
    2629
     
    6568                break
    6669        self.log += text
     70        self.tmplog += text
    6771        return text
    6872
     
    9195    for cli in clis:
    9296        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:
    93115        cli.jabber_login()
    94 
    95116    clis[0].add_jabber_buddy(clis[1].nick)
    96117
     
    127148        ret = clis[1].receive().find(message) != -1
    128149
    129         clis[0].rename_jabber_buddy(newname, clis[1].nick)
     150        clis[0].rename_jabber_buddy("-del", newname)
    130151        ret = ret & test_send_message(clis[0], clis[1], "rawr")
    131152        if ret:
Note: See TracChangeset for help on using the changeset viewer.