Exemplo n.º 1
0
 def test_job_refresh(self):
     Job.job_refresh('tests.test_base_job.EmptyDummyJob', (), {}, ('foo', ),
                     {})
     assert EmptyDummyJob().get('foo') is not None
Exemplo n.º 2
0
 def test_job_refresh_perform_error(self, logger_mock):
     Job.job_refresh('tests.test_base_job.FailJob', (), {}, (), {})
     assert 'Error running job' in (logger_mock.exception.call_args[0][0])
     assert isinstance(logger_mock.exception.call_args[0][1], Exception)
Exemplo n.º 3
0
 def test_job_refresh_unkown_jobclass(self, logger_mock):
     Job.job_refresh('foomodule.BarJob', (), {}, (), {})
     assert 'Unable to construct %s with' in (
         logger_mock.error.call_args[0][0])
     assert logger_mock.error.call_args[0][1] == 'foomodule.BarJob'
Exemplo n.º 4
0
 def test_job_refresh(self):
     Job.job_refresh('tests.test_base_job.EmptyDummyJob', (), {}, ('foo',), {})
     assert EmptyDummyJob().get('foo') is not None
Exemplo n.º 5
0
 def test_job_refresh_perform_error(self, logger_mock):
     Job.job_refresh('tests.test_base_job.FailJob', (), {}, (), {})
     assert 'Error running job' in (logger_mock.exception.call_args[0][0])
     assert isinstance(logger_mock.exception.call_args[0][1], Exception)
Exemplo n.º 6
0
 def test_job_refresh_unkown_jobclass(self, logger_mock):
     Job.job_refresh('foomodule.BarJob', (), {}, (), {})
     assert 'Unable to construct %s with' in (logger_mock.error.call_args[0][0])
     assert logger_mock.error.call_args[0][1] == 'foomodule.BarJob'