"""Gets a buildid for a given type of build"""
self.poll()
KNOWNBUILDTYPES = [
+ "lastStableBuild",
"lastSuccessfulBuild",
"lastBuild",
"lastCompletedBuild",
"""
return self._buildid_for_type("firstBuild")
+ def get_last_stable_buildnumber(self):
+ """
+ Get the numerical ID of the last stable build.
+ """
+ return self._buildid_for_type("lastStableBuild")
+
def get_last_good_buildnumber(self):
"""
Get the numerical ID of the last good build.
"""
return self._data.get('nextBuildNumber', 0)
+ def get_last_stable_build(self):
+ """
+ Get the last stable build
+ """
+ bn = self.get_last_stable_buildnumber()
+ return self.get_build(bn)
+
def get_last_good_build(self):
"""
Get the last good build
ret = self.j.get_last_good_buildnumber()
self.assertTrue(ret, 3)
+ @mock.patch.object(JenkinsBase, 'get_data', fakeGetData)
+ def test_get_last_stable_buildnumber(self):
+ ret = self.j.get_last_stable_buildnumber()
+ self.assertTrue(ret, 3)
+
@mock.patch.object(JenkinsBase, 'get_data', fakeGetData)
def test_get_last_failed_buildnumber(self):
with self.assertRaises(NoBuildData):