예제 #1
0
 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')
예제 #2
0
 def test_add(self):
     doc = Doctor('Earl')
     patient = Patient('Bob')
     doc.add(patient, '9:00')
     assert doc.schedule['9:00'] == patient
예제 #3
0
 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)
예제 #4
0
 def test_creation(self):
     doc = Doctor('Earl')
     assert doc.__str__() == 'Earl'
     assert doc.__repr__() == '<Doctor: Earl>'