pitivi r1247 - in trunk: . tests
- From: blewis svn gnome org
- To: svn-commits-list gnome org
- Subject: pitivi r1247 - in trunk: . tests
- Date: Fri, 12 Sep 2008 00:21:22 +0000 (UTC)
Author: blewis
Date: Fri Sep 12 00:21:22 2008
New Revision: 1247
URL: http://svn.gnome.org/viewvc/pitivi?rev=1247&view=rev
Log:
reviewed by: <delete if not using a buddy>
* tests/testproxy.py:
* tests/test_proxy.py:
rename test suite so it is actually run
Added:
trunk/tests/test_proxy.py
Removed:
trunk/tests/testproxy.py
Modified:
trunk/ChangeLog
Added: trunk/tests/test_proxy.py
==============================================================================
--- (empty file)
+++ trunk/tests/test_proxy.py Fri Sep 12 00:21:22 2008
@@ -0,0 +1,48 @@
+import unittest
+import pitivi
+from pitivi.ui.util import ProxyItem
+import goocanvas
+
+class TestProxy(unittest.TestCase):
+ """
+ Tests that the proxy object functions propertyly
+ """
+
+ def setUp(self):
+ self.r = goocanas.Rect()
+ self.p = ProxyItem(delegate=r)
+
+ def tearDown(self):
+ self.r = None
+ self.p = None
+
+ def testDelegation(self):
+ self.p.set_delegate_property("x", 100)
+ self.p.set_delegate_property("y", 100)
+ self.assertEquals(r.x, p.x)
+ self.assertEquals(r.y, p.y)
+ self.assertEquals(r.x, 100)
+ self.assertEquals(r.y, 200)
+
+ def testDefault(self):
+ self.p.props.x = 100
+ self.p.props.y = 200
+ self.assertEquals(r.x, p.x)
+ self.assertEquals(r.y, p.y)
+ self.assertEquals(r.x, 100)
+ self.assertEquals(r.y, 200)
+
+ def testOverrides(self):
+ def x_prop_handler(value):
+ self.assertEquals(value, 100)
+ def y_prop_handler(value):
+ self.assertEquals(value, 200)
+ p.set_property_handler("x", x_prop_handler)
+ p.set_property_handler("y", y_prop_handler)
+ p.props.x = 100
+ p.prpos.y = 200
+ assertNotEqual(p.props.x, 100)
+ assertNotEqual(p.props.y, 200)
+
+if __name__ == "__main__":
+ unittest.main()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]