[Buildbot-commits] buildbot/buildbot/test test_status.py,1.9,1.10
Brian Warner
warner at users.sourceforge.net
Fri Oct 15 16:59:46 UTC 2004
Update of /cvsroot/buildbot/buildbot/buildbot/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8340/buildbot/test
Modified Files:
test_status.py
Log Message:
* buildbot/interfaces.py (IBuildStatus.getTestResults): new method
to retrieve a dict of accumulated test results
(ITestResult): define what a single test result can do
* buildbot/status/builder.py (TestResult): implement ITestResult
(BuildStatus.getTestResults): retrieve dict of TestResults
(BuildStatus.addTestResult): add TestResults
* buildbot/test/test_status.py (Results.testAddResults): test it
Index: test_status.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_status.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- test_status.py 1 Oct 2004 01:38:06 -0000 1.9
+++ test_status.py 15 Oct 2004 16:59:43 -0000 1.10
@@ -5,6 +5,7 @@
from twisted.internet import defer
from twisted.trial import unittest
dr = unittest.deferredResult
+from twisted.python import components
from buildbot import interfaces
from buildbot.status import mail, builder
@@ -211,3 +212,25 @@
e.decay = 0.1
self.failUnlessEqual(e.wavg(3, 4), 3.1)
+
+class Results(unittest.TestCase):
+
+ def testAddResults(self):
+ b = builder.BuildStatus(None, 12)
+ testname = ("buildbot", "test", "test_status", "Results",
+ "testAddResults")
+ r1 = builder.TestResult(name=testname,
+ results=builder.SUCCESS,
+ text=["passed"],
+ logs={'output': ""},
+ )
+ b.addTestResult(r1)
+
+ res = b.getTestResults()
+ self.failUnlessEqual(res.keys(), [testname])
+ t = res[testname]
+ self.failUnless(components.implements(t, interfaces.ITestResult))
+ self.failUnlessEqual(t.getName(), testname)
+ self.failUnlessEqual(t.getResults(), builder.SUCCESS)
+ self.failUnlessEqual(t.getText(), ["passed"])
+ self.failUnlessEqual(t.getLogs(), {'output': ""})
More information about the Commits
mailing list