pyloxi: create inheritance hierarchy
Virtual classes are generated but currently only serve as superclasses.
Somehow this works without topologically sorting the classes.
diff --git a/py_gen/tests/of11.py b/py_gen/tests/of11.py
index 07a5437..b30a40c 100644
--- a/py_gen/tests/of11.py
+++ b/py_gen/tests/of11.py
@@ -28,6 +28,7 @@
import unittest
try:
+ import loxi
import loxi.of11 as ofp
except ImportError:
exit("loxi package not found. Try setting PYTHONPATH.")
@@ -65,7 +66,9 @@
mods = [ofp.action,ofp.message,ofp.common]
self.klasses = [klass for mod in mods
for klass in mod.__dict__.values()
- if hasattr(klass, 'show')]
+ if isinstance(klass, type) and
+ issubclass(klass, loxi.OFObject) and
+ hasattr(klass, 'pack')]
self.klasses.sort(key=lambda x: str(x))
def test_serialization(self):
@@ -85,7 +88,7 @@
def test_parse_message(self):
expected_failures = []
for klass in self.klasses:
- if not issubclass(klass, ofp.message.Message):
+ if not issubclass(klass, ofp.message.message):
continue
def fn():
obj = klass(xid=42)