def test_get_size(self): repo1 = DepartmentsRepository() repo2 = PatientRepository() patient1 = Patients("G", "K", 111, "flu") patient2 = Patients("R", "R", 112, "coma") department1 = Departments(1, "flue", 4) repo2.add_patient(patient1) repo2.add_patient(patient2) department1.set_patients(repo2) repo1.add_department(department1) self.assertEqual(repo1.get_size_department(), 1)
def test_add_department(self): repo1 = DepartmentsRepository() repo2 = PatientRepository() patient1 = Patients("G", "K", 111, "flu") patient2 = Patients("R", "R", 112, "coma") department1 = Departments(1, "flue", 4) repo2.add_patient(patient1) repo2.add_patient(patient2) department1.set_patients(repo2) repo1.add_department(department1) department2 = Departments(1, "flu", 5) try: repo1.add_department(department2) assert False except Exception as ex: assert True self.assertEqual(repo1.get_size_department(), 1)