From fb422aef7ee6832c85c8fa8a703e491838e74d62 Mon Sep 17 00:00:00 2001 From: Vincent Vinet Date: Fri, 04 Dec 2009 05:06:49 +0000 Subject: Add Event Sources: - Add source property in Action and EventFilter - Change TPropContainer contructor to accept keyword arguments and set properties that were given - Change every single TPropContainer subclass constructor to accept kwargs and pass them on to super init - Add a "null" option for TStringProperty Use Event Sources: - Make the probe require a source property to install or subscribe - Have ProbeProxy install and subscribe return a prefixed address - Make update, uninstall and unsubsribe extract the prefix from the address - Have the TutorialRunner set a source on actions/events before installing/subscribing instead of setting current activity on ProbeManager Test Event Sources: - Change the tests according to the new constructors and behaviors --- (limited to 'tests/coretests.py') diff --git a/tests/coretests.py b/tests/coretests.py index b9e04e5..1cc5431 100644 --- a/tests/coretests.py +++ b/tests/coretests.py @@ -242,7 +242,7 @@ class StateTest(unittest.TestCase): act1 = addon.create("BubbleMessage", message="Hi", position=[132,450]) act2 = addon.create("BubbleMessage", message="Hi", position=[132,450]) - event1 = addon.create("GtkWidgetEventFilter", "0.0.0.1.1.2.3.1", "clicked") + event1 = addon.create("GtkWidgetEventFilter", object_id="0.0.0.1.1.2.3.1", event_name="clicked") act3 = addon.create("DialogMessage", message="Hello again.", position=[200, 400]) @@ -276,19 +276,19 @@ class StateTest(unittest.TestCase): st2.name = "Identical" st3 = deepcopy(st1) - st3.add_action(addon.create("BubbleMessage", "Hi!", [128,264])) + st3.add_action(addon.create("BubbleMessage", message="Hi!", position=[128,264])) assert not (st1 == st3), "States having a different number of actions should be different" st4 = deepcopy(st1) - st4.add_event_filter(addon.create("GtkWidgetEventFilter", "0.0.1.1.2.2.3", "clicked"), "next_state") + st4.add_event_filter(addon.create("GtkWidgetEventFilter", object_id="0.0.1.1.2.2.3", event_name="clicked"), "next_state") assert not (st1 == st4), "States having a different number of events should be different" st5 = deepcopy(st1) st5._event_filters = [] - st5.add_event_filter(addon.create("GtkWidgetEventFilter", "0.1.2.3.4.1.2", "pressed"), "other_state") + st5.add_event_filter(addon.create("GtkWidgetEventFilter", object_id="0.1.2.3.4.1.2", event_name="pressed"), "other_state") assert not (st1 == st5), "States having the same number of event filters" \ + " but those being different should be different" @@ -502,7 +502,7 @@ class FSMTest(unittest.TestCase): st2 = State("Other State") st3 = State("Final State") - st1.add_action(addon.create("BubbleMessage", "Hi!", [132,312])) + st1.add_action(addon.create("BubbleMessage", message="Hi!", position=[132,312])) fsm.add_state(st1) fsm.add_state(st2) @@ -534,7 +534,7 @@ class FSMTest(unittest.TestCase): fsm3 = FiniteStateMachine("Identity test") - act3 = addon.create("BubbleMessage", "Hi!", [123,312]) + act3 = addon.create("BubbleMessage", message="Hi!", position=[123,312]) fsm3.add_action(act3) assert not(fsm3 == fsm), \ -- cgit v0.9.1