l.s.j.t.t.TestJob(TestCaseWithFactory) : class documentation

Part of lp.services.job.tests.test_job View In Hierarchy

Ensure Job behaves as intended.
Method test_implements_IJob Job should implement IJob.
Method test_default_status The default status should be WAITING.
Method test_stores_requester Undocumented
Method test_createMultiple_creates_requested_number_of_jobs Undocumented
Method test_createMultiple_returns_valid_job_ids Undocumented
Method test_createMultiple_sets_status_to_WAITING Undocumented
Method test_createMultiple_sets_requester Undocumented
Method test_createMultiple_defaults_requester_to_None Undocumented
Method test_start Job.start should update the object appropriately.
Method test_start_increments_attempt_count Job.start should increment the attempt count.
Method test_start_when_completed_is_invalid When a job is completed, attempting to start is invalid.
Method test_start_when_failed_is_invalid When a job is failed, attempting to start is invalid.
Method test_start_when_running_is_invalid When a job is running, attempting to start is invalid.
Method test_complete Job.complete should update the Job appropriately.
Method test_complete_when_waiting_is_invalid When a job is waiting, attempting to complete is invalid.
Method test_complete_when_completed_is_invalid When a job is completed, attempting to complete is invalid.
Method test_complete_when_failed_is_invalid When a job is failed, attempting to complete is invalid.
Method test_fail Job.fail should update the Job appropriately.
Method test_fail_when_waiting_is_invalid When a job is waiting, attempting to fail is invalid.
Method test_fail_when_completed_is_invalid When a job is completed, attempting to fail is invalid.
Method test_fail_when_failed_is_invalid When a job is failed, attempting to fail is invalid.
Method test_queue Job.queue should update the job appropriately.
Method test_queue_clears_lease_expires Queueing a job releases its lease.
Method test_suspend A job that is in the WAITING state can be suspended.
Method test_suspend_when_running When a job is running, attempting to suspend is valid.
Method test_suspend_when_completed When a job is completed, attempting to suspend is invalid.
Method test_suspend_when_failed When a job is failed, attempting to suspend is invalid.
Method test_resume A job that is suspended can be resumed.
Method test_resume_clears_lease_expires A job that resumes should null out the lease_expires.
Method test_resume_when_running When a job is running, attempting to resume is invalid.
Method test_resume_when_completed When a job is completed, attempting to resume is invalid.
Method test_resume_when_failed When a job is failed, attempting to resume is invalid.
Method test_is_pending is_pending is True when the job can possibly complete.
Method test_is_runnable_when_failed is_runnable is false when the job is not WAITING.
Method test_is_runnable_when_scheduled_in_future is_runnable is false when the job is scheduled in the future.
Method test_is_runnable_when_scheduled_in_past is_runnable is true when the job is scheduled in the past.
Method test_is_runnable_when_not_scheduled is_runnable is true when no explicit schedule has been requested.
Method test_start_manages_transactions Undocumented
Method test_complete_manages_transactions Undocumented
Method test_fail_manages_transactions Undocumented
Method test_queue_manages_transactions Undocumented
Method test_suspend_manages_transactions Undocumented

Inherited from TestCaseWithFactory:

Method setUp Undocumented
Method getUserBrowser Return a Browser logged in as a fresh user, maybe opened at url.
Method getNonRedirectingBrowser Undocumented
Method createBranchAtURL Create a branch at the supplied URL.
Method create_branch_and_tree Create a database branch, bzr branch and bzr checkout.
Method createBzrBranch Create a bzr branch for a database branch.
Static Method getBranchPath Return the path of the branch in the mirrored area.
Method useTempBzrHome Undocumented
Method useBzrBranches Prepare for using bzr branches.

Inherited from TestCase (via TestCaseWithFactory):

