~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-08-19 14:25:39 UTC
  • mfrom: (13701.1.6 twisted-logging)
  • Revision ID: launchpad@pqm.canonical.com-20110819142539-tkijmt573axhtnis
[r=jcsackett][bug=820510] Support --log-twisted flag in
 merge-proposal-jobs script.

Show diffs side-by-side

added added

removed removed

Lines of Context:
647
647
            cronscript.main()
648
648
        finally:
649
649
            errorlog.globalErrorUtility = old_errorlog
 
650
 
 
651
    def test_log_twisted_option_for_twisted_runner(self):
 
652
        """TwistedJobRunner creates --log-twisted flag."""
 
653
        jcs = JobCronScript(TwistedJobRunner, test_args=[])
 
654
        self.assertIsNot(None, getattr(jcs.options, 'log_twisted', None))
 
655
 
 
656
    def test_no_log_twisted_option_for_plain_runner(self):
 
657
        """JobRunner has no --log-twisted flag."""
 
658
        jcs = JobCronScript(JobRunner, test_args=[])
 
659
        self.assertIs(None, getattr(jcs.options, 'log_twisted', None))
 
660
 
 
661
    def test_log_twisted_flag(self):
 
662
        """--log-twisted sets JobCronScript.log_twisted True."""
 
663
        jcs = JobCronScript(TwistedJobRunner, test_args=['--log-twisted'])
 
664
        self.assertTrue(jcs.log_twisted)
 
665
 
 
666
    def test_no_log_twisted_flag(self):
 
667
        """No --log-twisted sets JobCronScript.log_twisted False."""
 
668
        jcs = JobCronScript(TwistedJobRunner, test_args=[])
 
669
        self.assertFalse(jcs.log_twisted)