def test_failure(self):
        with client.test_mode as t:
            t.register_json('/jobs/42/', {
                'elapsed': 1335024000.0,
                'failed': True,
                'status': 'failed',
            })
            with self.assertRaises(exc.JobFailure):
                with mock.patch.object(click, 'secho') as secho:
                    with mock.patch('tower_cli.models.base.is_tty') as tty:
                        tty.return_value = True
                        self.res.monitor(42)
                self.assertTrue(secho.call_count >= 1)
Establish that if the job has failed, that we raise the
dataset/ETHPy150Open ansible/tower-cli/tests/test_resources_job.py/MonitorTests.test_failure