Esempio n. 1
0
def test_name_check_with_no_charac_is_NOK():
    assert hashes.name_check("") == False
Esempio n. 2
0
def test_name_check_with_blank_space_is_NOK():
    assert hashes.name_check("@vanessa is here") == False
Esempio n. 3
0
def test_name_check_with_weird_charac_is_NOK():
    assert hashes.name_check("@vanessa%is/here") == False
Esempio n. 4
0
def test_name_check_WO_arobase_is_NOK():
    assert hashes.name_check('vanessa') == False
Esempio n. 5
0
def test_name_check_with_accent_charac_is_ok():
    assert hashes.name_check('@Étienne') == True
Esempio n. 6
0
def test_name_check_with_spec_charac_is_ok():
    assert hashes.name_check('@anna-livia') == True
Esempio n. 7
0
def test_name_check_is_ok():
    assert hashes.name_check('@vanessa') == True, hashes.name_check('@vanessa')
name_undefined = True
print("")
print("")
print("##### MESSAGING BOARD #####")

while name_undefined:

    print("")
    print("")
    print("What is your name ?")
    print("A name stars with @, can contain alpha num, - or _")
    print("")
    print("")
    given_name = input("Your name : ")

    if hashes.name_check(given_name):
        name_undefined = False
        user_name = str.lower(given_name)
        if user_name not in hashes.get_user_names():
            print("")
            print("Are you new ?")
            is_new_user = input("Your Answer (y/n):  ")
            password = input("set your password:  "******"")
            if is_new_user == "n":
                print("verify your username:  "******"confirm this is your handle (y/n):  ")
                if is_name_correct == 'n':
                    name_undefined = True
            else:
                hashes.set_user_password(given_name, password)