summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Andreoli <dave@gurumeditation.it>2017-07-22 10:57:24 +0200
committerDave Andreoli <dave@gurumeditation.it>2017-07-22 10:57:24 +0200
commit7d8049b0c5e06403433cfef362ec8771cf8cef95 (patch)
tree2fb53b50557ceafaabb05086bf6de20f52d73fd2
parent741000d423deafb01c80c93eef323188234c18f0 (diff)
Adjust some more tests
-rw-r--r--tests/edje/test_02_object.py6
-rw-r--r--tests/edje/test_04_edit.py17
-rw-r--r--tests/edje/test_05_decorators.py4
3 files changed, 14 insertions, 13 deletions
diff --git a/tests/edje/test_02_object.py b/tests/edje/test_02_object.py
index d916335..97c6bee 100644
--- a/tests/edje/test_02_object.py
+++ b/tests/edje/test_02_object.py
@@ -111,9 +111,13 @@ class TestEdjeObject(unittest.TestCase):
111 o.delete() 111 o.delete()
112 112
113 def testSignals(self): 113 def testSignals(self):
114 expected_signals = ["seat,added,seat1,default", "edje,language,none",
115 "edje,state,ltr", "load", "edje,state,ltr",
116 "resize", "quit"]
114 def _signal_cb(obj, emission, source): 117 def _signal_cb(obj, emission, source):
115 print("Signal: emission=%s, source=%s" % (emission, source)) 118 expected_signals.remove(emission)
116 if emission == "quit": 119 if emission == "quit":
120 self.assertEqual(expected_signals, [])
117 ecore.main_loop_quit() 121 ecore.main_loop_quit()
118 122
119 o = edje.Edje(self.canvas, file=theme_file, group="main") 123 o = edje.Edje(self.canvas, file=theme_file, group="main")
diff --git a/tests/edje/test_04_edit.py b/tests/edje/test_04_edit.py
index ec79279..6eab50b 100644
--- a/tests/edje/test_04_edit.py
+++ b/tests/edje/test_04_edit.py
@@ -3,7 +3,7 @@
3from efl import evas 3from efl import evas
4from efl.edje import EDJE_PART_TYPE_RECTANGLE 4from efl.edje import EDJE_PART_TYPE_RECTANGLE
5from efl.edje_edit import EdjeEdit, Text_Style, Text_Style_Tag, Color_Class, \ 5from efl.edje_edit import EdjeEdit, Text_Style, Text_Style_Tag, Color_Class, \
6 Part, Program 6 Part, State, Program
7import os, unittest, shutil 7import os, unittest, shutil
8import logging 8import logging
9 9
@@ -201,7 +201,7 @@ class TestEdjeEditParts(unittest.TestCase):
201 os.remove(theme_file) 201 os.remove(theme_file)
202 202
203 def testPart(self): 203 def testPart(self):
204 self.assertEqual(len(self.o.parts), 42) 204 self.assertEqual(len(self.o.parts), 6)
205 self.assertTrue(self.o.part_exist("bg")) 205 self.assertTrue(self.o.part_exist("bg"))
206 self.assertTrue(self.o.part_exist("rect")) 206 self.assertTrue(self.o.part_exist("rect"))
207 self.assertFalse(self.o.part_exist("NOTEXIST")) 207 self.assertFalse(self.o.part_exist("NOTEXIST"))
@@ -221,7 +221,7 @@ class TestEdjeEditParts(unittest.TestCase):
221 def testPartAdd(self): 221 def testPartAdd(self):
222 self.o.part_add("new_part", EDJE_PART_TYPE_RECTANGLE) 222 self.o.part_add("new_part", EDJE_PART_TYPE_RECTANGLE)
223 self.assertTrue(self.o.part_exist("new_part")) 223 self.assertTrue(self.o.part_exist("new_part"))
224 self.assertEqual(len(self.o.parts), 43) 224 self.assertEqual(len(self.o.parts), 7)
225 225
226 p = self.o.part_get("new_part") 226 p = self.o.part_get("new_part")
227 self.assertIsInstance(p, Part) 227 self.assertIsInstance(p, Part)
@@ -400,7 +400,6 @@ class TestEdjeEditPrograms(unittest.TestCase):
400 p.targets_clear() 400 p.targets_clear()
401 self.assertEqual(p.targets_get(), []) 401 self.assertEqual(p.targets_get(), [])
402 402
403 #@unittest.skip("Program.after_add() does not work")
404 def testProgramAfters(self): 403 def testProgramAfters(self):
405 p = self.o.program_get("prog1") 404 p = self.o.program_get("prog1")
406 self.assertEqual(p.afters_get(), ["prog2", "prog3"]) 405 self.assertEqual(p.afters_get(), ["prog2", "prog3"])
@@ -426,10 +425,10 @@ class TestEdjeEditPrograms(unittest.TestCase):
426 p.api = ("new_name", "new_desc") 425 p.api = ("new_name", "new_desc")
427 self.assertEqual(p.api, ("new_name", "new_desc")) 426 self.assertEqual(p.api, ("new_name", "new_desc"))
428 427
429 #@unittest.skip("Program.script does not work")
430 def testProgramScript(self): 428 def testProgramScript(self):
431 p = self.o.program_get("emit_back_message") 429 p = self.o.program_get("emit_back_message")
432 print(p.script) 430 self.assertIsInstance(p, Program)
431 self.assertEqual(p.script.strip(), "send_message(MSG_INT, 1, 33);")
433 432
434 433
435class TestEdjeEditPartStates(unittest.TestCase): 434class TestEdjeEditPartStates(unittest.TestCase):
@@ -466,19 +465,17 @@ class TestEdjeEditPartStates(unittest.TestCase):
466 465
467 # TODO test state_copy 466 # TODO test state_copy
468 467
469 #@unittest.skip("state_exist does not work") # TODO FIXME
470 def testPartStateExist(self): 468 def testPartStateExist(self):
471 p = self.o.part_get("edit_test") 469 p = self.o.part_get("edit_test")
472 self.assertFalse(p.state_exist("stateNOTEXISTS", 0.1)) 470 self.assertFalse(p.state_exist("stateNOTEXISTS", 0.1))
473 self.assertTrue(p.state_exist("state1", 0.0)) 471 self.assertTrue(p.state_exist("state1", 0.0))
474 self.assertTrue(p.state_exist("state2", 0.1)) 472 self.assertTrue(p.state_exist("state2", 0.1))
475 473
476 #@unittest.skip("PartState does not work") # TODO FIXME
477 def testPartStateProps(self): 474 def testPartStateProps(self):
478 p = self.o.part_get("edit_test") 475 p = self.o.part_get("edit_test")
479 s = p.state_get("state1", 0.0) 476 s = p.state_get("state1", 0.0)
480 print(s) 477 self.assertIsInstance(s, State)
481 print(s.rel1_to_get()) 478 # TODO test more State properties
482 479
483if __name__ == '__main__': 480if __name__ == '__main__':
484 formatter = logging.Formatter("[%(levelname)s] %(name)s (%(filename)s: %(lineno)d) --- %(message)s") 481 formatter = logging.Formatter("[%(levelname)s] %(name)s (%(filename)s: %(lineno)d) --- %(message)s")
diff --git a/tests/edje/test_05_decorators.py b/tests/edje/test_05_decorators.py
index 1a8fbfe..b1552c4 100644
--- a/tests/edje/test_05_decorators.py
+++ b/tests/edje/test_05_decorators.py
@@ -13,8 +13,8 @@ theme_path = os.path.dirname(os.path.abspath(__file__))
13theme_file = os.path.join(theme_path, "theme.edj") 13theme_file = os.path.join(theme_path, "theme.edj")
14 14
15 15
16expected_signals = ["edje,language,none", "edje,state,ltr", "load", 16expected_signals = ["seat,added,seat1,default", "edje,language,none",
17 "edje,state,ltr", "resize", 17 "edje,state,ltr", "load", "edje,state,ltr", "resize",
18 "emit,message", "emit,message"] 18 "emit,message", "emit,message"]
19expected_signals2 = ["load", "resize"] 19expected_signals2 = ["load", "resize"]
20expected_messages = [33, 33] 20expected_messages = [33, 33]