[Buildbot-commits] buildbot/buildbot/test test_properties.py, 1.14, 1.15

Brian Warner warner at users.sourceforge.net
Thu May 22 22:13:04 UTC 2008


Update of /cvsroot/buildbot/buildbot/buildbot/test
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv17238/buildbot/test

Modified Files:
	test_properties.py 
Log Message:
[project @ #124:getProperty-returns-property-only.patch]
Change Property.getProperty to just return the property value, since
having getProperty return different things on different objects is
confusing.

Original author: dustin at v.igoro.us
Date: 2008-04-12 22:11:03+00:00

Index: test_properties.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/test/test_properties.py,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- test_properties.py	22 May 2008 22:12:57 -0000	1.14
+++ test_properties.py	22 May 2008 22:13:02 -0000	1.15
@@ -39,12 +39,12 @@
         self.failUnlessEqual(self.props['do-tests'], 1)
         self.failUnlessEqual(self.props['do-install'], 2)
         self.assertRaises(KeyError, lambda : self.props['do-nothing'])
-        self.failUnlessEqual(self.props.getProperty('do-install'), (2, 'scheduler'))
+        self.failUnlessEqual(self.props.getProperty('do-install'), 2)
 
     def testEmpty(self):
         # test the special case for Null
         self.props.setProperty("x", None, "hi")
-        self.failUnlessEqual(self.props.getProperty('x'), (None, 'hi'))
+        self.failUnlessEqual(self.props.getProperty('x'), None)
         self.failUnlessEqual(self.props['x'], '')
 
     def testUpdate(self):
@@ -52,8 +52,10 @@
         newprops = { 'a' : 1, 'b' : 2 }
         self.props.update(newprops, "new")
 
-        self.failUnlessEqual(self.props.getProperty('x'), (24, 'old'))
-        self.failUnlessEqual(self.props.getProperty('a'), (1, 'new'))
+        self.failUnlessEqual(self.props.getProperty('x'), 24)
+        self.failUnlessEqual(self.props.getPropertySource('x'), 'old')
+        self.failUnlessEqual(self.props.getProperty('a'), 1)
+        self.failUnlessEqual(self.props.getPropertySource('a'), 'new')
 
     def testUpdateFromProperties(self):
         self.props.setProperty("x", 24, "old")
@@ -62,8 +64,10 @@
         newprops.setProperty('b', 2, "new")
         self.props.updateFromProperties(newprops)
 
-        self.failUnlessEqual(self.props.getProperty('x'), (24, 'old'))
-        self.failUnlessEqual(self.props.getProperty('a'), (1, 'new'))
+        self.failUnlessEqual(self.props.getProperty('x'), 24)
+        self.failUnlessEqual(self.props.getPropertySource('x'), 'old')
+        self.failUnlessEqual(self.props.getProperty('a'), 1)
+        self.failUnlessEqual(self.props.getPropertySource('a'), 'new')
 
     # render() is pretty well tested by TestWithProperties
 





More information about the Commits mailing list