~fginther/jenkins-launchpad-plugin/config-file-trigger

« back to all changes in this revision

Viewing changes to tests/test_autoland.py

  • Committer: Tarmac
  • Author(s): Martin Mrazik
  • Date: 2012-09-18 06:38:00 UTC
  • mfrom: (44.2.5 multiple-ppas)
  • Revision ID: tarmac-20120918063800-kgu88ddxeo0oukcf
Adding support for dput-ing into multiple (comma separated) ppas.. Approved by Sergio Schvezov, jenkins.

Show diffs side-by-side

added added

removed removed

Lines of Context:
116
116
            self.assertTrue(self.LaunchpadTrigger.close_bugs.call_count == 1)
117
117
            self.MergeProposalReview.unlock.assert_called_once_with()
118
118
 
 
119
class TestAutolandWithMultipleDputs(TestAutolandForMergeAndCommit):
 
120
    def test_multiple_dputs(self):
 
121
        sys_argv = ['autoland.py', '-r', 'PASSED',
 
122
                    '-v', '123', '-m', 'url', '-p', 'ppa:myppa,ppa:myppa2', 
 
123
                    '-d', 'quantal,precise']
 
124
        dputRunner = MagicMock()
 
125
        with patch('sys.argv', sys_argv), \
 
126
             util.captured_stderr() as stderr, \
 
127
             patch('autoland.DputRunner', new=dputRunner):
 
128
            self.assertTrue(autoland.main() == 0)
 
129
            ppas_expected = ['ppa:myppa', 'ppa:myppa2'] 
 
130
            distributions_expected = ['quantal', 'precise']
 
131
            self.assertEquals(ppas_expected, dputRunner.call_args[1]['ppas'])
 
132
            self.assertEquals(distributions_expected,
 
133
                              dputRunner.call_args[1]['distributions'])
119
134
 
120
135
class TestAutolandMergeCommitAndDput(TestAutolandForMergeAndCommit):
121
136
    def setUp(self):