-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbackend_test.py
65 lines (48 loc) · 2.25 KB
/
backend_test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
from back_end.car_rental import CarRentalService
from back_end import car_rental
def main():
username = 'admin'
password = 'jenipassword'
host = '127.0.0.1'
port = 3307
car_rental_obj = car_rental.CarRentalService(host, port, username, password)
car_rental_obj.connect_to_mysql()
#print(car_rental_obj.admin_login("johnnyaguilar", "password"))
#car_rental_obj.add_car("4VG7DARF4XN766527", "72", "13", "240", "7JMC420", "2007", "Vectra C", "Opel", "Grey", "Sedan")
#print(car_rental_obj.get_reservations())
# print("\n")
# car_rental_obj.resevation_history("[email protected]")
"""
Test for hash_password function
"""
# user_password = "password"
# hashed_password = car_rental_obj.hash_password(user_password)
# print(hashed_password)
"""
Test for create_admin function
"""
# car_rental_obj.create_admin("Johnny", "admin_johnny", "[email protected]", "password123")
"""
Test for password check
"""
#print(car_rental_obj.check_password_admin("admin_jeni", "computer123","admin"))
"""
Test for changing passwords
"""
# car_rental_obj.update_password_admin("admin_jeni", "computer123")
#car_rental_obj.make_reservation("2025-05-10", "2025-05-12", 0,"AYOOOOOOOOOOOOOOOOOOO",7)
#car_rental_obj.make_reservation("2024-05-04", "2024-05-08", 0,"[email protected]",3)
# car_rental_obj.reservation_cancel_setter(61)
# car_rental_obj.reservation_confirm_setter(61)
# print(car_rental_obj.get_reservations())
# print("\n")
# car_rental_obj.revenue()
#car_rental_obj.make_reservation("2024-05-04", "2024-05-08", 0, "[email protected]",5)
#car_rental_obj.make_reservation("2024-06-04", "2024-06-08", 0, "[email protected],edu",2)
# admin = car_rental_obj.admin_login("admin_elijah", "jenipassword")
#car_rental_obj.user_update_password("cust_elijah", "password123", "customer")
customer = car_rental_obj.customer_login("cust_elija", "password123")
print(customer)
print(car_rental_obj.check_password("cust_elijah", "password123", "customer"))
car_rental_obj.make_reservation("2027-05-04", "2027-05-08", 0,"[email protected]",1,5)
main()