From 1bc406d0fb8704a7a71dcdf52f54dc6f5b4e5921 Mon Sep 17 00:00:00 2001 From: Vincent Vinet Date: Tue, 31 Mar 2009 16:59:10 +0000 Subject: Ajout de tests --- (limited to 'src/sugar/tutorius/tests/linear_creatortests.py') diff --git a/src/sugar/tutorius/tests/linear_creatortests.py b/src/sugar/tutorius/tests/linear_creatortests.py index 3bc06f9..f9ffbe7 100644 --- a/src/sugar/tutorius/tests/linear_creatortests.py +++ b/src/sugar/tutorius/tests/linear_creatortests.py @@ -19,8 +19,8 @@ from sugar.tutorius.core import * from sugar.tutorius.actions import * from sugar.tutorius.filters import * from sugar.tutorius.linear_creator import * -from coretests import TriggerEventFilter, CountAction - +from coretests import TriggerEventFilter +from actiontests import CountAction import unittest class CreatorTests(unittest.TestCase): @@ -64,6 +64,16 @@ class CreatorTests(unittest.TestCase): assert len(state2.get_action_list()) == 0, "Creator inserted extra actions on wrong state" assert len(state2.get_event_filter_list()) == 0, "Creator assigner events to the final state" + + creator.action(CountAction()) + + fsm = creator.generate_fsm() + + state2 = fsm.get_state_by_name("State2") + + assert len(state2.get_action_list()) == 1, "Creator did not add the action" + + assert len(state2.get_event_filter_list()) == 0, "Creator assigner events to the final state" if __name__ == '__main__': - unittest.main() \ No newline at end of file + unittest.main() -- cgit v0.9.1