Ejemplo n.º 1
0
    def test_is_first_fix_any_any(self):
        tr = '4.8.0'
        bug_a = BugzillaBug(flexmock(
            id=1,
            keywords=constants.TRACKER_BUG_KEYWORDS,
            whiteboard='component:runc',
            product=constants.BUGZILLA_PRODUCT_OCP,
            target_release=['4.7.z'],
            status='RELEASE_PENDING'))
        bug_b = BugzillaBug(flexmock(
            id=2,
            keywords=constants.TRACKER_BUG_KEYWORDS,
            whiteboard='component:runc',
            product=constants.BUGZILLA_PRODUCT_OCP,
            target_release=[tr],
            status='ON_QA'))
        bug_c = BugzillaBug(flexmock(
            id=3,
            keywords=constants.TRACKER_BUG_KEYWORDS,
            whiteboard='component:crio',
            product=constants.BUGZILLA_PRODUCT_OCP,
            target_release=[tr],
            status='ON_QA'))
        tracker_bug_objs = [bug_a, bug_b, bug_c]
        tracker_bug_ids = [t.id for t in tracker_bug_objs]
        flaw_bug = BugzillaBug(flexmock(id=4, depends_on=tracker_bug_ids))

        flexmock(BugzillaBugTracker).should_receive("login")
        bug_tracker = BugzillaBugTracker({})
        bug_tracker.should_receive("get_bugs").with_args(tracker_bug_ids).and_return(tracker_bug_objs)

        expected = True
        actual = bzutil.is_first_fix_any(bug_tracker, flaw_bug, tr)
        self.assertEqual(expected, actual)
Ejemplo n.º 2
0
    def test_is_first_fix_any_no_valid_trackers(self):
        tr = '4.8.0'
        tracker_bug_ids = [1, 2]
        bug_a = BugzillaBug(flexmock(
            id=1,
            product=constants.BUGZILLA_PRODUCT_OCP,
            keywords=['foo'])
        )
        tracker_bug_objs = [bug_a]
        flaw_bug = BugzillaBug(flexmock(id=6, depends_on=tracker_bug_ids))

        flexmock(BugzillaBugTracker).should_receive("login")
        bug_tracker = BugzillaBugTracker({})
        bug_tracker.should_receive("get_bugs").with_args(tracker_bug_ids).and_return(tracker_bug_objs)

        expected = True
        actual = bzutil.is_first_fix_any(bug_tracker, flaw_bug, tr)
        self.assertEqual(expected, actual)
Ejemplo n.º 3
0
    def test_is_first_fix_any_missing_whiteboard_component(self):
        tr = '4.8.0'
        tracker_bug_ids = [1, 2]
        bug_a = BugzillaBug(flexmock(
            id=1,
            product=constants.BUGZILLA_PRODUCT_OCP,
            keywords=constants.TRACKER_BUG_KEYWORDS,
            whiteboard='', target_release=[tr]
        ))
        tracker_bug_objs = [bug_a]
        flaw_bug = BugzillaBug(flexmock(id=6, depends_on=tracker_bug_ids))

        flexmock(BugzillaBugTracker).should_receive("login")
        bug_tracker = BugzillaBugTracker({})
        bug_tracker.should_receive("get_bugs").with_args(tracker_bug_ids).and_return(tracker_bug_objs)

        expected = False
        actual = bzutil.is_first_fix_any(bug_tracker, flaw_bug, tr)
        self.assertEqual(expected, actual)