Commit 5d70dc78 authored by Yann Voté's avatar Yann Voté
Browse files

[test] Improve print function for edef

Handle case where size is 2.
parent dde925813aaa
......@@ -226,9 +226,13 @@ class XSIterateTC(unittest.TestCase):
def readable_edef(edef):
name = lambda e: getattr(e, 'local_name', e.__class__.__name__)
return (name(edef[0]), edef[1],
[(name(rdef[0].target), [x[:-1] for x in rdef[1]])
for rdef in edef[2]])
if len(edef) == 3:
return (name(edef[0]), edef[1],
[(name(rdef[0].target), [x[:-1] for x in rdef[1]])
for rdef in edef[2]])
else:
return (edef[0], [(name(rdef[0].target), [x[:-1] for x in rdef[1]])
for rdef in edef[1]])
if __name__ == '__main__':
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment