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

sanitytest: Use set for tracking used functions

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

View File

@@ -327,10 +327,10 @@ for name, (klass, func, cname) in sorted(basicklassmap.items()):
# Phase 5: Validate sure that every C API is mapped to a python API
usedfunctions = {} # type: Dict[str, int]
usedfunctions = set() # type: Set[str]
for name, (klass, func, cname) in sorted(finalklassmap.items()):
if func in gotfunctions[klass]:
usedfunctions["%s.%s" % (klass, func)] = 1
usedfunctions.add("%s.%s" % (klass, func))
if verbose:
print("PASS %s -> %s.%s" % (name, klass, func))
else:
@@ -350,7 +350,7 @@ for klass in gotfunctions:
continue
key = "%s.%s" % (klass, func)
if not key in usedfunctions:
if key not in usedfunctions:
print("FAIL %s.%s (Python API not mapped to C)" % (klass, func))
fail = True
else: