self.compiler = compiler
self.rev = rev
+ def __repr__(self):
+ if self.rev:
+ return "<%s: revision %s of %s on %s using %s>" % (self.__class__.__name__, self.rev, self.tree, self.host, self.compiler)
+ else:
+ return "<%s: %s on %s using %s>" % (self.__class__.__name__, self.tree, self.host, self.compiler)
+
def remove(self):
os.unlink(self.basename + ".log")
if os.path.exists(self.basename+".err"):
# $st->execute($tree, $rev, $commit, $host, $compiler, $checksum, $stat->ctime, $status_html)
def get_previous_revision(self, tree, host, compiler, revision):
- raise NoSuchBuildError(self):
+ raise NoSuchBuildError(tree, host, compiler, revision)
"""
def get_previous_revision(self, tree, host, compiler, revision):
self.assertFalse(os.path.exists(path))
self.assertRaises(data.NoSuchBuildError, self.x.get_build, "tdb", "charis", "cc", "12")
+ def test_build_repr(self):
+ path = self.create_mock_logfile("tdb", "charis", "cc", "12")
+ build = self.x.get_build("tdb", "charis", "cc", "12")
+ self.assertEquals("<%s: revision 12 of tdb on charis using cc>" % build.__class__.__name__, repr(build))
+
def test_build_age_mtime(self):
path = self.create_mock_logfile("tdb", "charis", "cc", "12")
# Set mtime to something in the past
try:
prev_rev = buildfarm.builds.get_previous_revision(build.tree, build.host, build.compiler, rev)
- except data.NoSuchBuild:
+ except data.NoSuchBuildError:
# Can't send a nastygram until there are 2 builds..
continue
else: