From 8ab1e32a479c018766f330ecf71670ef71492300 Mon Sep 17 00:00:00 2001 From: mike Date: Wed, 15 Apr 2009 02:55:10 +0000 Subject: Merge commit 'origin/lp349874' Conflicts: source/external/source/sugar-toolkit/src/sugar/tutorius/tests/actiontests.py source/external/source/sugar-toolkit/src/sugar/tutorius/tests/filterstests.py source/external/source/sugar-toolkit/src/sugar/tutorius/tests/gtkutilstests.py source/external/source/sugar-toolkit/src/sugar/tutorius/tests/run-tests.py --- (limited to 'src/sugar/tutorius/tests/actiontests.py') 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() + -- cgit v0.9.1