def test_add_double_book_failure(self): doc = Doctor('Earl') patient_one = Patient('Bob') patient_two = Patient('Miho') doc.add(patient_one, '9:00') with pytest.raises(TimeError): doc.add(patient_two, '9:00')
def test_time_block_failure(self): doc = Doctor('Earl') patient = Patient('Bob') with pytest.raises(TimeError) as er: doc.add(patient, '9:67') assert 'This time cannot be used.' in str(er.value)
def test_add(self): doc = Doctor('Earl') patient = Patient('Bob') doc.add(patient, '9:00') assert doc.schedule['9:00'] == patient