From ed94782ba28c29ac044cd30314ea67c79241456a Mon Sep 17 00:00:00 2001 From: Vincent Vinet Date: Wed, 25 Mar 2009 18:35:17 +0000 Subject: Split action tests into own file, and add some testing --- 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() -- cgit v0.9.1