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)
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)