def testModerateFailsTwo(self): build_history = { 'm1': { 'b1': [(1, False, 1)] }, 'm2': { 'b2': [(1, True, 1)] } } revisions = [1] candidate = lkgr_finder.FindLKGRCandidate(build_history, revisions, lkgr_finder.SvnRevisionCmp) self.assertEquals(candidate, None)
def testMultipleSuccess(self): build_history = { 'm1': { 'b1': [(1, False, 1), (2, True, 2), (3, False, 3), (4, True, 4), (5, True, 5)] }, 'm2': { 'b2': [(1, False, 1), (2, False, 2), (3, True, 3), (4, True, 4), (5, True, 5)] } } revisions = [1, 2, 3, 4, 5] candidate = lkgr_finder.FindLKGRCandidate(build_history, revisions, lkgr_finder.SvnRevisionCmp) self.assertEquals(candidate, 5)
def testSimpleSucceeds(self): build_history = {'m1': {'b1': [(1, True, 1)]}} revisions = [1] candidate = lkgr_finder.FindLKGRCandidate(build_history, revisions, lkgr_finder.SvnRevisionCmp) self.assertEquals(candidate, 1)