def test_get_lp_bugs_with_unsupported_branch(self):
     lp = make_fake_lp(series=False, bugs=False)
     bugs = check_blockers.get_lp_bugs(lp, 'foo', ['blocker'])
     self.assertEqual({}, bugs)
     project = lp.projects['juju']
     project.getSeries.assert_called_with(name='foo')
     self.assertEqual(0, project.searchTasks.call_count)
示例#2
0
 def test_get_lp_bugs_with_unsupported_branch(self):
     lp = make_fake_lp(series=False, bugs=False)
     bugs = check_blockers.get_lp_bugs(lp, 'foo', ['blocker'])
     self.assertEqual({}, bugs)
     project = lp.projects['juju']
     project.getSeries.assert_called_with(name='foo')
     self.assertEqual(0, project.searchTasks.call_count)
 def test_update_bugs_with_dry_run(self):
     lp = make_fake_lp(series=False, bugs=True)
     bugs = check_blockers.get_lp_bugs(lp, 'master', ['blocker'])
     code, changes = check_blockers.update_bugs(bugs,
                                                'master',
                                                '1234',
                                                dry_run=True)
     self.assertEqual(0, bugs['54321'].lp_save.call_count)
示例#4
0
 def test_get_lp_bugs_without_blocking_bugs(self):
     lp = make_fake_lp(series=False, bugs=False)
     bugs = check_blockers.get_lp_bugs(lp, 'master', ['blocker'])
     self.assertEqual({}, bugs)
     project = lp.projects['juju']
     project.searchTasks.assert_called_with(
         status=check_blockers.BUG_STATUSES,
         importance=check_blockers.BUG_IMPORTANCES,
         tags=check_blockers.BUG_TAGS, tags_combinator='All')
示例#5
0
 def test_get_lp_bugs_with_master_branch(self):
     lp = make_fake_lp(series=False, bugs=True, tags=['blocker'])
     bugs = check_blockers.get_lp_bugs(lp, 'master', ['blocker'])
     self.assertEqual(['54321', '98765'], sorted(bugs.keys()))
     project = lp.projects['juju']
     self.assertEqual(0, project.getSeries.call_count)
     project.searchTasks.assert_called_with(
         status=check_blockers.BUG_STATUSES,
         importance=check_blockers.BUG_IMPORTANCES,
         tags=check_blockers.BUG_TAGS, tags_combinator='All')
 def test_get_lp_bugs_without_blocking_bugs(self):
     lp = make_fake_lp(series=False, bugs=False)
     bugs = check_blockers.get_lp_bugs(lp, 'master', ['blocker'])
     self.assertEqual({}, bugs)
     project = lp.projects['juju']
     project.searchTasks.assert_called_with(
         status=check_blockers.BUG_STATUSES,
         importance=check_blockers.BUG_IMPORTANCES,
         tags=check_blockers.BUG_TAGS,
         tags_combinator='All')
示例#7
0
 def test_update_bugs_skipped(self):
     lp = make_fake_lp(
         series=False, bugs=True, tags=['blocker', 'intermittent-failure'])
     bugs = check_blockers.get_lp_bugs(lp, 'master', ['blocker'])
     code, changes = check_blockers.update_bugs(
         bugs, 'master', '1234', dry_run=False)
     self.assertEqual(0, code)
     self.assertIn('Skipping intermittent-failure', changes)
     self.assertEqual('Triaged', bugs['54321'].status)
     self.assertEqual(0, bugs['54321'].lp_save.call_count)
     self.assertEqual(0, bugs['54321'].bug.newMessage.call_count)
 def test_get_lp_bugs_with_master_branch(self):
     lp = make_fake_lp(series=False, bugs=True, tags=['blocker'])
     bugs = check_blockers.get_lp_bugs(lp, 'master', ['blocker'])
     self.assertEqual(['54321', '98765'], sorted(bugs.keys()))
     project = lp.projects['juju']
     self.assertEqual(0, project.getSeries.call_count)
     project.searchTasks.assert_called_with(
         status=check_blockers.BUG_STATUSES,
         importance=check_blockers.BUG_IMPORTANCES,
         tags=check_blockers.BUG_TAGS,
         tags_combinator='All')
