summaryrefslogtreecommitdiff
path: root/src/scripts
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 /src/scripts
parenta10eda5137aeaf7fd91c11f353c9be9fc6cdbcb8 (diff)
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
Diffstat (limited to 'src/scripts')
-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):
389 c_tdecl = lib.eolian_unit_alias_by_name_get(self, _str_to_bytes(name)) 389 c_tdecl = lib.eolian_unit_alias_by_name_get(self, _str_to_bytes(name))
390 return Typedecl(c_tdecl) if c_tdecl else None 390 return Typedecl(c_tdecl) if c_tdecl else None
391 391
392
393 @property 392 @property
394 def all_namespaces(self): 393 def all_namespaces(self):
395 # TODO find a better way to find namespaces (maybe inside eolian?) 394 # TODO find a better way to find namespaces (maybe inside eolian?)
@@ -530,7 +529,6 @@ class Namespace(object):
530 deep = self._name.count('.') + 1 529 deep = self._name.count('.') + 1
531 return [ ns for ns in self._unit.all_namespaces 530 return [ ns for ns in self._unit.all_namespaces
532 if ns.name.startswith(base) and ns.name.count('.') == deep ] 531 if ns.name.startswith(base) and ns.name.count('.') == deep ]
533
534 532
535 @property 533 @property
536 def classes(self): 534 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):
97 self.assertIsInstance(unit, eolian.Eolian_Unit) 97 self.assertIsInstance(unit, eolian.Eolian_Unit)
98 self.assertEqual(unit.file, 'efl_ui_win.eo') 98 self.assertEqual(unit.file, 'efl_ui_win.eo')
99 99
100 # Commented out until unit/state support is fixed 100 @unittest.skip('Skipped until unit/state support is fixed')
101 # def test_children_listing(self): 101 def test_children_listing(self):
102 # l = list(eolian_db.children) 102 l = list(eolian_db.children)
103 # self.assertGreater(len(l), 500) 103 self.assertGreater(len(l), 500)
104 # self.assertIsInstance(l[0], eolian.Eolian_Unit) 104 self.assertIsInstance(l[0], eolian.Eolian_Unit)
105 105
106 def test_file_listing(self): 106 def test_file_listing(self):
107 l = list(eolian_db.eo_file_paths) 107 l = list(eolian_db.eo_file_paths)
@@ -210,11 +210,14 @@ class TestEolianNamespace(unittest.TestCase):
210 count = 0 210 count = 0
211 for ns in eolian_db.all_namespaces: 211 for ns in eolian_db.all_namespaces:
212 self.assertIsInstance(ns, eolian.Namespace) 212 self.assertIsInstance(ns, eolian.Namespace)
213 cls = eolian_db.class_by_name_get(ns.name)
214 self.assertIsNone(cls)
215 count += 1 213 count += 1
216 self.assertGreater(count, 100) 214 self.assertGreater(count, 100)
217 215
216 def test_namespace_vs_class_collision(self):
217 for ns in eolian_db.all_namespaces:
218 cls = eolian_db.class_by_name_get(ns.name)
219 self.assertIsNone(cls)
220
218 def test_namespace_equality(self): 221 def test_namespace_equality(self):
219 ns1 = eolian.Namespace(eolian_db, 'Efl.Io') 222 ns1 = eolian.Namespace(eolian_db, 'Efl.Io')
220 ns2 = eolian.Namespace(eolian_db, 'Efl.Net') 223 ns2 = eolian.Namespace(eolian_db, 'Efl.Net')