Method becomeDbUser Commit, then log into the database as dbuser.
Method __str__ The string representation of a test is its id.
Method useContext Use the supplied context in this test.
Method makeTemporaryDirectory Create a temporary directory, and return its path.
Method installKarmaRecorder Set up and return a KarmaRecorder.
Method assertProvides Assert 'obj' correctly provides 'interface'.
Method assertNotifies Assert that a callable performs a given notification.
Method assertNoNotification Assert that no notifications are generated by the callable.
Method assertSqlAttributeEqualsDate Fail unless the value of the attribute is equal to the date.
Method assertTextMatchesExpressionIgnoreWhitespace Undocumented
Method assertIsInstance Assert that an instance is an instance of assert_class.
Method assertIsNot Assert that expected is not the same object as observed.
Method assertContentEqual Assert that 'iter1' has the same content as 'iter2'.
Method assertRaisesWithContent Check if the given exception is raised with given content.
Method assertBetween Assert that 'variable' is strictly between two boundaries.
Method assertVectorEqual Apply assertEqual to all given pairs in one go.
Method expectedLog Expect a log to be written that matches the regex.
Method pushConfig Push some key-value pairs into a section of the config.
Method attachOopses Undocumented
Method attachLibrarianLog Include the logChunks from fixture in the test details.
Method assertStatementCount Assert that the expected number of SQL statements occurred.
Method useTempDir Use a temporary directory for this test.
Method assertEmailHeadersEqual Assert that two email headers are equal.
Method assertStartsWith Undocumented
Method assertEndsWith Asserts that s ends with suffix.
Method checkPermissions Check if the used_permissions match expected_permissions.
Method assertEmailQueueLength Pop the email queue, assert its length, and return it.
Method _unfoldEmailHeader Unfold a multiline email header.
def test_implements_IJob(self):
Job should implement IJob.
def test_default_status(self):
The default status should be WAITING.
def test_stores_requester(self):
Undocumented
def test_createMultiple_creates_requested_number_of_jobs(self):
Undocumented
def test_createMultiple_returns_valid_job_ids(self):
Undocumented
def test_createMultiple_sets_status_to_WAITING(self):
Undocumented
def test_createMultiple_sets_requester(self):
Undocumented
def test_createMultiple_defaults_requester_to_None(self):
Undocumented
def test_start(self):
Job.start should update the object appropriately.

It should set date_started, clear date_finished, and set the status to RUNNING.

def test_start_increments_attempt_count(self):
Job.start should increment the attempt count.
def test_start_when_completed_is_invalid(self):
When a job is completed, attempting to start is invalid.
def test_start_when_failed_is_invalid(self):
When a job is failed, attempting to start is invalid.
def test_start_when_running_is_invalid(self):
When a job is running, attempting to start is invalid.
def test_complete(self):
Job.complete should update the Job appropriately.

It should set date_finished and set the job status to COMPLETED.

def test_complete_when_waiting_is_invalid(self):
When a job is waiting, attempting to complete is invalid.
def test_complete_when_completed_is_invalid(self):
When a job is completed, attempting to complete is invalid.
def test_complete_when_failed_is_invalid(self):
When a job is failed, attempting to complete is invalid.
def test_fail(self):
Job.fail should update the Job appropriately.

It should set date_finished and set the job status to FAILED.

def test_fail_when_waiting_is_invalid(self):
When a job is waiting, attempting to fail is invalid.
def test_fail_when_completed_is_invalid(self):
When a job is completed, attempting to fail is invalid.
def test_fail_when_failed_is_invalid(self):
When a job is failed, attempting to fail is invalid.
def test_queue(self):
Job.queue should update the job appropriately.

It should set date_finished, and set status to WAITING.

def test_queue_clears_lease_expires(self):
Queueing a job releases its lease.
def test_suspend(self):
A job that is in the WAITING state can be suspended.
def test_suspend_when_running(self):
When a job is running, attempting to suspend is valid.
def test_suspend_when_completed(self):
When a job is completed, attempting to suspend is invalid.
def test_suspend_when_failed(self):
When a job is failed, attempting to suspend is invalid.
def test_resume(self):
A job that is suspended can be resumed.
def test_resume_clears_lease_expires(self):
A job that resumes should null out the lease_expires.
def test_resume_when_running(self):
When a job is running, attempting to resume is invalid.
def test_resume_when_completed(self):
When a job is completed, attempting to resume is invalid.
def test_resume_when_failed(self):
When a job is failed, attempting to resume is invalid.
def test_is_pending(self):
is_pending is True when the job can possibly complete.
def test_is_runnable_when_failed(self):
is_runnable is false when the job is not WAITING.
def test_is_runnable_when_scheduled_in_future(self):
is_runnable is false when the job is scheduled in the future.
def test_is_runnable_when_scheduled_in_past(self):
is_runnable is true when the job is scheduled in the past.
def test_is_runnable_when_not_scheduled(self):
is_runnable is true when no explicit schedule has been requested.
def test_start_manages_transactions(self):
Undocumented
def test_complete_manages_transactions(self):
Undocumented
def test_fail_manages_transactions(self):
Undocumented
def test_queue_manages_transactions(self):
Undocumented
def test_suspend_manages_transactions(self):
Undocumented
API Documentation for Launchpad, generated by pydoctor at 2022-06-16 00:00:12.