Exemplo n.º 1
0
def test_login():
    user_name_ok = 'TestUser'
    password_ok = '***'
    user_name_bad = 'root'
    password_bad = 'root'
    msg_1, status_code_ok = maria_f.verify_login(user_name_ok, password_ok)
    msg_2, status_code_bad = maria_f.verify_login(user_name_bad, password_bad)
    msg_3, status_code_mix1 = maria_f.verify_login(user_name_bad, password_ok)
    msg_4, status_code_mix2 = maria_f.verify_login(user_name_ok, password_bad)

    assertor(status_code_ok, status_ok)
    assertor(status_code_bad, status_failed)
    assertor(status_code_mix1, status_failed)
    assertor(status_code_mix2, status_failed)
Exemplo n.º 2
0
def login_user():
    '''Try to login a user'''
    user_name = request.form.get('user_name')
    password = request.form.get('password')
    msg, status_code = maria_f.verify_login(user_name, password)
    return make_response(msg, status_code)