summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Huuhko <kai.huuhko@gmail.com>2015-03-25 05:53:38 +0200
committerKai Huuhko <kai.huuhko@gmail.com>2015-03-25 05:53:38 +0200
commita119c3ccdb8cc8ed7b6581cce0daddd72023ee42 (patch)
tree72e7a50b565e483ea6aba8a36c60b559a0fb993d
parent9f4eab83b7f789c2237ac02e9f33352499712314 (diff)
Tests: Fix custom smart event callbacks' tests
Custom events always get event_info since commit fcc93216f9b7179f4af13b29ddde848fcc94f19f
-rw-r--r--tests/evas/test_06_object_smart.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/tests/evas/test_06_object_smart.py b/tests/evas/test_06_object_smart.py
index b672f87..2a15ba8 100644
--- a/tests/evas/test_06_object_smart.py
+++ b/tests/evas/test_06_object_smart.py
@@ -50,7 +50,7 @@ class SmartObjectTest(unittest.TestCase):
50 50
51 def testCallbackSimple(self): 51 def testCallbackSimple(self):
52 self.expected_cbs = 2 52 self.expected_cbs = 2
53 def _event1_cb(obj): 53 def _event1_cb(obj, event_info):
54 self.expected_cbs -= 1 54 self.expected_cbs -= 1
55 self.obj.callback_add("event1", _event1_cb) 55 self.obj.callback_add("event1", _event1_cb)
56 self.obj.move(1, 1) # should fire "event1" 56 self.obj.move(1, 1) # should fire "event1"
@@ -60,7 +60,7 @@ class SmartObjectTest(unittest.TestCase):
60 self.assertEqual(self.expected_cbs, 0) 60 self.assertEqual(self.expected_cbs, 0)
61 61
62 def testCallbackArgs(self): 62 def testCallbackArgs(self):
63 def _event1_cb(obj, arg1, arg2, arg3, mykarg2, mykarg1): 63 def _event1_cb(obj, event_info, arg1, arg2, arg3, mykarg2, mykarg1):
64 self.assertEqual(arg1, 11) 64 self.assertEqual(arg1, 11)
65 self.assertEqual(arg2, 22) 65 self.assertEqual(arg2, 22)
66 self.assertEqual(arg3, "arg3") 66 self.assertEqual(arg3, "arg3")
@@ -72,9 +72,9 @@ class SmartObjectTest(unittest.TestCase):
72 self.obj.move(0, 0) 72 self.obj.move(0, 0)
73 73
74 def testCallbackMulti(self): 74 def testCallbackMulti(self):
75 def _event1_cb1(obj): 75 def _event1_cb1(obj, event_info):
76 self.expected_cbs += 1 76 self.expected_cbs += 1
77 def _event1_cb2(obj): 77 def _event1_cb2(obj, event_info):
78 self.expected_cbs += 10 78 self.expected_cbs += 10
79 79
80 self.expected_cbs = 0 80 self.expected_cbs = 0
@@ -98,7 +98,7 @@ class SmartObjectTest(unittest.TestCase):
98 self.assertEqual(self.expected_cbs, 0) 98 self.assertEqual(self.expected_cbs, 0)
99 99
100 def testCallbackLots(self): 100 def testCallbackLots(self):
101 def _event1_cb(obj): 101 def _event1_cb(obj, event_info):
102 self.expected_cbs -= 1 102 self.expected_cbs -= 1
103 103
104 self.expected_cbs = 20000 104 self.expected_cbs = 20000
@@ -113,7 +113,7 @@ class SmartObjectTest(unittest.TestCase):
113 self.assertEqual(self.expected_cbs, 0) 113 self.assertEqual(self.expected_cbs, 0)
114 114
115 def testCallbackLots2(self): 115 def testCallbackLots2(self):
116 def _event1_cb(obj): 116 def _event1_cb(obj, event_info):
117 self.expected_cbs -= 1 117 self.expected_cbs -= 1
118 118
119 self.expected_cbs = 10000 119 self.expected_cbs = 10000
@@ -128,20 +128,20 @@ class SmartObjectTest(unittest.TestCase):
128 self.assertEqual(self.expected_cbs, 0) 128 self.assertEqual(self.expected_cbs, 0)
129 129
130 def testCallbackWrongDel1(self): 130 def testCallbackWrongDel1(self):
131 def _event1_cb(obj): 131 def _event1_cb(obj, event_info):
132 pass 132 pass
133 self.assertRaises(ValueError, self.obj.callback_del, "event1", _event1_cb) 133 self.assertRaises(ValueError, self.obj.callback_del, "event1", _event1_cb)
134 134
135 def testCallbackWrongDel2(self): 135 def testCallbackWrongDel2(self):
136 def _event1_cb(obj): 136 def _event1_cb(obj, event_info):
137 pass 137 pass
138 self.obj.callback_add("event1", _event1_cb) 138 self.obj.callback_add("event1", _event1_cb)
139 self.obj.callback_add("event1", _event1_cb) 139 self.obj.callback_add("event1", _event1_cb)
140 self.obj.callback_del("event1", _event1_cb) 140 self.obj.callback_del("event1", _event1_cb)
141 self.obj.callback_del("event1", _event1_cb) 141 self.obj.callback_del("event1", _event1_cb)
142 self.assertRaises(ValueError, self.obj.callback_del, "event1", _event1_cb) 142 self.assertRaises(ValueError, self.obj.callback_del, "event1", _event1_cb)
143 143
144 144
145if __name__ == '__main__': 145if __name__ == '__main__':
146 unittest.main(verbosity=2) 146 unittest.main(verbosity=2)
147 evas.shutdown() 147 evas.shutdown()