def test_update_status_vcp(self, mock_co, mock_tup): tethysjob = CondorBase( name='test_tethysjob', description='test_description', user=self.user, label='test_label', scheduler=self.scheduler, execute_time=django_timezone.now(), ) mock_tup.return_value = True mock_co.status = 'Various-Complete' tethysjob.update_status() # Check result self.assertIsNotNone(tethysjob.last_status_update) self.assertIsInstance(tethysjob.last_status_update, datetime) self.assertIsNotNone(tethysjob.completion_time) self.assertIsInstance(tethysjob.completion_time, datetime)
def test_update_status_run(self, mock_co, mock_tup): tethysjob = CondorBase( name='test_tethysjob', description='test_description', user=self.user, label='test_label', scheduler=self.scheduler, execute_time=dt.now(), ) mock_tup.return_value = True mock_co.status = 'Running' tethysjob.update_status() # Check result self.assertIsNotNone(tethysjob.last_status_update) self.assertIsInstance(tethysjob.last_status_update, datetime) self.assertIsNotNone(tethysjob.start_time) self.assertIsInstance(tethysjob.start_time, datetime)
def test_update_status_vcp(self, mock_co, mock_tup): tethysjob = CondorBase( name='test_tethysjob', description='test_description', user=self.user, label='test_label', scheduler=self.scheduler, execute_time=django_timezone.now(), ) mock_tup.return_value = True mock_co.status = 'Various-Complete' tethysjob.update_status() # Check result self.assertIsNotNone(tethysjob.last_status_update) self.assertIsInstance(tethysjob.last_status_update, datetime) self.assertIsNotNone(tethysjob.completion_time) self.assertIsInstance(tethysjob.completion_time, datetime)
def test_update_status_run(self, mock_co, mock_tup): tethysjob = CondorBase( name='test_tethysjob', description='test_description', user=self.user, label='test_label', scheduler=self.scheduler, execute_time=dt.now(), ) mock_tup.return_value = True mock_co.status = 'Running' tethysjob.update_status() # Check result self.assertIsNotNone(tethysjob.last_status_update) self.assertIsInstance(tethysjob.last_status_update, datetime) self.assertIsNotNone(tethysjob.start_time) self.assertIsInstance(tethysjob.start_time, datetime)