コード例 #1
0
ファイル: test_account.py プロジェクト: xum15/Deliverable_4
def test_invalid_account_1():
    account_1 = accounts("McMaster123", "Scba123456", "Scba123456",
                         "*****@*****.**", "John Doe", "416-956-8837")
    account_2 = accounts("McMaster123", "Sabc123456", "Sabc123456",
                         "*****@*****.**", "Rob Doe", "416-988-8815")
    account_1.create_account()  # Creates the first account
    assert account_2.verify_account(
    ) == False, "account information should be invalid as it's not unique"
コード例 #2
0
ファイル: test_account.py プロジェクト: xum15/Deliverable_4
def test_valid_unique_account():
    account_1 = accounts("McMaster123", "Scba123456", "Scba123456",
                         "*****@*****.**", "John Doe", "416-956-8837")
    account_2 = accounts("McMaster456", "Scba123456", "Scba123456",
                         "*****@*****.**", "Rick Lee", "416-985-8531")
    account_1.create_account()  # Creates the first account
    assert account_2.verify_account(
    ) == True, "account information should be valid"
コード例 #3
0
ファイル: test_account.py プロジェクト: xum15/Deliverable_4
def test_change_password():
    account_1 = accounts("McMaster123", "Scba123456", "Scba123456",
                         "*****@*****.**", "John Doe", "416-956-8837")
    old = "Scba123456"
    new = "ABc1234567"
    assert account_1.password_change(
        old, new) == new, "password should be changed to the new password"
コード例 #4
0
ファイル: test_account.py プロジェクト: xum15/Deliverable_4
def test_view_order_history():
    # Account
    account_1 = accounts("McMaster123", "Scba123456", "Scba123456",
                         "*****@*****.**", "John Doe", "416-956-8837")
    # Creates an order for the account
    items = ["Hamburger", "Smoothie", "Pizza", "Salad", "Ice Cream"]
    order_1 = order("McMaster123", 369, "September 3, 2020 at 6:30PM", items,
                    55.99)
    assert account_1.view_order_history(
        369
    ) == order_1, "it shall display the information of order_1 for account_1"
コード例 #5
0
ファイル: test_account.py プロジェクト: xum15/Deliverable_4
def test_login_authentication_invalid():
    account_1 = accounts("McMaster456", "Scba123456", "Scba123456",
                         "*****@*****.**", "Rick Lee", "416-985-8531")
    assert account_1.login(
        "McMaster456",
        "Scale1122") == False, "login information should be incorrect"
コード例 #6
0
ファイル: test_account.py プロジェクト: xum15/Deliverable_4
def test_change_profile():
    account_1 = accounts("McMaster456", "Scba123456", "Scba123456",
                         "*****@*****.**", "Rick Lee", "416-985-8531")
    account_1.change_profile("Mcmaster456", "*****@*****.**",
                             "Rick Lee", "416-985-8531")
    assert account_1.email == "*****@*****.**", "email should be changed to the new email"
コード例 #7
0
ファイル: test_account.py プロジェクト: xum15/Deliverable_4
def test_invalid_account_2():
    account_1 = accounts("McMaster123", "Scba123456", "ABCas123456",
                         "*****@*****.**", "John Doe", "416-956-8837")
    assert account_1.verify_account(
    ) == False, "account information should be invalid as the passwords are different"