aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKai Huuhko <kai.huuhko@gmail.com>2016-08-16 21:51:17 +0300
committerKai Huuhko <kai.huuhko@gmail.com>2016-08-16 21:57:21 +0300
commitfdab8ed5b6ba8a595e80b0e159c9ff7884db7a5e (patch)
treed48bee48e7a2143f1bb931daf87e77bc7be7611e
parentSwitch enums to use the old system we had previously (diff)
downloadpython-efl-fdab8ed5b6ba8a595e80b0e159c9ff7884db7a5e.tar.gz
tests: Fix edje decorators test
Commit dd584b9f79ec41b53ca620ae534fcf84f12e30a9 fixed bad behaviour in edje entry. Our test was picking up the "changed" and "cursor,changed" signals emitted by edje entry when its text was set to "" on creation. Raster changed this behaviour, removing the emissions, so let's do the same in our test and add some future proofing as well. Fixes https://phab.enlightenment.org/T4374
-rw-r--r--tests/edje/test_05_decorators.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/tests/edje/test_05_decorators.py b/tests/edje/test_05_decorators.py
index 2a09dea..1a8fbfe 100644
--- a/tests/edje/test_05_decorators.py
+++ b/tests/edje/test_05_decorators.py
@@ -14,7 +14,7 @@ theme_file = os.path.join(theme_path, "theme.edj")
expected_signals = ["edje,language,none", "edje,state,ltr", "load",
- "edje,state,ltr", "resize", "cursor,changed", "changed",
+ "edje,state,ltr", "resize",
"emit,message", "emit,message"]
expected_signals2 = ["load", "resize"]
expected_messages = [33, 33]
@@ -28,7 +28,8 @@ class MyEdje(Edje):
@edje.on_signal("*", "*")
def cb_signal_all(self, emission, source):
- expected_signals.remove(emission)
+ if source == "" or source == "edje":
+ expected_signals.remove(emission)
@edje.on_signal("load", "*")
@edje.on_signal("resize", "*")
@@ -50,13 +51,16 @@ class TestEdjeDecoratedCallbacks(unittest.TestCase):
size=(400, 500),
viewport=(0, 0, 400, 500))
self.canvas.engine_info_set(self.canvas.engine_info_get())
+ self.o = MyEdje(self.canvas)
+ self.assertIsInstance(self.o, Edje)
def tearDown(self):
+ self.o.delete()
+ self.assertTrue(self.o.is_deleted())
self.canvas.delete()
def testDecorators(self):
- o = MyEdje(self.canvas)
- self.assertIsInstance(o, Edje)
+ o = self.o
# this should trigger text_change, two times
ecore.Timer(0.1, lambda: o.part_text_set("label", "asd"))
@@ -76,9 +80,6 @@ class TestEdjeDecoratedCallbacks(unittest.TestCase):
self.assertEqual(expected_messages, [])
self.assertEqual(expected_text_parts, [])
- o.delete()
- self.assertTrue(o.is_deleted())
-
if __name__ == '__main__':
formatter = logging.Formatter("[%(levelname)s] %(name)s (%(filename)s: %(lineno)d) --- %(message)s")