diff options
Diffstat (limited to 'src/sugar/tutorius/tests/actiontests.py')
-rw-r--r-- | src/sugar/tutorius/tests/actiontests.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/sugar/tutorius/tests/actiontests.py b/src/sugar/tutorius/tests/actiontests.py index 9c398d4..ab9cdba 100644 --- a/src/sugar/tutorius/tests/actiontests.py +++ b/src/sugar/tutorius/tests/actiontests.py @@ -153,6 +153,21 @@ class ChainActionTest(unittest.TestCase): assert len(witness) is 2, "Two actions should give 2 undo's" +class DisableWidgetActionTests(unittest.TestCase): + def test_disable(self): + btn = gtk.Button() + ObjectStore().activity = btn + btn.set_sensitive(True) + assert btn.props.sensitive is True, "Callback should have been called" + + act = DisableWidgetAction("0") + assert btn.props.sensitive is True, "Callback should have been called again" + act.do() + assert btn.props.sensitive is False, "Callback should not have been called again" + act.undo() + assert btn.props.sensitive is True, "Callback should have been called again" + if __name__ == "__main__": unittest.main() + |