Added support for the last InteractiveHtmlBom to the tests.

Now the PCB modules are located in the footprints section of the
generated data. This change is a general move from the module
term to a more descriptive term `footprint`.
This commit is contained in:
Salvador E. Tropea 2020-12-29 09:01:58 -03:00
parent 4a3e7faace
commit f1c868b732
1 changed files with 4 additions and 1 deletions

View File

@ -38,9 +38,12 @@ def check_modules(ctx, fname, expected):
assert m, text
lz = LZString()
js = lz.decompressFromBase64(m.group(1))
# with open('/tmp/dump', 'wt') as f:
# f.write(js)
data = json.loads(js)
skipped = data['bom']['skipped']
modules = [m['ref'] for m in data['modules']]
footprints_name = 'modules' if 'modules' in data else 'footprints'
modules = [m['ref'] for m in data[footprints_name]]
assert len(modules)-len(skipped) == len(expected)
logging.debug("{} components OK".format(len(expected)))
for m in expected: