From cd743b7800481d6607222d1d21ab50afb58747ee Mon Sep 17 00:00:00 2001 From: erick Date: Sun, 06 Dec 2009 21:17:34 +0000 Subject: Fix for filtertests due to interface change in installhandlers --- (limited to 'tests') diff --git a/tests/filterstests.py b/tests/filterstests.py index 5358605..ee8532f 100644 --- a/tests/filterstests.py +++ b/tests/filterstests.py @@ -29,6 +29,8 @@ import gtk from sugar.tutorius.filters import EventFilter from sugar.tutorius import addon from gtkutilstests import SignalCatcher +from probetests import MockProbe + class BaseEventFilterTests(unittest.TestCase): """Test the behavior of the Base EventFilter class""" @@ -152,6 +154,7 @@ class TestGtkWidgetEventFilter(unittest.TestCase): unittest.TestCase.__init__(self,*args) self.top=None self.btn1=None + self.probe = MockProbe() def setUp(self): self.top = gtk.Window() @@ -171,7 +174,7 @@ class TestGtkWidgetEventFilter(unittest.TestCase): h = addon.create('GtkWidgetEventFilter', object_id="0.0", event_name="clicked") s = SignalCatcher() - h.install_handlers(s.callback, activity=self.top) + h.install_handlers(s.callback, activity=self.top, probe=self.probe) assert s.data is None, "no callback to call yet" diff --git a/tests/probetests.py b/tests/probetests.py index f073135..99fbf4d 100644 --- a/tests/probetests.py +++ b/tests/probetests.py @@ -29,6 +29,7 @@ from sugar.tutorius.TProbe import TProbe, ProbeProxy, ProbeManager from sugar.tutorius import addon from sugar.tutorius.actions import Action from sugar.tutorius.properties import TIntProperty, TStringProperty +from sugar.tutorius.gtkutils import find_widget #Create a substitute addon create function @@ -72,6 +73,11 @@ class MockActivity(object): def get_id(self): return "unique_id_1" + +class MockProbe(object): + def find_widget(self, base, path, ignore_errors=True): + return find_widget(base,path,ignore_errors) + class MockProbeProxy(object): _MockProxyCache = {} def __new__(cls, activityName, unique_id): -- cgit v0.9.1