def test_update_status(self, mock_future, mock_save): mock_future.status = 'finished' # Create DaskJob djob = DaskJob(name='test_dj', user=self.user, label='label', scheduler=self.scheduler) # call the function djob._update_status() # check the results mock_save.assert_called()
def test_update_status_exception(self, mock_future, mock_save, mock_log): # Invalid status key mock_future.status = 'foo' # Create DaskJob djob = DaskJob(name='test_dj', user=self.user, label='label', scheduler=self.scheduler) # call the function djob._update_status() # check the results mock_log.error.assert_called_with('Unknown Dask Status: "foo"')
def test_update_status(self, mock_future, mock_save): mock_future.status = 'finished' # Create DaskJob djob = DaskJob( name='test_dj', user=self.user, label='label', scheduler=self.scheduler ) # call the function djob._update_status() # check the results mock_save.assert_called()
def test_update_status_exception(self, mock_future, mock_save, mock_log): # Invalid status key mock_future.status = 'foo' # Create DaskJob djob = DaskJob( name='test_dj', user=self.user, label='label', scheduler=self.scheduler ) # call the function djob._update_status() # check the results mock_log.error.assert_called_with('Unknown Dask Status: "foo"')
def test_update_status_with_no_future(self): # Create DaskJob djob = DaskJob(name='test_dj', user=self.user, label='label', scheduler=self.scheduler) # check the results self.assertIsNone(djob._update_status())
def test_update_status_with_no_future(self): # Create DaskJob djob = DaskJob(name='test_dj', user=self.user, label='label', scheduler=self.scheduler) # check the results self.assertIsNone(djob._update_status())