-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtestDentalClinicDAO.py
69 lines (52 loc) · 2.03 KB
/
testDentalClinicDAO.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
66
67
68
69
# Test of DentalClinicDAO.
from main.DentalClinicDAO import dentalClinicDAO
# DENTISTS.
def check_dentists():
print("DENTISTS")
# Create two dentists.
dentalClinicDAO.create_dentist(('Max Smith', 'General Dentist', '120/M'))
latest_dentist_id = dentalClinicDAO.create_dentist(
('Victor Hugo', 'Implantologist', '34/6M'))
print(f"New dentists were added to the records")
# Get All.
returnValue = dentalClinicDAO.get_all_dentists()
print(f"All dentists {returnValue}")
# Find by ID.
returnValue = dentalClinicDAO.find_by_dentistId(latest_dentist_id)
print(f"Found by id {returnValue}")
# Update.
returnValue = dentalClinicDAO.update_dentist(
('Victor Hugo', 'Endodontist', '34/6M', latest_dentist_id))
print(f"Updated dentist with id {latest_dentist_id}")
# Delete.
returnValue = dentalClinicDAO.delete_dentist(latest_dentist_id)
print(f"Deleted dentist with id {latest_dentist_id}")
# Get All dentist again.
returnValue = dentalClinicDAO.get_all_dentists()
print(f"All dentists {returnValue} \n\n\n")
# PATIENTS.
def check_patients():
print("PATIENTS")
# Create.
latest_patient_id = dentalClinicDAO.create_patient(
('Caroline Smith', '0872239565', 1))
print(f"New patient was added to the records")
# Get All.
returnValue = dentalClinicDAO.get_all_patients()
print(f"All patients {returnValue}")
# Find by ID.
returnValue = dentalClinicDAO.find_by_patientId(latest_patient_id)
print(f"Found by id {returnValue}")
# Update.
returnValue = dentalClinicDAO.update_patient(
('Caroline Spillane', '0892239568', 1, latest_patient_id))
print(f"Updated patient with id {latest_patient_id}")
# Delete.
returnValue = dentalClinicDAO.delete_patient(latest_patient_id)
print(f"Deleted patient with id {latest_patient_id}")
# Get All dentist again.
returnValue = dentalClinicDAO.get_all_patients()
print(f"All patients {returnValue}")
# Call the functions.
check_dentists()
check_patients()