Example #1
0
def test_removelawyer2():    
    User.query.delete()
    rmv_lawyer = remove_lawyer_judge({"username": "******"})
    print("Trying to remove lawyer with username : '******' that does not exist ")
    print(rmv_lawyer) 
    expected_msg = {"removed_status": "0","err_msg": "Sorry!! The username does not exist!!"}
    assert json.loads(rmv_lawyer) == expected_msg
Example #2
0
def test_removejudge():    
    User.query.delete()
    new_Judge = add_lawyer_judge({"usr_type": "Judge", "username": "******", "usr_addr": "Kol", "name": "J", "password": "******"})
    rmv_judge = remove_lawyer_judge({"username": "******"})
    print("Trying to remove judge with username : '******' that exists ")
    print(rmv_judge) 
    expected_msg = {"removed_status": "1","err_msg": "Username removed successfully!!"}
    assert json.loads(rmv_judge) == expected_msg
Example #3
0
def test_removelawyer():   
    User.query.delete()
    new_lawyer = add_lawyer_judge({"usr_type": "Lawyer", "username": "******", "usr_addr": "Kol", "name": "LAW1", "password": "******"})
    rmv_lawyer = remove_lawyer_judge({"username": "******"})   
    print("Trying to remove lawyer with username : '******' that exists ")
    print(rmv_lawyer) 
    expected_msg = {"removed_status": "1","err_msg": "Username removed successfully!!"}
    assert json.loads(rmv_lawyer) == expected_msg
Example #4
0
def test_getuserlist():
    new_Judge = add_lawyer_judge({"usr_type": "Judge", "username": "******", "usr_addr": "Kol", "name": "J", "password": "******"})
    new_lawyer = add_lawyer_judge({"usr_type": "Lawyer", "username": "******", "usr_addr": "Kol", "name": "LAW1", "password": "******"})
    new_Judge = add_lawyer_judge({"usr_type": "Judge", "username": "******", "usr_addr": "Bombay", "name": "judUser2", "password": "******"})
    new_lawyer = add_lawyer_judge({"usr_type": "Lawyer", "username": "******", "usr_addr": "Kol", "name": "LAW1", "password": "******"})
    rmv_judge = remove_lawyer_judge({"username":"******"})
    new_lawyer = add_lawyer_judge({"usr_type": "Lawyer", "username": "******", "usr_addr": "Chennai", "name": "LAW2", "password": "******"})
    all_users = get_user_list()
    all_users = get_user_list()
    print("The users are:")
    print(all_users)
    expected_output = {
        "usr_list": [
            {"username": "******", "name": "J", "usr_type": "Judge"},
            {"username": "******", "name": "LAW1", "usr_type": "Lawyer"},
            {"username": "******", "name": "judUser2", "usr_type": "Judge"},
            {"username": "******", "name": "LAW2", "usr_type": "Lawyer"}
            ],
            "confirm":"1",
            "message": "Success!! Here is the list of users!!"
    }
    assert json.loads(all_users) == expected_output