def cm2(prov_fixture2): cm = CentreManager() c1 = Centre("Randwick Hospital", "Randwick", "Hospital", 1234, 93000000) c2 = Centre("Prince of Wales", "Randwick", "Hospital", 1234, 93000000) c3 = Centre("Randwick Hospital", "Randwick", "Hospital", 1234, 93000000) c3.add_provider(prov_fixture2[0]) c3.add_provider(prov_fixture2[2]) c4 = Centre("RPA", "Camperdown", "Hospital", 1234, 93000000) c4.add_provider(prov_fixture2[0]) c4.add_provider(prov_fixture2[1]) c4.add_provider(prov_fixture2[2]) for centre in [c1, c2, c3, c4]: cm.add_centre(centre) return cm
def test_add_from_details(prov_fixture): cm = CentreManager() cm.add_centre_from_details("Randwick Hospital", "Randwick", "Hospital", 1234, 93000000) cm.add_centre_from_details("Prince of Wales", "Randwick", "Hospital", 1234, 93000000) assert (len(cm.centres) == 2)
def test_add_invalid(centre_fixture): cm = CentreManager() invalid = centre_fixture[2] cm.add_centre(centre_fixture[0]) cm.add_centre(invalid) assert (len(cm.centres) == 1)
def test_remove_empty(centre_fixture): cm = CentreManager() res = cm.rem_centre(centre_fixture[0]) assert (res == False)
def centres(): cm = CentreManager.bootstrap() return [cm.centres[0], cm.centres[1]]
def test_add_centre_dup(centre_fixture): cm = CentreManager() cm.add_centre(centre_fixture[0]) cm.add_centre(centre_fixture[3]) assert (len(cm.centres) == 1)
def test_empty_list(): cm = CentreManager() assert (len(cm.centres) == 0)
def cm(centre_fixture): cm = CentreManager() cm.add_centre(centre_fixture[0]) cm.add_centre(centre_fixture[1]) return cm
from flask import Flask from model.centre_manager import CentreManager from model.user_manager import UserManager from model.appointment_manager import AppointmentManager from model.system import link_centre_provider from model.permissions import Permissions from model.notifications_manager import NotificationsManager # Instantiate 'global' variables app = Flask(__name__) app.secret_key = 'super secret shhhh' user_manager = UserManager.load_data() centre_manager = CentreManager.load_data() link_centre_provider(centre_manager, user_manager) appt_manager = AppointmentManager.load_data() permissions = Permissions.load_data(user_manager.patients, user_manager.providers) notifications_manager = NotificationsManager(user_manager.patients, user_manager.providers, permissions) notifications_manager.generate_matrix()