def test_change_details_provider(self): provider = healthSystem.get_user_byName("Anna Azzam") assert (provider.name == "Anna Azzam") assert (provider.email == "*****@*****.**") assert (provider.phone == "0412 009 200") healthSystem.editDetails(provider, "Dom Latouche", "*****@*****.**", "0419 243 333") assert (provider.name == "Dom Latouche") assert (provider.email == "*****@*****.**") assert (provider.phone == "0419 243 333")
def test_change_details_patients(self): patient = healthSystem.get_user("*****@*****.**") assert (patient.name == "Jack Bilby") assert (patient.email == "*****@*****.**") assert (patient.phone == "0420 008 080") healthSystem.editDetails(patient, "Owen Silver", "*****@*****.**", "0427 169 346") assert (patient.name == "Owen Silver") assert (patient.email == "*****@*****.**") assert (patient.phone == "0427 169 346")
def test_change_details_patients_phone_empty(self): patient = healthSystem.get_user("*****@*****.**") assert (patient.name == "Jack Bilby") assert (patient.email == "*****@*****.**") assert (patient.phone == "0420 008 080") try: healthSystem.editDetails(patient, "Owen Silver", "*****@*****.**", "") except EditError as ee: assert (ee.errors["phone"] == "Please enter a valid phone.") assert (patient.name == "Jack Bilby") assert (patient.email == "*****@*****.**") assert (patient.phone == "0420 008 080") else: assert (false)
def test_change_details_provider_phone_empty(self): provider = healthSystem.get_user_byName("Anna Azzam") assert (provider.name == "Anna Azzam") assert (provider.email == "*****@*****.**") assert (provider.phone == "0412 009 200") try: healthSystem.editDetails(provider, "Owen Silver", "*****@*****.**", "") except EditError as ee: assert (ee.errors["phone"] == "Please enter a valid phone.") assert (provider.name == "Anna Azzam") assert (provider.email == "*****@*****.**") assert (provider.phone == "0412 009 200") else: assert (false)
def test_change_details_provider_email_empty(self): provider = healthSystem.get_user_byName("Anna Azzam") assert (provider.name == "Anna Azzam") assert (provider.email == "*****@*****.**") assert (provider.phone == "0412 009 200") try: healthSystem.editDetails(provider, "", "*****@*****.**", "1231 231 123") except EditError as ee: assert (ee.errors["name"] == "Please enter a valid name.") assert (provider.name == "Anna Azzam") assert (provider.email == "*****@*****.**") assert (provider.phone == "0412 009 200") else: assert (false)