2929
3030
3131class TestJobsOnTestingMethod (JobCommonCase ):
32- """ Test Job """
32+ """Test Job"""
3333
3434 def test_new_job (self ):
3535 """
@@ -39,22 +39,22 @@ def test_new_job(self):
3939 self .assertEqual (test_job .func .__func__ , self .method .__func__ )
4040
4141 def test_eta (self ):
42- """ When an `eta` is datetime, it uses it """
42+ """When an `eta` is datetime, it uses it"""
4343 now = datetime .now ()
4444 method = self .env ["res.users" ].mapped
4545 job_a = Job (method , eta = now )
4646 self .assertEqual (job_a .eta , now )
4747
4848 def test_eta_integer (self ):
49- """ When an `eta` is an integer, it adds n seconds up to now """
49+ """When an `eta` is an integer, it adds n seconds up to now"""
5050 datetime_path = "odoo.addons.queue_job.job.datetime"
5151 with mock .patch (datetime_path , autospec = True ) as mock_datetime :
5252 mock_datetime .now .return_value = datetime (2015 , 3 , 15 , 16 , 41 , 0 )
5353 job_a = Job (self .method , eta = 60 )
5454 self .assertEqual (job_a .eta , datetime (2015 , 3 , 15 , 16 , 42 , 0 ))
5555
5656 def test_eta_timedelta (self ):
57- """ When an `eta` is a timedelta, it adds it up to now """
57+ """When an `eta` is a timedelta, it adds it up to now"""
5858 datetime_path = "odoo.addons.queue_job.job.datetime"
5959 with mock .patch (datetime_path , autospec = True ) as mock_datetime :
6060 mock_datetime .now .return_value = datetime (2015 , 3 , 15 , 16 , 41 , 0 )
@@ -324,7 +324,7 @@ def test_job_identity_key_func_exact(self):
324324
325325
326326class TestJobs (JobCommonCase ):
327- """ Test jobs on other methods or with different job configuration """
327+ """Test jobs on other methods or with different job configuration"""
328328
329329 def test_description (self ):
330330 """If no description is given to the job, it
@@ -343,7 +343,7 @@ def test_description(self):
343343 self .assertEqual (job_a .description , description )
344344
345345 def test_retry_pattern (self ):
346- """ When we specify a retry pattern, the eta must follow it"""
346+ """When we specify a retry pattern, the eta must follow it"""
347347 datetime_path = "odoo.addons.queue_job.job.datetime"
348348 method = self .env ["test.queue.job" ].job_with_retry_pattern
349349 with mock .patch (datetime_path , autospec = True ) as mock_datetime :
@@ -371,7 +371,7 @@ def test_retry_pattern(self):
371371 self .assertEqual (test_job .eta , datetime (2015 , 6 , 1 , 15 , 15 , 0 ))
372372
373373 def test_retry_pattern_no_zero (self ):
374- """ When we specify a retry pattern without 0, uses RETRY_INTERVAL"""
374+ """When we specify a retry pattern without 0, uses RETRY_INTERVAL"""
375375 method = self .env ["test.queue.job" ].job_with_retry_pattern__no_zero
376376 test_job = Job (method , max_retries = 0 )
377377 test_job .retry += 1
@@ -400,7 +400,7 @@ def test_job_delay_model_method_multi(self):
400400 self .assertEqual (["test1" , "test2" ], job_instance .perform ())
401401
402402 def test_job_identity_key_no_duplicate (self ):
403- """ If a job with same identity key in queue do not add a new one """
403+ """If a job with same identity key in queue do not add a new one"""
404404 id_key = "e294e8444453b09d59bdb6efbfec1323"
405405 rec1 = self .env ["test.queue.job" ].create ({"name" : "test1" })
406406 job_1 = rec1 .with_delay (identity_key = id_key ).mapped ("name" )
@@ -410,7 +410,7 @@ def test_job_identity_key_no_duplicate(self):
410410 self .assertEqual (job_2 .uuid , job_1 .uuid )
411411
412412 def test_job_with_mutable_arguments (self ):
413- """ Job with mutable arguments do not mutate on perform() """
413+ """Job with mutable arguments do not mutate on perform()"""
414414 delayable = self .env ["test.queue.job" ].with_delay ()
415415 job_instance = delayable .job_alter_mutable ([1 ], mutable_kwarg = {"a" : 1 })
416416 self .assertTrue (job_instance )
@@ -531,7 +531,7 @@ def test_job_change_user_id(self):
531531
532532
533533class TestJobStorageMultiCompany (common .TransactionCase ):
534- """ Test storage of jobs """
534+ """Test storage of jobs"""
535535
536536 def setUp (self ):
537537 super (TestJobStorageMultiCompany , self ).setUp ()
0 commit comments