summaryrefslogtreecommitdiff
path: root/src/scripts/pyolian
diff options
context:
space:
mode:
authorDave Andreoli <dave@gurumeditation.it>2018-03-17 09:46:17 +0100
committerDave Andreoli <dave@gurumeditation.it>2018-03-17 09:46:17 +0100
commit1ab22e4f00b4f80ff6fba9b895dbe53221e343ea (patch)
tree19c0e962b7539a772ca0746b53f05562a7178625 /src/scripts/pyolian
parent81d15b7cd83ff6e29a82041ec50ebf52234cb7b6 (diff)
Pyolian: fix tests wrt name/short_name/full_name API changes
Diffstat (limited to 'src/scripts/pyolian')
-rwxr-xr-xsrc/scripts/pyolian/test_eolian.py67
1 files changed, 35 insertions, 32 deletions
diff --git a/src/scripts/pyolian/test_eolian.py b/src/scripts/pyolian/test_eolian.py
index 5a22ed83df..5ce260eae5 100755
--- a/src/scripts/pyolian/test_eolian.py
+++ b/src/scripts/pyolian/test_eolian.py
@@ -69,7 +69,7 @@ class TestEolianState(unittest.TestCase):
69 obj = eolian_db.object_by_name_get('Efl.Ui.Frame') 69 obj = eolian_db.object_by_name_get('Efl.Ui.Frame')
70 self.assertIsInstance(obj, eolian.Object) 70 self.assertIsInstance(obj, eolian.Object)
71 self.assertFalse(type(obj) == eolian.Object) 71 self.assertFalse(type(obj) == eolian.Object)
72 self.assertEqual(obj.full_name, 'Efl.Ui.Frame') 72 self.assertEqual(obj.name, 'Efl.Ui.Frame')
73 73
74 count = 0 74 count = 0
75 for obj in eolian_db.objects: 75 for obj in eolian_db.objects:
@@ -121,7 +121,7 @@ class TestEolianUnit(unittest.TestCase):
121 obj = unit.object_by_name_get('Efl.Ui.Win') 121 obj = unit.object_by_name_get('Efl.Ui.Win')
122 self.assertIsInstance(obj, eolian.Object) 122 self.assertIsInstance(obj, eolian.Object)
123 self.assertFalse(type(obj) == eolian.Object) 123 self.assertFalse(type(obj) == eolian.Object)
124 self.assertEqual(obj.full_name, 'Efl.Ui.Win') 124 self.assertEqual(obj.name, 'Efl.Ui.Win')
125 125
126 count = 0 126 count = 0
127 for obj in unit.objects: 127 for obj in unit.objects:
@@ -268,13 +268,16 @@ class TestEolianObject(unittest.TestCase):
268 def test_object_instance(self): 268 def test_object_instance(self):
269 obj = eolian_db.object_by_name_get('Efl.Ui.Frame') 269 obj = eolian_db.object_by_name_get('Efl.Ui.Frame')
270 self.assertIsInstance(obj, eolian.Class) 270 self.assertIsInstance(obj, eolian.Class)
271 self.assertEqual(obj.full_name, 'Efl.Ui.Frame') 271 self.assertEqual(obj.name, 'Efl.Ui.Frame')
272 272
273 @unittest.expectedFailure # Object.name clash with Class.name
274 def test_name(self): 273 def test_name(self):
275 obj = eolian_db.object_by_name_get('Efl.Ui.Frame') 274 obj = eolian_db.object_by_name_get('Efl.Ui.Frame')
276 self.assertEqual(obj.name, 'Efl.Ui.Frame') 275 self.assertEqual(obj.name, 'Efl.Ui.Frame')
277 276
277 def test_short_name(self):
278 obj = eolian_db.object_by_name_get('Efl.Ui.Frame')
279 self.assertEqual(obj.short_name, 'Frame')
280
278 def test_file(self): 281 def test_file(self):
279 obj = eolian_db.object_by_name_get('Efl.Ui.Frame') 282 obj = eolian_db.object_by_name_get('Efl.Ui.Frame')
280 self.assertEqual(obj.file, 'efl_ui_frame.eo') 283 self.assertEqual(obj.file, 'efl_ui_frame.eo')
@@ -298,8 +301,8 @@ class TestEolianClass(unittest.TestCase):
298 cls = eolian_db.class_by_name_get('Efl.Loop.Timer') 301 cls = eolian_db.class_by_name_get('Efl.Loop.Timer')
299 self.assertIsInstance(cls, eolian.Class) 302 self.assertIsInstance(cls, eolian.Class)
300 303
301 self.assertEqual(cls.name, 'Timer') 304 self.assertEqual(cls.name, 'Efl.Loop.Timer')
302 self.assertEqual(cls.full_name, 'Efl.Loop.Timer') 305 self.assertEqual(cls.short_name, 'Timer')
303 self.assertEqual(cls.file, 'efl_loop_timer.eo') 306 self.assertEqual(cls.file, 'efl_loop_timer.eo')
304 self.assertEqual(list(cls.namespaces), ['Efl', 'Loop']) 307 self.assertEqual(list(cls.namespaces), ['Efl', 'Loop'])
305 self.assertEqual(cls.type, eolian.Eolian_Class_Type.REGULAR) 308 self.assertEqual(cls.type, eolian.Eolian_Class_Type.REGULAR)
@@ -308,10 +311,10 @@ class TestEolianClass(unittest.TestCase):
308 self.assertIsNone(cls.eo_prefix) # TODO fin a class with a value 311 self.assertIsNone(cls.eo_prefix) # TODO fin a class with a value
309 self.assertIsNone(cls.event_prefix) # TODO same as above 312 self.assertIsNone(cls.event_prefix) # TODO same as above
310 self.assertIsNone(cls.data_type) # TODO same as above 313 self.assertIsNone(cls.data_type) # TODO same as above
311 self.assertEqual(cls.base_class.full_name, 'Efl.Loop.Consumer') 314 self.assertEqual(cls.base_class.name, 'Efl.Loop.Consumer')
312 self.assertEqual([c.full_name for c in cls.inherits], ['Efl.Loop.Consumer']) 315 self.assertEqual([c.name for c in cls.inherits], ['Efl.Loop.Consumer'])
313 self.assertEqual([c.full_name for c in cls.inherits_full], ['Efl.Loop.Consumer', 'Efl.Object']) 316 self.assertEqual([c.name for c in cls.inherits_full], ['Efl.Loop.Consumer', 'Efl.Object'])
314 self.assertEqual([c.full_name for c in cls.hierarchy], ['Efl.Loop.Consumer', 'Efl.Object']) 317 self.assertEqual([c.name for c in cls.hierarchy], ['Efl.Loop.Consumer', 'Efl.Object'])
315 self.assertFalse(cls.ctor_enable) 318 self.assertFalse(cls.ctor_enable)
316 self.assertFalse(cls.dtor_enable) 319 self.assertFalse(cls.dtor_enable)
317 self.assertEqual(cls.c_get_function_name, 'efl_loop_timer_class_get') 320 self.assertEqual(cls.c_get_function_name, 'efl_loop_timer_class_get')
@@ -352,7 +355,7 @@ class TestEolianFunction(unittest.TestCase):
352 self.assertEqual(len(list(f.parameters)), 1) 355 self.assertEqual(len(list(f.parameters)), 1)
353 self.assertFalse(f.return_is_warn_unused(eolian.Eolian_Function_Type.METHOD)) 356 self.assertFalse(f.return_is_warn_unused(eolian.Eolian_Function_Type.METHOD))
354 self.assertFalse(f.object_is_const) 357 self.assertFalse(f.object_is_const)
355 self.assertEqual(f.class_.full_name, 'Efl.Loop.Timer') 358 self.assertEqual(f.class_.name, 'Efl.Loop.Timer')
356 self.assertIsInstance(f.implement, eolian.Implement) 359 self.assertIsInstance(f.implement, eolian.Implement)
357 360
358 def test_function_parameter(self): 361 def test_function_parameter(self):
@@ -375,7 +378,7 @@ class TestEolianImplement(unittest.TestCase):
375 f = cls.function_by_name_get('delay') 378 f = cls.function_by_name_get('delay')
376 im = f.implement 379 im = f.implement
377 self.assertIsInstance(im, eolian.Implement) 380 self.assertIsInstance(im, eolian.Implement)
378 self.assertEqual(im.full_name, 'Efl.Loop.Timer.delay') 381 self.assertEqual(im.name, 'Efl.Loop.Timer.delay')
379 self.assertIsInstance(im.class_, eolian.Class) 382 self.assertIsInstance(im.class_, eolian.Class)
380 self.assertIsInstance(im.function, eolian.Function) 383 self.assertIsInstance(im.function, eolian.Function)
381 self.assertIsInstance(im.documentation_get(), eolian.Documentation) # TODO is UNRESOLVED correct ? 384 self.assertIsInstance(im.documentation_get(), eolian.Documentation) # TODO is UNRESOLVED correct ?
@@ -413,7 +416,7 @@ class TestEolianPart(unittest.TestCase):
413 part = parts[0] 416 part = parts[0]
414 self.assertEqual(part.name, 'backwall') 417 self.assertEqual(part.name, 'backwall')
415 self.assertIsInstance(part.class_, eolian.Class) 418 self.assertIsInstance(part.class_, eolian.Class)
416 self.assertEqual(part.class_.full_name, 'Efl.Ui.Popup.Part') 419 self.assertEqual(part.class_.name, 'Efl.Ui.Popup.Part')
417 self.assertIsInstance(part.documentation, eolian.Documentation) 420 self.assertIsInstance(part.documentation, eolian.Documentation)
418 421
419 422
@@ -424,10 +427,10 @@ class TestEolianConstructor(unittest.TestCase):
424 self.assertGreater(len(ctors), 0) 427 self.assertGreater(len(ctors), 0)
425 ctor = ctors[0] 428 ctor = ctors[0]
426 self.assertIsInstance(ctor, eolian.Constructor) 429 self.assertIsInstance(ctor, eolian.Constructor)
427 self.assertEqual(ctor.full_name, 'Efl.Ui.Win.win_name') 430 self.assertEqual(ctor.name, 'Efl.Ui.Win.win_name')
428 self.assertFalse(ctor.is_optional) 431 self.assertFalse(ctor.is_optional)
429 self.assertIsInstance(ctor.class_, eolian.Class) 432 self.assertIsInstance(ctor.class_, eolian.Class)
430 self.assertEqual(ctor.class_.full_name, 'Efl.Ui.Win') 433 self.assertEqual(ctor.class_.name, 'Efl.Ui.Win')
431 self.assertIsInstance(ctor.function, eolian.Function) 434 self.assertIsInstance(ctor.function, eolian.Function)
432 self.assertEqual(ctor.function.name, 'win_name') 435 self.assertEqual(ctor.function.name, 'win_name')
433 436
@@ -448,8 +451,8 @@ class TestEolianVariable(unittest.TestCase):
448 def test_variable_global(self): 451 def test_variable_global(self):
449 var = eolian_db.global_by_name_get('Efl.Net.Http.Error.BAD_CONTENT_ENCODING') 452 var = eolian_db.global_by_name_get('Efl.Net.Http.Error.BAD_CONTENT_ENCODING')
450 self.assertIsInstance(var, eolian.Variable) 453 self.assertIsInstance(var, eolian.Variable)
451 self.assertEqual(var.full_name, 'Efl.Net.Http.Error.BAD_CONTENT_ENCODING') 454 self.assertEqual(var.name, 'Efl.Net.Http.Error.BAD_CONTENT_ENCODING')
452 self.assertEqual(var.name, 'BAD_CONTENT_ENCODING') 455 self.assertEqual(var.short_name, 'BAD_CONTENT_ENCODING')
453 self.assertEqual(var.type, eolian.Eolian_Variable_Type.GLOBAL) 456 self.assertEqual(var.type, eolian.Eolian_Variable_Type.GLOBAL)
454 self.assertEqual(var.file, 'efl_net_http_types.eot') 457 self.assertEqual(var.file, 'efl_net_http_types.eot')
455 self.assertFalse(var.is_extern) 458 self.assertFalse(var.is_extern)
@@ -461,8 +464,8 @@ class TestEolianVariable(unittest.TestCase):
461 def test_variable_constant(self): 464 def test_variable_constant(self):
462 var = eolian_db.constant_by_name_get('Efl.Gfx.Size.Hint.Fill') 465 var = eolian_db.constant_by_name_get('Efl.Gfx.Size.Hint.Fill')
463 self.assertIsInstance(var, eolian.Variable) 466 self.assertIsInstance(var, eolian.Variable)
464 self.assertEqual(var.full_name, 'Efl.Gfx.Size.Hint.Fill') 467 self.assertEqual(var.name, 'Efl.Gfx.Size.Hint.Fill')
465 self.assertEqual(var.name, 'Fill') 468 self.assertEqual(var.short_name, 'Fill')
466 self.assertEqual(var.type, eolian.Eolian_Variable_Type.CONSTANT) 469 self.assertEqual(var.type, eolian.Eolian_Variable_Type.CONSTANT)
467 self.assertEqual(var.file, 'efl_gfx_size_hint.eo') 470 self.assertEqual(var.file, 'efl_gfx_size_hint.eo')
468 self.assertFalse(var.is_extern) 471 self.assertFalse(var.is_extern)
@@ -477,8 +480,8 @@ class TestEolianTypedecl(unittest.TestCase):
477 def test_typedecl_enum(self): 480 def test_typedecl_enum(self):
478 td = eolian_db.enum_by_name_get('Efl.Net.Http.Version') 481 td = eolian_db.enum_by_name_get('Efl.Net.Http.Version')
479 self.assertIsInstance(td, eolian.Typedecl) 482 self.assertIsInstance(td, eolian.Typedecl)
480 self.assertEqual(td.name, 'Version') 483 self.assertEqual(td.name, 'Efl.Net.Http.Version')
481 self.assertEqual(td.full_name, 'Efl.Net.Http.Version') 484 self.assertEqual(td.short_name, 'Version')
482 self.assertEqual(td.file, 'efl_net_http_types.eot') 485 self.assertEqual(td.file, 'efl_net_http_types.eot')
483 self.assertEqual(list(td.namespaces), ['Efl','Net','Http']) 486 self.assertEqual(list(td.namespaces), ['Efl','Net','Http'])
484 self.assertIsInstance(td.documentation, eolian.Documentation) 487 self.assertIsInstance(td.documentation, eolian.Documentation)
@@ -501,8 +504,8 @@ class TestEolianTypedecl(unittest.TestCase):
501 def test_typedecl_struct(self): 504 def test_typedecl_struct(self):
502 td = eolian_db.struct_by_name_get('Efl.Gfx.Color32') 505 td = eolian_db.struct_by_name_get('Efl.Gfx.Color32')
503 self.assertIsInstance(td, eolian.Typedecl) 506 self.assertIsInstance(td, eolian.Typedecl)
504 self.assertEqual(td.name, 'Color32') 507 self.assertEqual(td.name, 'Efl.Gfx.Color32')
505 self.assertEqual(td.full_name, 'Efl.Gfx.Color32') 508 self.assertEqual(td.short_name, 'Color32')
506 self.assertEqual(td.file, 'efl_canvas_filter_internal.eo') 509 self.assertEqual(td.file, 'efl_canvas_filter_internal.eo')
507 self.assertEqual(list(td.namespaces), ['Efl','Gfx']) 510 self.assertEqual(list(td.namespaces), ['Efl','Gfx'])
508 self.assertIsInstance(td.documentation, eolian.Documentation) 511 self.assertIsInstance(td.documentation, eolian.Documentation)
@@ -525,8 +528,8 @@ class TestEolianTypedecl(unittest.TestCase):
525 alias = eolian_db.alias_by_name_get('Eina.Error') 528 alias = eolian_db.alias_by_name_get('Eina.Error')
526 self.assertIsInstance(alias, eolian.Typedecl) 529 self.assertIsInstance(alias, eolian.Typedecl)
527 self.assertEqual(alias.type, eolian.Eolian_Typedecl_Type.ALIAS) 530 self.assertEqual(alias.type, eolian.Eolian_Typedecl_Type.ALIAS)
528 self.assertEqual(alias.name, 'Error') 531 self.assertEqual(alias.name, 'Eina.Error')
529 self.assertEqual(alias.full_name, 'Eina.Error') 532 self.assertEqual(alias.short_name, 'Error')
530 self.assertIsInstance(alias.aliased_base, eolian.Type) 533 self.assertIsInstance(alias.aliased_base, eolian.Type)
531 self.assertEqual(alias.aliased_base.name, 'int') 534 self.assertEqual(alias.aliased_base.name, 'int')
532 self.assertEqual(alias.c_type, 'typedef int Eina_Error') 535 self.assertEqual(alias.c_type, 'typedef int Eina_Error')
@@ -540,7 +543,7 @@ class TestEolianType(unittest.TestCase):
540 t = param.type # type: double 543 t = param.type # type: double
541 self.assertIsInstance(t, eolian.Type) 544 self.assertIsInstance(t, eolian.Type)
542 self.assertEqual(t.name, 'double') 545 self.assertEqual(t.name, 'double')
543 self.assertEqual(t.full_name, 'double') 546 self.assertEqual(t.short_name, 'double')
544 self.assertEqual(t.type, eolian.Eolian_Type_Type.REGULAR) 547 self.assertEqual(t.type, eolian.Eolian_Type_Type.REGULAR)
545 self.assertEqual(t.builtin_type, eolian.Eolian_Type_Builtin_Type.DOUBLE) 548 self.assertEqual(t.builtin_type, eolian.Eolian_Type_Builtin_Type.DOUBLE)
546 self.assertEqual(t.file, 'efl_loop_timer.eo') # TODO is this correct ? 549 self.assertEqual(t.file, 'efl_loop_timer.eo') # TODO is this correct ?
@@ -564,8 +567,8 @@ class TestEolianType(unittest.TestCase):
564 param = list(func.setter_values)[0] 567 param = list(func.setter_values)[0]
565 t = param.type # type: Eina.Rect 568 t = param.type # type: Eina.Rect
566 self.assertIsInstance(t, eolian.Type) 569 self.assertIsInstance(t, eolian.Type)
567 self.assertEqual(t.name, 'Rect') 570 self.assertEqual(t.name, 'Eina.Rect')
568 self.assertEqual(t.full_name, 'Eina.Rect') 571 self.assertEqual(t.short_name, 'Rect')
569 self.assertEqual(t.type, eolian.Eolian_Type_Type.REGULAR) 572 self.assertEqual(t.type, eolian.Eolian_Type_Type.REGULAR)
570 self.assertEqual(t.builtin_type, eolian.Eolian_Type_Builtin_Type.INVALID) 573 self.assertEqual(t.builtin_type, eolian.Eolian_Type_Builtin_Type.INVALID)
571 self.assertEqual(t.file, 'efl_gfx.eo') # TODO is this correct ? 574 self.assertEqual(t.file, 'efl_gfx.eo') # TODO is this correct ?
@@ -580,7 +583,7 @@ class TestEolianType(unittest.TestCase):
580 583
581 td = t.typedecl 584 td = t.typedecl
582 self.assertIsInstance(td, eolian.Typedecl) 585 self.assertIsInstance(td, eolian.Typedecl)
583 self.assertEqual(td.full_name, 'Eina.Rect') 586 self.assertEqual(td.name, 'Eina.Rect')
584 587
585 def test_type_class(self): 588 def test_type_class(self):
586 cls = eolian_db.class_by_name_get('Efl.Content') 589 cls = eolian_db.class_by_name_get('Efl.Content')
@@ -588,8 +591,8 @@ class TestEolianType(unittest.TestCase):
588 param = list(func.setter_values)[0] 591 param = list(func.setter_values)[0]
589 t = param.type # type: Efl.Gfx (class interface) 592 t = param.type # type: Efl.Gfx (class interface)
590 self.assertIsInstance(t, eolian.Type) 593 self.assertIsInstance(t, eolian.Type)
591 self.assertEqual(t.name, 'Gfx') 594 self.assertEqual(t.name, 'Efl.Gfx')
592 self.assertEqual(t.full_name, 'Efl.Gfx') 595 self.assertEqual(t.short_name, 'Gfx')
593 self.assertEqual(t.type, eolian.Eolian_Type_Type.CLASS) 596 self.assertEqual(t.type, eolian.Eolian_Type_Type.CLASS)
594 self.assertEqual(t.builtin_type, eolian.Eolian_Type_Builtin_Type.INVALID) 597 self.assertEqual(t.builtin_type, eolian.Eolian_Type_Builtin_Type.INVALID)
595 self.assertEqual(t.file, 'efl_content.eo') # TODO is this correct ? 598 self.assertEqual(t.file, 'efl_content.eo') # TODO is this correct ?
@@ -603,7 +606,7 @@ class TestEolianType(unittest.TestCase):
603 606
604 cls = t.class_ 607 cls = t.class_
605 self.assertIsInstance(cls, eolian.Class) 608 self.assertIsInstance(cls, eolian.Class)
606 self.assertEqual(cls.full_name, 'Efl.Gfx') 609 self.assertEqual(cls.name, 'Efl.Gfx')
607 610
608 611
609class TestEolianExpression(unittest.TestCase): 612class TestEolianExpression(unittest.TestCase):