Example #1
0
    if b:
        print("OK")
    else:
        print("FAIL")
        exit()


recvTest(1, 2, messageList12, MESSAGES_1TO2, MESSAGES_2TO1)
recvTest(1, 3, messageList13, MESSAGES_1TO3, MESSAGES_3TO1)
recvTest(2, 1, messageList21, MESSAGES_1TO2, MESSAGES_2TO1)
recvTest(2, 3, messageList23, MESSAGES_2TO3, MESSAGES_3TO2)
recvTest(3, 1, messageList31, MESSAGES_1TO3, MESSAGES_3TO1)
recvTest(3, 2, messageList32, MESSAGES_2TO3, MESSAGES_3TO2)

print("Changing password")
s1.setPassword("apassword1")
s2.setPassword("apassword2")
s3.setPassword("apassword3")
print("OK")
print("Logging in again with old password")
try:
    s1 = Session(USER1, "pass1")
    s2 = Session(USER2, "pass2")
    s3 = Session(USER3, "pass3")
except HTTPError:
    print("OK - password not accepted")
else:
    print("FAIL - old password accepted")
print("Logging in with new password")
s1 = Session(USER1, "apassword1")
s2 = Session(USER2, "apassword2")