Пример #1
0
    def prepare_data(self, prescA, prescB, prescC):
        patient = Patient()
        medA = Medicine("A")
        medB = Medicine("B")
        medC = Medicine("C")

        medA.add_prescription(prescA)
        medB.add_prescription(prescB)
        medC.add_prescription(prescC)

        patient.add_medicine(medA)
        patient.add_medicine(medB)
        patient.add_medicine(medC)
        return patient
Пример #2
0
    def test_clash_with_two_patients(self):
        prescA = Prescription(date(2020, 7, 1), 20)
        prescB = Prescription(date(2020, 7, 10), 4)
        prescC = Prescription(date(2020, 7, 10), 10)
        medA = Medicine("A")
        medB = Medicine("B")
        medC = Medicine("C")

        medA.add_prescription(prescA)
        medB.add_prescription(prescB)
        medC.add_prescription(prescC)

        patientA = Patient()
        patientB = Patient()
        patientA.add_medicine(medA)
        patientB.add_medicine(medA)
        patientB.add_medicine(medB)
        patientA.add_medicine(medC)
        patientB.add_medicine(medC)
        self.assertEqual(patientA.clash(["A", "B"], 90), [])