aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLauro Moura <lauromoura@expertisesolutions.com.br>2018-06-27 20:00:22 -0300
committerLauro Moura <lauromoura@expertisesolutions.com.br>2018-06-27 21:43:20 -0300
commite7be910565f0ba24f2ec00eff2ec60450ce79cfe (patch)
treedc3fefbf18e167bc7ed645e1bbb9e7ef0fa8b50b
parentevas: move clearing cows to right place. (diff)
downloadefl-devs/lauromoura/pyolian.tar.gz
pyolian: Update tests after API renaming.devs/lauromoura/pyolian
It was still using the previous Foo.Bar naming scheme that was reverted some time ago. pyolian children test still failing though. It seems that using all_eo_files_parse do not create additional children units.
-rwxr-xr-xsrc/scripts/pyolian/test_eolian.py75
1 files changed, 38 insertions, 37 deletions
diff --git a/src/scripts/pyolian/test_eolian.py b/src/scripts/pyolian/test_eolian.py
index 34fdbafbdf..106eca69e1 100755
--- a/src/scripts/pyolian/test_eolian.py
+++ b/src/scripts/pyolian/test_eolian.py
@@ -25,13 +25,13 @@ eolian_db = None
class TestBaseObject(unittest.TestCase):
def test_base_object_equality(self):
- cls1 = eolian_db.class_by_name_get('Efl.Loop.Timer')
+ cls1 = eolian_db.class_by_name_get('Efl.Loop_Timer')
cls2 = eolian_db.class_by_file_get('efl_loop_timer.eo')
self.assertIsInstance(cls1, eolian.Class)
self.assertIsInstance(cls2, eolian.Class)
self.assertEqual(cls1, cls2)
- self.assertEqual(cls1, 'Efl.Loop.Timer')
- self.assertEqual(cls2, 'Efl.Loop.Timer')
+ self.assertEqual(cls1, 'Efl.Loop_Timer')
+ self.assertEqual(cls2, 'Efl.Loop_Timer')
self.assertNotEqual(cls1, 'another string')
self.assertNotEqual(cls1, 1234)
self.assertNotEqual(cls1, None)
@@ -98,8 +98,9 @@ class TestEolianUnit(unittest.TestCase):
self.assertEqual(unit.file, 'efl_ui_win.eo')
def test_children_listing(self):
- l = list(eolian_db.children)
- self.assertGreater(len(l), 500)
+ obj = eolian_db.object_by_name_get('Efl.Ui.Button')
+ l = list(obj.unit.children)
+ self.assertGreater(len(l), 5) # Efl.Object, Gfx, Clickable, etc.
self.assertIsInstance(l[0], eolian.Eolian_Unit)
def test_file_listing(self):
@@ -210,7 +211,7 @@ class TestEolianNamespace(unittest.TestCase):
for ns in eolian_db.all_namespaces:
self.assertIsInstance(ns, eolian.Namespace)
count += 1
- self.assertGreater(count, 200)
+ self.assertGreater(count, 120)
def test_namespace_equality(self):
ns1 = eolian.Namespace(eolian_db, 'Efl.Io')
@@ -308,23 +309,23 @@ class TestEolianClass(unittest.TestCase):
cls = eolian_db.class_by_file_get('efl_loop_timer.eo')
self.assertIsInstance(cls, eolian.Class)
- cls = eolian_db.class_by_name_get('Efl.Loop.Timer')
+ cls = eolian_db.class_by_name_get('Efl.Loop_Timer')
self.assertIsInstance(cls, eolian.Class)
- self.assertEqual(cls.name, 'Efl.Loop.Timer')
- self.assertEqual(cls.short_name, 'Timer')
+ self.assertEqual(cls.name, 'Efl.Loop_Timer')
+ self.assertEqual(cls.short_name, 'Loop_Timer')
self.assertEqual(cls.file, 'efl_loop_timer.eo')
- self.assertEqual(list(cls.namespaces), ['Efl', 'Loop'])
+ self.assertEqual(list(cls.namespaces), ['Efl'])
self.assertEqual(cls.type, eolian.Eolian_Class_Type.REGULAR)
self.assertIsInstance(cls.documentation, eolian.Documentation)
self.assertEqual(cls.legacy_prefix, 'ecore_timer')
self.assertIsNone(cls.eo_prefix) # TODO fin a class with a value
self.assertIsNone(cls.event_prefix) # TODO same as above
self.assertIsNone(cls.data_type) # TODO same as above
- self.assertEqual(cls.base_class.name, 'Efl.Loop.Consumer')
- self.assertEqual([c.name for c in cls.inherits], ['Efl.Loop.Consumer'])
- self.assertEqual([c.name for c in cls.inherits_full], ['Efl.Loop.Consumer', 'Efl.Object'])
- self.assertEqual([c.name for c in cls.hierarchy], ['Efl.Loop.Consumer', 'Efl.Object'])
+ self.assertEqual(cls.base_class.name, 'Efl.Loop_Consumer')
+ self.assertEqual([c.name for c in cls.inherits], ['Efl.Loop_Consumer'])
+ self.assertEqual([c.name for c in cls.inherits_full], ['Efl.Loop_Consumer', 'Efl.Object'])
+ self.assertEqual([c.name for c in cls.hierarchy], ['Efl.Loop_Consumer', 'Efl.Object'])
self.assertFalse(cls.ctor_enable)
self.assertFalse(cls.dtor_enable)
self.assertEqual(cls.c_get_function_name, 'efl_loop_timer_class_get')
@@ -338,7 +339,7 @@ class TestEolianClass(unittest.TestCase):
class TestEolianFunction(unittest.TestCase):
def test_function(self):
- cls = eolian_db.class_by_name_get('Efl.Loop.Timer')
+ cls = eolian_db.class_by_name_get('Efl.Loop_Timer')
f = cls.function_by_name_get('delay')
self.assertIsInstance(f, eolian.Function)
self.assertEqual(f.name, 'delay')
@@ -365,11 +366,11 @@ class TestEolianFunction(unittest.TestCase):
self.assertEqual(len(list(f.parameters)), 1)
self.assertFalse(f.return_is_warn_unused(eolian.Eolian_Function_Type.METHOD))
self.assertFalse(f.object_is_const)
- self.assertEqual(f.class_.name, 'Efl.Loop.Timer')
+ self.assertEqual(f.class_.name, 'Efl.Loop_Timer')
self.assertIsInstance(f.implement, eolian.Implement)
def test_function_parameter(self):
- cls = eolian_db.class_by_name_get('Efl.Loop.Timer')
+ cls = eolian_db.class_by_name_get('Efl.Loop_Timer')
f = cls.function_by_name_get('delay')
p = list(f.parameters)[0]
self.assertEqual(p.direction, eolian.Eolian_Parameter_Dir.IN)
@@ -384,11 +385,11 @@ class TestEolianFunction(unittest.TestCase):
class TestEolianImplement(unittest.TestCase):
def test_implement(self):
- cls = eolian_db.class_by_name_get('Efl.Loop.Timer')
+ cls = eolian_db.class_by_name_get('Efl.Loop_Timer')
f = cls.function_by_name_get('delay')
im = f.implement
self.assertIsInstance(im, eolian.Implement)
- self.assertEqual(im.name, 'Efl.Loop.Timer.delay')
+ self.assertEqual(im.name, 'Efl.Loop_Timer.delay')
self.assertIsInstance(im.class_, eolian.Class)
self.assertIsInstance(im.function, eolian.Function)
self.assertIsInstance(im.documentation_get(), eolian.Documentation) # TODO is UNRESOLVED correct ?
@@ -403,7 +404,7 @@ class TestEolianImplement(unittest.TestCase):
class TestEolianEvent(unittest.TestCase):
def test_event(self):
- cls = eolian_db.class_by_name_get('Efl.Loop.Timer')
+ cls = eolian_db.class_by_name_get('Efl.Loop_Timer')
self.assertEqual([e.name for e in cls.events], ['tick'])
ev = cls.event_by_name_get('tick')
self.assertIsInstance(ev, eolian.Event)
@@ -426,7 +427,7 @@ class TestEolianPart(unittest.TestCase):
part = parts[0]
self.assertEqual(part.name, 'backwall')
self.assertIsInstance(part.class_, eolian.Class)
- self.assertEqual(part.class_.name, 'Efl.Ui.Popup.Part')
+ self.assertEqual(part.class_.name, 'Efl.Ui.Popup_Part')
self.assertIsInstance(part.documentation, eolian.Documentation)
@@ -447,7 +448,7 @@ class TestEolianConstructor(unittest.TestCase):
class TestEolianDocumentation(unittest.TestCase):
def test_documentation(self):
- td = eolian_db.class_by_name_get('Efl.Net.Control')
+ td = eolian_db.class_by_name_get('Efl.Net.Control.Manager')
doc = td.documentation
self.assertIsInstance(doc, eolian.Documentation)
self.assertIsInstance(doc.summary, str)
@@ -472,14 +473,14 @@ class TestEolianVariable(unittest.TestCase):
self.assertIsNone(var.value) # TODO is None correct here? no value?
def test_variable_constant(self):
- var = eolian_db.constant_by_name_get('Efl.Gfx.Size.Hint.Fill')
+ var = eolian_db.constant_by_name_get('Efl.Gfx.Size_Hint_Fill')
self.assertIsInstance(var, eolian.Variable)
- self.assertEqual(var.name, 'Efl.Gfx.Size.Hint.Fill')
- self.assertEqual(var.short_name, 'Fill')
+ self.assertEqual(var.name, 'Efl.Gfx.Size_Hint_Fill')
+ self.assertEqual(var.short_name, 'Size_Hint_Fill')
self.assertEqual(var.type, eolian.Eolian_Variable_Type.CONSTANT)
self.assertEqual(var.file, 'efl_gfx_size_hint.eo')
self.assertFalse(var.is_extern)
- self.assertEqual(list(var.namespaces), ['Efl','Gfx','Size','Hint'])
+ self.assertEqual(list(var.namespaces), ['Efl','Gfx'])
self.assertIsInstance(var.documentation, eolian.Documentation)
self.assertIsInstance(var.base_type, eolian.Type)
self.assertIsInstance(var.value, eolian.Expression)
@@ -547,7 +548,7 @@ class TestEolianTypedecl(unittest.TestCase):
class TestEolianType(unittest.TestCase):
def test_type_regular_builtin(self):
- cls = eolian_db.class_by_name_get('Efl.Loop.Timer')
+ cls = eolian_db.class_by_name_get('Efl.Loop_Timer')
func = cls.function_by_name_get('delay')
param = list(func.parameters)[0]
t = param.type # type: double
@@ -572,7 +573,7 @@ class TestEolianType(unittest.TestCase):
self.assertEqual(t.c_type_return, 'double')
def test_type_regular(self):
- cls = eolian_db.class_by_name_get('Efl.Gfx')
+ cls = eolian_db.class_by_name_get('Efl.Gfx.Entity')
func = cls.function_by_name_get('geometry')
param = list(func.setter_values)[0]
t = param.type # type: Eina.Rect
@@ -581,7 +582,7 @@ class TestEolianType(unittest.TestCase):
self.assertEqual(t.short_name, 'Rect')
self.assertEqual(t.type, eolian.Eolian_Type_Type.REGULAR)
self.assertEqual(t.builtin_type, eolian.Eolian_Type_Builtin_Type.INVALID)
- self.assertEqual(t.file, 'efl_gfx.eo') # TODO is this correct ?
+ self.assertEqual(t.file, 'efl_gfx_entity.eo') # TODO is this correct ?
self.assertEqual(list(t.namespaces), ['Eina'])
self.assertEqual(t.free_func, 'eina_rectangle_free')
self.assertIsNone(t.class_)
@@ -601,22 +602,22 @@ class TestEolianType(unittest.TestCase):
param = list(func.setter_values)[0]
t = param.type # type: Efl.Gfx (class interface)
self.assertIsInstance(t, eolian.Type)
- self.assertEqual(t.name, 'Efl.Gfx')
- self.assertEqual(t.short_name, 'Gfx')
+ self.assertEqual(t.name, 'Efl.Gfx.Entity')
+ self.assertEqual(t.short_name, 'Entity')
self.assertEqual(t.type, eolian.Eolian_Type_Type.CLASS)
self.assertEqual(t.builtin_type, eolian.Eolian_Type_Builtin_Type.INVALID)
self.assertEqual(t.file, 'efl_content.eo') # TODO is this correct ?
- self.assertEqual(list(t.namespaces), ['Efl'])
+ self.assertEqual(list(t.namespaces), ['Efl', 'Gfx'])
self.assertEqual(t.free_func, 'efl_del')
self.assertEqual(t, t.aliased_base)
- self.assertEqual(t.c_type_default, 'Efl_Gfx *') # TODO find a better test
- self.assertEqual(t.c_type_param, 'Efl_Gfx *')
- self.assertEqual(t.c_type_return, 'Efl_Gfx *')
+ self.assertEqual(t.c_type_default, 'Efl_Gfx_Entity *') # TODO find a better test
+ self.assertEqual(t.c_type_param, 'Efl_Gfx_Entity *')
+ self.assertEqual(t.c_type_return, 'Efl_Gfx_Entity *')
cls = t.class_
self.assertIsInstance(cls, eolian.Class)
- self.assertEqual(cls.name, 'Efl.Gfx')
+ self.assertEqual(cls.name, 'Efl.Gfx.Entity')
class TestEolianExpression(unittest.TestCase):
@@ -629,7 +630,7 @@ class TestEolianExpression(unittest.TestCase):
self.assertEqual(exp.serialize, '100')
def test_expression_unary(self):
- var = eolian_db.constant_by_name_get('Efl.Gfx.Size.Hint.Fill')
+ var = eolian_db.constant_by_name_get('Efl.Gfx.Size_Hint_Fill')
exp = var.value
self.assertIsInstance(exp, eolian.Expression)
self.assertEqual(exp.type, eolian.Eolian_Expression_Type.UNARY)