Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Vinet <vince.vinet@gmail.com>2009-03-25 18:35:17 (GMT)
committer Vincent Vinet <vince.vinet@gmail.com>2009-03-31 14:06:38 (GMT)
commited94782ba28c29ac044cd30314ea67c79241456a (patch)
tree512e00c8d26e83ac577bbf827ef430ebcf287aa7
parent70a5d8b295d949fc29afb25ba4eeeac4067e3f1f (diff)
Split action tests into own file, and add some testing
-rw-r--r--src/sugar/tutorius/tests/actiontests.py38
1 files changed, 19 insertions, 19 deletions
diff --git a/src/sugar/tutorius/tests/actiontests.py b/src/sugar/tutorius/tests/actiontests.py
index 7c508a8..0d9cfd7 100644
--- a/src/sugar/tutorius/tests/actiontests.py
+++ b/src/sugar/tutorius/tests/actiontests.py
@@ -27,6 +27,25 @@ import gtk
from sugar.tutorius.actions import Action, OnceWrapper, DisableWidgetAction
from sugar.tutorius.services import ObjectStore
+class PropertyAction(Action):
+ def __init__(self, na):
+ self._a = na
+
+ def set_a(self, na):
+ self._a = na
+
+ def get_a(self):
+ return self._a
+
+ a = property(fget=get_a, fset=set_a)
+
+class PropsTest(unittest.TestCase):
+
+ def test_get_properties(self):
+ prop = PropertyAction(8)
+
+ assert prop.get_properties() == ['a'], "Action does not contain property 'a'"
+
class CountAction(Action):
"""
This action counts how many times it's do and undo methods get called
@@ -100,25 +119,6 @@ class DisableWidgetActionTests(unittest.TestCase):
act.undo()
assert btn.props.sensitive is True, "Callback should have been called again"
-class PropertyAction(Action):
- def __init__(self, na):
- self._a = na
-
- def set_a(self, na):
- self._a = na
-
- def get_a(self):
- return self._a
-
- a = property(fget=get_a, fset=set_a)
-
-class PropsTest(unittest.TestCase):
-
- def test_get_properties(self):
- prop = PropertyAction(8)
-
- assert prop.get_properties() == ['a'], "Action does not contain property 'a'"
-
if __name__ == "__main__":
unittest.main()