Beispiel #1
0
def test_dumpAndLoad3():
    ems1 = EMS(userCSV='user.csv')
    user1 = Guest(
        createUser('z5135009', 'hahaha', 'name5135009', '*****@*****.**'))
    ems1.addUser(user1)
    ems1.dumpData(file='test-user.data')
    ems2 = EMS(binFile='test-user.data')
    os.remove('test-user.data')
    assert (
        ems2.getUserByEmail('*****@*****.**').email == '*****@*****.**')
    assert (
        ems2.getUserByEmail('*****@*****.**').email == '*****@*****.**')
    registerEMS(None)
Beispiel #2
0
def test_guest_registration_success():
    ems1 = EMS()
    user1 = Guest(createUser(None, 'hahaha', 'testName23',
                             '*****@*****.**'))
    ems1.addUser(user1)
    assert (ems1.getUserByEmail('*****@*****.**').name == 'testName23')
    registerEMS(None)
Beispiel #3
0
def test_login3():
    ems1 = EMS(userCSV='user.csv')
    assert (ems1.login(
        '*****@*****.**',
        'pass30778') == (ems1.getUserByEmail('*****@*****.**'),
                         'Successfully logged in...'))
    registerEMS(None)
Beispiel #4
0
def test_dumpAndLoad2():
    ems1 = EMS(userCSV='user.csv')
    user1 = Guest(
        createUser('z5135009', 'hahaha', 'name5135009', '*****@*****.**'))
    ems1.addUser(user1)
    ems1.dumpData(file='user.data')
    ems2 = EMS(binFile='user.data')

    assert (ems2.getUserByEmail('*****@*****.**').password == 'hahaha')
    assert (ems2.getUserByEmail('*****@*****.**').password == 'pass24064')
    registerEMS(None)