예제 #1
0
    def test_get_job_candidate_first(self):
        repo = Repo(dal.session)
        job = repo.get_incartjob('2')
        candidate: Doctor = repo.get_job_candidate(job)

        self.assertIsNotNone(candidate)
        self.assertTrue(isinstance(candidate, Doctor))
        self.assertEqual(candidate.id, 1)
예제 #2
0
    def test_get_job_none_candidate(self):
        repo = Repo(dal.session)
        doc3: Doctor = repo.get_doctor(id=96881373)  # Eugeny Bobylev
        doc3.is_active = False  # временно не доступен (temporarily unavailable)
        job: IncartJob = repo.get_incartjob(
            id="1")  # у этого задания есть 2 обращения к док 1 и 2
        doctor: Doctor = repo.get_job_candidate(job)

        self.assertIsNone(doctor)
예제 #3
0
 def get_candidate(self, job: IncartJob) -> Doctor:
     self.log_info("run: get_candidate")
     repo = Repo(self.dal.session)
     candidate: Doctor = repo.get_job_candidate(
         job)  # Бобылев Е.А. 96881373
     return candidate