Changeset 35c72b7 for .tests


Ignore:
Timestamp:
2021-03-17T14:24:03Z (4 years ago)
Author:
/ <>
Children:
f1ba258
Parents:
0e2c8b4
Message:

offlinetest

File:
1 edited

Legend:

Unmodified
Added
Removed
  • .tests/test1.py

    r0e2c8b4 r35c72b7  
    77MESSAGETEST = True
    88BLOCKTEST = False
    9 OFFLINETEST = False
     9OFFLINETEST = True
    1010RENAMETEST = True
    1111STATUSTEST= True
     
    165165    clis[1].send_priv_msg("&bitlbee", "set status "+status)
    166166    clis[0].send_priv_msg("&bitlbee", "info "+clis[1].nick)
    167     clis[0].receive()
    168     ret = (clis[0].tmp_log.find("jabber - Status message: "+status) != -1)
     167    ret = (clis[0].receive().find("jabber - Status message: "+status) != -1)
    169168
    170169    clis[1].send_priv_msg("&bitlbee", "set -del status")
    171170    clis[0].send_priv_msg("&bitlbee", "info "+clis[1].nick)
    172     clis[0].receive()
    173     ret = ret & (clis[0].tmp_log.find("jabber - Status message: none") != -1)
     171    ret = ret & (clis[0].receive().find("jabber - Status message: none") != -1)
    174172    return ret
    175173
    176174def offline_test(clis):
    177     pass
     175    clis[0].send_priv_msg("&bitlbee", "account off")
     176
     177    junk = clis[0].receive()
     178    ret = (junk.find(clis[1].nick) != -1)
     179    ret = ret & (junk.find("has quit") != -1)
     180
     181    junk = clis[1].receive()
     182    ret = ret & (junk.find(clis[0].nick) != -1)
     183    ret = ret & (junk.find("has quit") != -1)
     184
     185    clis[0].send_priv_msg(clis[1], "sup")
     186    ret = ret & (clis[0].receive().find("User does not exist: "+clis[1].nick) != -1)
     187
     188    clis[0].send_priv_msg("&bitlbee", "account on")
     189
     190    junk = clis[0].receive()
     191    ret = ret & (junk.find(clis[1].nick) != -1)
     192    ret = ret & (junk.find("has joined") != -1)
     193
     194    junk = clis[1].receive()
     195    ret = ret & (junk.find(clis[0].nick) != -1)
     196    ret = ret & (junk.find("has joined") != -1)
     197
     198    return ret
    178199
    179200def run_tests(failed):
     
    204225    if STATUSTEST:
    205226        perform_test(failed, clis, status_test, "Change status")
     227
     228    if OFFLINETEST:
     229        perform_test(failed, clis, status_test, "Go offline")
    206230
    207231    if failed or SHOWLOG:
Note: See TracChangeset for help on using the changeset viewer.