1
0
mirror of https://gitlab.com/libvirt/libvirt-python.git synced 2025-12-07 04:23:47 +03:00

sanitytest: Use 3-tuple for finalklassmap

Signed-off-by: Philipp Hahn <hahn@univention.de>
This commit is contained in:
Philipp Hahn
2020-04-20 08:55:34 +02:00
parent 809b963134
commit ddf73e40a9

View File

@@ -323,15 +323,12 @@ for name, (klass, func, cname) in sorted(basicklassmap.items()):
if func == "mACString": if func == "mACString":
func = "MACString" func = "MACString"
finalklassmap[name] = [klass, func, cname] finalklassmap[name] = (klass, func, cname)
# Phase 5: Validate sure that every C API is mapped to a python API # Phase 5: Validate sure that every C API is mapped to a python API
usedfunctions = {} # type: Dict[str, int] usedfunctions = {} # type: Dict[str, int]
for name in sorted(finalklassmap): for name, (klass, func, cname) in sorted(finalklassmap.items()):
klass = finalklassmap[name][0]
func = finalklassmap[name][1]
if func in gotfunctions[klass]: if func in gotfunctions[klass]:
usedfunctions["%s.%s" % (klass, func)] = 1 usedfunctions["%s.%s" % (klass, func)] = 1
if verbose: if verbose:
@@ -361,9 +358,7 @@ for klass in gotfunctions:
print("PASS %s.%s" % (klass, func)) print("PASS %s.%s" % (klass, func))
# Phase 7: Validate that all the low level C APIs have binding # Phase 7: Validate that all the low level C APIs have binding
for name in sorted(finalklassmap): for name, (klass, func, cname) in sorted(finalklassmap.items()):
cname = finalklassmap[name][2]
pyname = cname pyname = cname
if pyname == "virSetErrorFunc": if pyname == "virSetErrorFunc":
pyname = "virRegisterErrorHandler" pyname = "virRegisterErrorHandler"