~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/services/job/tests/test_runner.py

  • Committer: Launchpad Patch Queue Manager
  • Date: 2011-11-17 02:47:41 UTC
  • mfrom: (14302.1.8 oops-polish)
  • Revision ID: launchpad@pqm.canonical.com-20111117024741-dy6egn5coasgor9q
[r=jtv, wgrant][bug=885974, 888866, 890975,
 890976] Merge in and integrate the latest set of OOPS improvements
 including backtraces from every query in OOPS reports.

Show diffs side-by-side

added added

removed removed

Lines of Context:
192
192
        self.assertEqual(JobStatus.COMPLETED, job_2.job.status)
193
193
        oops = self.oopses[-1]
194
194
        self.assertIn('Fake exception.  Foobar, I say!', oops['tb_text'])
195
 
        self.assertEqual(1, len(oops['req_vars']))
196
 
        self.assertEqual("{'foo': 'bar'}", oops['req_vars'][0][1])
 
195
        self.assertEqual(["{'foo': 'bar'}"], oops['req_vars'].values())
197
196
 
198
197
    def test_oops_messages_used_when_handling(self):
199
198
        """Oops messages should appear even when exceptions are handled."""
209
208
        runner = JobRunner([job_1, job_2])
210
209
        runner.runAll()
211
210
        oops = self.oopses[-1]
212
 
        self.assertEqual(1, len(oops['req_vars']))
213
 
        self.assertEqual("{'foo': 'bar'}", oops['req_vars'][0][1])
 
211
        self.assertEqual(["{'foo': 'bar'}"], oops['req_vars'].values())
214
212
 
215
213
    def test_runAll_aborts_transaction_on_error(self):
216
214
        """runAll should abort the transaction on oops."""