Best Python code snippet using autotest_python
monitor_db_functional_test.py
Source:monitor_db_functional_test.py  
...440        self._check_host_status(host, HostStatus.REPAIRING)441        self.mock_drone_manager.finish_process(_PidfileType.REPAIR)442        self._run_dispatcher()443        self._check_host_status(host, HostStatus.READY)444    def _setup_for_do_not_verify(self):445        self._initialize_test()446        job, queue_entry = self._make_job_and_queue_entry()447        queue_entry.host.protection = host_protections.Protection.DO_NOT_VERIFY448        queue_entry.host.save()449        return queue_entry450    def test_do_not_verify_job(self):451        queue_entry = self._setup_for_do_not_verify()452        self._run_dispatcher() # runs job directly453        self._finish_job(queue_entry)454    def test_do_not_verify_job_with_cleanup(self):455        queue_entry = self._setup_for_do_not_verify()456        queue_entry.job.reboot_before = model_attributes.RebootBefore.ALWAYS457        queue_entry.job.save()458        self._run_dispatcher() # cleanup459        self.mock_drone_manager.finish_process(_PidfileType.CLEANUP)460        self._run_dispatcher() # job461        self._finish_job(queue_entry)462    def test_do_not_verify_pre_job_cleanup_failure(self):463        queue_entry = self._setup_for_do_not_verify()464        queue_entry.job.reboot_before = model_attributes.RebootBefore.ALWAYS465        queue_entry.job.save()466        self._run_dispatcher() # cleanup467        self.mock_drone_manager.finish_process(_PidfileType.CLEANUP,468                                               exit_status=256)469        self._run_dispatcher() # failure ignored; job runs470        self._finish_job(queue_entry)471    def test_do_not_verify_post_job_cleanup_failure(self):472        queue_entry = self._setup_for_do_not_verify()473        queue_entry.job.reboot_after = model_attributes.RebootAfter.ALWAYS474        queue_entry.job.save()475        self._run_post_job_cleanup_failure_up_to_repair(queue_entry,476                                                        include_verify=False)477        # failure ignored, host still set to Ready478        self._check_statuses(queue_entry, HqeStatus.COMPLETED, HostStatus.READY)479        self._run_dispatcher() # nothing else runs480        self._assert_nothing_is_running()481    def test_do_not_verify_requested_reverify_failure(self):482        host = self._create_reverify_request()483        host.protection = host_protections.Protection.DO_NOT_VERIFY484        host.save()485        self._run_dispatcher()486        self.mock_drone_manager.finish_process(_PidfileType.VERIFY,...monitor_db_functional_unittest.py
Source:monitor_db_functional_unittest.py  
...422        self._check_host_status(host, HostStatus.REPAIRING)423        self.mock_drone_manager.finish_process(_PidfileType.REPAIR)424        self._run_dispatcher()425        self._check_host_status(host, HostStatus.READY)426    def _setup_for_do_not_verify(self):427        self._initialize_test()428        job, queue_entry = self._make_job_and_queue_entry()429        queue_entry.host.protection = host_protections.Protection.DO_NOT_VERIFY430        queue_entry.host.save()431        return queue_entry432    def test_do_not_verify_job(self):433        queue_entry = self._setup_for_do_not_verify()434        self._run_dispatcher()  # runs job directly435        self._finish_job(queue_entry)436    def test_do_not_verify_job_with_cleanup(self):437        queue_entry = self._setup_for_do_not_verify()438        queue_entry.job.reboot_before = model_attributes.RebootBefore.ALWAYS439        queue_entry.job.save()440        self._run_dispatcher()  # cleanup441        self.mock_drone_manager.finish_process(_PidfileType.CLEANUP)442        self._run_dispatcher()  # job443        self._finish_job(queue_entry)444    def test_do_not_verify_pre_job_cleanup_failure(self):445        queue_entry = self._setup_for_do_not_verify()446        queue_entry.job.reboot_before = model_attributes.RebootBefore.ALWAYS447        queue_entry.job.save()448        self._run_dispatcher()  # cleanup449        self.mock_drone_manager.finish_process(_PidfileType.CLEANUP,450                                               exit_status=256)451        self._run_dispatcher()  # failure ignored; job runs452        self._finish_job(queue_entry)453    def test_do_not_verify_post_job_cleanup_failure(self):454        queue_entry = self._setup_for_do_not_verify()455        self._run_post_job_cleanup_failure_up_to_repair(queue_entry,456                                                        include_verify=False)457        # failure ignored, host still set to Ready458        self._check_statuses(queue_entry, HqeStatus.COMPLETED, HostStatus.READY)459        self._run_dispatcher()  # nothing else runs460        self._assert_nothing_is_running()461    def test_do_not_verify_requested_reverify_failure(self):462        host = self._create_reverify_request()463        host.protection = host_protections.Protection.DO_NOT_VERIFY464        host.save()465        self._run_dispatcher()466        self.mock_drone_manager.finish_process(_PidfileType.VERIFY,467                                               exit_status=256)468        self._run_dispatcher()...Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!
