summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Andreoli <dave@gurumeditation.it>2018-11-28 20:16:19 +0100
committerDave Andreoli <dave@gurumeditation.it>2018-11-28 20:16:19 +0100
commit433b561e276b8965dcc109773e6a3bc05897c322 (patch)
tree59388904c624488fc2345beba6a0a7c4cad07eb5
parenta10eda5137aeaf7fd91c11f353c9be9fc6cdbcb8 (diff)
downloadefl-433b561e276b8965dcc109773e6a3bc05897c322.tar.gz
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
-rw-r--r--src/scripts/pyolian/eolian.py2
-rwxr-xr-xsrc/scripts/pyolian/test_eolian.py17
2 files changed, 10 insertions, 9 deletions
diff --git a/src/scripts/pyolian/eolian.py b/src/scripts/pyolian/eolian.py
index 5a5767662a..49d288df89 100644
--- a/src/scripts/pyolian/eolian.py
+++ b/src/scripts/pyolian/eolian.py
@@ -389,7 +389,6 @@ class Eolian_Unit(EolianBaseObject):
c_tdecl = lib.eolian_unit_alias_by_name_get(self, _str_to_bytes(name))
return Typedecl(c_tdecl) if c_tdecl else None
-
@property
def all_namespaces(self):
# TODO find a better way to find namespaces (maybe inside eolian?)
@@ -530,7 +529,6 @@ class Namespace(object):
deep = self._name.count('.') + 1
return [ ns for ns in self._unit.all_namespaces
if ns.name.startswith(base) and ns.name.count('.') == deep ]
-
@property
def classes(self):
diff --git a/src/scripts/pyolian/test_eolian.py b/src/scripts/pyolian/test_eolian.py
index 0ed27c2180..a1ab85b2e3 100755
--- a/src/scripts/pyolian/test_eolian.py
+++ b/src/scripts/pyolian/test_eolian.py
@@ -97,11 +97,11 @@ class TestEolianUnit(unittest.TestCase):
self.assertIsInstance(unit, eolian.Eolian_Unit)
self.assertEqual(unit.file, 'efl_ui_win.eo')
- # Commented out until unit/state support is fixed
- # def test_children_listing(self):
- # l = list(eolian_db.children)
- # self.assertGreater(len(l), 500)
- # self.assertIsInstance(l[0], eolian.Eolian_Unit)
+ @unittest.skip('Skipped until unit/state support is fixed')
+ def test_children_listing(self):
+ l = list(eolian_db.children)
+ self.assertGreater(len(l), 500)
+ self.assertIsInstance(l[0], eolian.Eolian_Unit)
def test_file_listing(self):
l = list(eolian_db.eo_file_paths)
@@ -210,11 +210,14 @@ class TestEolianNamespace(unittest.TestCase):
count = 0
for ns in eolian_db.all_namespaces:
self.assertIsInstance(ns, eolian.Namespace)
- cls = eolian_db.class_by_name_get(ns.name)
- self.assertIsNone(cls)
count += 1
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):
ns1 = eolian.Namespace(eolian_db, 'Efl.Io')
ns2 = eolian.Namespace(eolian_db, 'Efl.Net')