Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/filterstests.py5
-rw-r--r--tests/probetests.py6
2 files changed, 10 insertions, 1 deletions
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):