autotest: param_parse.py: correct JSON output

This commit is contained in:
Peter Barker 2021-12-20 12:34:13 +11:00 committed by Willian Galvani
parent ca402ffb2e
commit 74f8ceeb41

View File

@ -12,7 +12,6 @@ class JSONEmit(Emit):
json_fname = 'apm.pdef.json' json_fname = 'apm.pdef.json'
self.f = open(json_fname, mode='w') self.f = open(json_fname, mode='w')
self.content = {"json": {"version": 0}} self.content = {"json": {"version": 0}}
self.name = ''
def close(self): def close(self):
json.dump(self.content, self.f, indent=2, sort_keys=True) json.dump(self.content, self.f, indent=2, sort_keys=True)
@ -33,7 +32,7 @@ class JSONEmit(Emit):
# Copy content to avoid any modification # Copy content to avoid any modification
g = copy.deepcopy(g) g = copy.deepcopy(g)
self.content[self.name] = {} self.content[g.name] = {}
# Check all params available # Check all params available
for param in g.params: for param in g.params:
@ -97,4 +96,4 @@ class JSONEmit(Emit):
# Update main content with actual content # Update main content with actual content
for key in content: for key in content:
self.content[self.name][key] = content[key] self.content[g.name][key] = content[key]