diff options
author | mike <michael.jmontcalm@gmail.com> | 2009-03-05 23:21:22 (GMT) |
---|---|---|
committer | mike <michael.jmontcalm@gmail.com> | 2009-03-05 23:21:22 (GMT) |
commit | 37e224a7301ab8a5845bb688e452a6c186403ba7 (patch) | |
tree | 383bf0091ca11aa26eb709e78e6f9f0803db99ef /src/sugar/tutorius/tests | |
parent | 5cdfcba9e827c2acf7dbad7890e8fcea241714a8 (diff) |
TutoriusV1 : Added a test on state.set_tutorial and renamed the demo tutorial
Diffstat (limited to 'src/sugar/tutorius/tests')
-rw-r--r-- | src/sugar/tutorius/tests/coretests.py | 16 |
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 |