示例#9
0
 def test_get_lp_bugs_with_supported_branch(self):
     lp = make_fake_lp(series=True, bugs=True,
                       project_name='juju-core', tags=['blocker'])
     bugs = check_blockers.get_lp_bugs(lp, '1.20', ['blocker'])
     self.assertEqual(['54321', '98765'], sorted(bugs.keys()))
     project = lp.projects['juju-core']
     project.getSeries.assert_called_with(name='1.20')
     series = lp._target
     series.searchTasks.assert_called_with(
         status=check_blockers.BUG_STATUSES,
         importance=check_blockers.BUG_IMPORTANCES,
         tags=check_blockers.BUG_TAGS, tags_combinator='All')
 def test_update_bugs_skipped(self):
     lp = make_fake_lp(series=False,
                       bugs=True,
                       tags=['blocker', 'intermittent-failure'])
     bugs = check_blockers.get_lp_bugs(lp, 'master', ['blocker'])
     code, changes = check_blockers.update_bugs(bugs,
                                                'master',
                                                '1234',
                                                dry_run=False)
     self.assertEqual(0, code)
     self.assertIn('Skipping intermittent-failure', changes)
     self.assertEqual('Triaged', bugs['54321'].status)
     self.assertEqual(0, bugs['54321'].lp_save.call_count)
     self.assertEqual(0, bugs['54321'].bug.newMessage.call_count)
示例#11
0
 def test_update_bugs(self):
     lp = make_fake_lp(series=False, bugs=True, tags=['blocker'])
     bugs = check_blockers.get_lp_bugs(lp, 'master', ['blocker'])
     code, changes = check_blockers.update_bugs(
         bugs, 'master', '1234', dry_run=False)
     self.assertEqual(0, code)
     self.assertIn('Updated two', changes)
     self.assertEqual('Fix Released', bugs['54321'].status)
     self.assertEqual(1, bugs['54321'].lp_save.call_count)
     expected_subject = 'Fix Released in juju-core master'
     expected_content = (
         'Juju-CI verified that this issue is %s:\n'
         '    http://reports.vapour.ws/releases/1234' % expected_subject)
     bugs['54321'].bug.newMessage.assert_called_with(
         subject=expected_subject, content=expected_content)
 def test_get_lp_bugs_with_supported_branch(self):
     lp = make_fake_lp(series=True,
                       bugs=True,
                       project_name='juju-core',
                       tags=['blocker'])
     bugs = check_blockers.get_lp_bugs(lp, '1.20', ['blocker'])
     self.assertEqual(['54321', '98765'], sorted(bugs.keys()))
     project = lp.projects['juju-core']
     project.getSeries.assert_called_with(name='1.20')
     series = lp._target
     series.searchTasks.assert_called_with(
         status=check_blockers.BUG_STATUSES,
         importance=check_blockers.BUG_IMPORTANCES,
         tags=check_blockers.BUG_TAGS,
         tags_combinator='All')
 def test_update_bugs(self):
     lp = make_fake_lp(series=False, bugs=True, tags=['blocker'])
     bugs = check_blockers.get_lp_bugs(lp, 'master', ['blocker'])
     code, changes = check_blockers.update_bugs(bugs,
                                                'master',
                                                '1234',
                                                dry_run=False)
     self.assertEqual(0, code)
     self.assertIn('Updated two', changes)
     self.assertEqual('Fix Released', bugs['54321'].status)
     self.assertEqual(1, bugs['54321'].lp_save.call_count)
     expected_subject = 'Fix Released in juju-core master'
     expected_content = ('Juju-CI verified that this issue is %s:\n'
                         '    http://reports.vapour.ws/releases/1234' %
                         expected_subject)
     bugs['54321'].bug.newMessage.assert_called_with(
         subject=expected_subject, content=expected_content)
示例#14
0
 def test_update_bugs_with_dry_run(self):
     lp = make_fake_lp(series=False, bugs=True)
     bugs = check_blockers.get_lp_bugs(lp, 'master', ['blocker'])
     code, changes = check_blockers.update_bugs(
         bugs, 'master', '1234', dry_run=True)
     self.assertEqual(0, bugs['54321'].lp_save.call_count)
示例#15
0
 def test_get_lp_bugs_error(self):
     lp = make_fake_lp(series=False, bugs=True)
     with self.assertRaises(ValueError):
         check_blockers.get_lp_bugs(lp, 'master', [])
 def test_get_lp_bugs_error(self):
     lp = make_fake_lp(series=False, bugs=True)
     with self.assertRaises(ValueError):
         check_blockers.get_lp_bugs(lp, 'master', [])