forked from enlightenment/efl
Pyolian tests: 2 small improvements
1. properly use unittest infra to skip tests, otherwise we will forgot the commented tests 2. split the new name collision test (failing, but really cool) so it have a proper name and the results are more readable
This commit is contained in:
parent
a10eda5137
commit
433b561e27
|
@ -389,7 +389,6 @@ class Eolian_Unit(EolianBaseObject):
|
||||||
c_tdecl = lib.eolian_unit_alias_by_name_get(self, _str_to_bytes(name))
|
c_tdecl = lib.eolian_unit_alias_by_name_get(self, _str_to_bytes(name))
|
||||||
return Typedecl(c_tdecl) if c_tdecl else None
|
return Typedecl(c_tdecl) if c_tdecl else None
|
||||||
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def all_namespaces(self):
|
def all_namespaces(self):
|
||||||
# TODO find a better way to find namespaces (maybe inside eolian?)
|
# TODO find a better way to find namespaces (maybe inside eolian?)
|
||||||
|
@ -530,7 +529,6 @@ class Namespace(object):
|
||||||
deep = self._name.count('.') + 1
|
deep = self._name.count('.') + 1
|
||||||
return [ ns for ns in self._unit.all_namespaces
|
return [ ns for ns in self._unit.all_namespaces
|
||||||
if ns.name.startswith(base) and ns.name.count('.') == deep ]
|
if ns.name.startswith(base) and ns.name.count('.') == deep ]
|
||||||
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def classes(self):
|
def classes(self):
|
||||||
|
|
|
@ -97,11 +97,11 @@ class TestEolianUnit(unittest.TestCase):
|
||||||
self.assertIsInstance(unit, eolian.Eolian_Unit)
|
self.assertIsInstance(unit, eolian.Eolian_Unit)
|
||||||
self.assertEqual(unit.file, 'efl_ui_win.eo')
|
self.assertEqual(unit.file, 'efl_ui_win.eo')
|
||||||
|
|
||||||
# Commented out until unit/state support is fixed
|
@unittest.skip('Skipped until unit/state support is fixed')
|
||||||
# def test_children_listing(self):
|
def test_children_listing(self):
|
||||||
# l = list(eolian_db.children)
|
l = list(eolian_db.children)
|
||||||
# self.assertGreater(len(l), 500)
|
self.assertGreater(len(l), 500)
|
||||||
# self.assertIsInstance(l[0], eolian.Eolian_Unit)
|
self.assertIsInstance(l[0], eolian.Eolian_Unit)
|
||||||
|
|
||||||
def test_file_listing(self):
|
def test_file_listing(self):
|
||||||
l = list(eolian_db.eo_file_paths)
|
l = list(eolian_db.eo_file_paths)
|
||||||
|
@ -210,11 +210,14 @@ class TestEolianNamespace(unittest.TestCase):
|
||||||
count = 0
|
count = 0
|
||||||
for ns in eolian_db.all_namespaces:
|
for ns in eolian_db.all_namespaces:
|
||||||
self.assertIsInstance(ns, eolian.Namespace)
|
self.assertIsInstance(ns, eolian.Namespace)
|
||||||
cls = eolian_db.class_by_name_get(ns.name)
|
|
||||||
self.assertIsNone(cls)
|
|
||||||
count += 1
|
count += 1
|
||||||
self.assertGreater(count, 100)
|
self.assertGreater(count, 100)
|
||||||
|
|
||||||
|
def test_namespace_vs_class_collision(self):
|
||||||
|
for ns in eolian_db.all_namespaces:
|
||||||
|
cls = eolian_db.class_by_name_get(ns.name)
|
||||||
|
self.assertIsNone(cls)
|
||||||
|
|
||||||
def test_namespace_equality(self):
|
def test_namespace_equality(self):
|
||||||
ns1 = eolian.Namespace(eolian_db, 'Efl.Io')
|
ns1 = eolian.Namespace(eolian_db, 'Efl.Io')
|
||||||
ns2 = eolian.Namespace(eolian_db, 'Efl.Net')
|
ns2 = eolian.Namespace(eolian_db, 'Efl.Net')
|
||||||
|
|
Loading…
Reference in New Issue