Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/src/sugar/tutorius/tests/coretests.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/sugar/tutorius/tests/coretests.py')
-rw-r--r--src/sugar/tutorius/tests/coretests.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/sugar/tutorius/tests/coretests.py b/src/sugar/tutorius/tests/coretests.py
index 8c9a194..7d4b5a6 100644
--- a/src/sugar/tutorius/tests/coretests.py
+++ b/src/sugar/tutorius/tests/coretests.py
@@ -132,6 +132,22 @@ class StateTest(unittest.TestCase):
assert event_filter._callback == None, "Event filter did not remove callback properly"
+ def test_warning_set_tutorial_twice(self):
+ """
+ Calls set_tutorial twice and expects a warning on the second.
+ """
+ state = State("start_state")
+ tut = SimpleTutorial("First")
+ tut2 = SimpleTutorial("Second")
+
+ state.set_tutorial(tut)
+
+ try:
+ state.set_tutorial(tut2)
+ assert False, "No RuntimeWarning was raised on second set_tutorial"
+ except :
+ pass
+
if __name__ == "__main__":
unittest.main() \ No newline at end of file