Exemple #1
0
    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()
Exemple #2
0
    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"')
Exemple #3
0
    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()
Exemple #4
0
    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"')
Exemple #5
0
    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())
Exemple #6
0
    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())