def test_wait_for_labeling_job_creation(self):
    mock_client = MagicMock()
    mock_client.describe_labeling_job.side_effect = [{'LabelingJobStatus': 'InProgress'}, {'LabelingJobStatus': 'Failed'}, {'LabelingJobStatus': 'Should not be called'}]
    with self.assertRaises(Exception):
        _utils.wait_for_labeling_job(mock_client, 'test-batch', 0)
    self.assertEqual(mock_client.describe_labeling_job.call_count, 2)
def test_wait_for_labeling_job_creation(self):
    mock_client = MagicMock()
    mock_client.describe_labeling_job.side_effect = [{'LabelingJobStatus': 'InProgress'}, {'LabelingJobStatus': 'Failed'}, {'LabelingJobStatus': 'Should not be called'}]
    with self.assertRaises(Exception):
        _utils.wait_for_labeling_job(mock_client, 'test-batch', 0)
    self.assertEqual(mock_client.describe_labeling_job.call_count, 2)