Skip to content
Snippets Groups Projects
Commit 47d88b8d authored by Marko Mecina's avatar Marko Mecina
Browse files

update TST JSON converters

parent 0a933abc
No related branches found
No related tags found
Loading
...@@ -31,7 +31,8 @@ def run(jfile, outfile): ...@@ -31,7 +31,8 @@ def run(jfile, outfile):
script += '# Specification Version: ' + data['_spec_version'] + '\n' script += '# Specification Version: ' + data['_spec_version'] + '\n'
script += '# Software Version: ' + data['_iasw_version'] + '\n' script += '# Software Version: ' + data['_iasw_version'] + '\n'
script += '# Author: UVIE\n# Date: {}\n'.format(date) script += '# Author: UVIE\n# Date: {}\n'.format(date)
script += '#--------------------------------------------\n\n\n' script += '#--------------------------------------------\n\n'
script += '# COMMENT: {}\n\n\n'.format(data['_comment'])
script += '# Precond.\n# {}\n'.format(data['_precon_descr']) script += '# Precond.\n# {}\n'.format(data['_precon_descr'])
# script += '{}\n\n\n'.format(data['_precon_code'].strip()) # Add the precondition code # script += '{}\n\n\n'.format(data['_precon_code'].strip()) # Add the precondition code
......
...@@ -17,6 +17,7 @@ def run(jfile, outfile): ...@@ -17,6 +17,7 @@ def run(jfile, outfile):
name = '{}|{}|Test spec. version: {}| IASW-{}'.format(data['_name'], data['_description'], data['_spec_version'], data['_iasw_version']) name = '{}|{}|Test spec. version: {}| IASW-{}'.format(data['_name'], data['_description'], data['_spec_version'], data['_iasw_version'])
# Date from last time the json file was changed + current date # Date from last time the json file was changed + current date
date = 'Date||{}|'.format(datetime.datetime.now().strftime('%Y-%m-%d')) date = 'Date||{}|'.format(datetime.datetime.now().strftime('%Y-%m-%d'))
testcomment = 'Comment|{}||'.format(data['_comment'])
precond = 'Precond.|{}||'.format(data['_precon_descr']) precond = 'Precond.|{}||'.format(data['_precon_descr'])
postcond = 'Postcond.|{}||'.format(data['_postcon_descr']) postcond = 'Postcond.|{}||'.format(data['_postcon_descr'])
steps = [] steps = []
...@@ -34,7 +35,10 @@ def run(jfile, outfile): ...@@ -34,7 +35,10 @@ def run(jfile, outfile):
outfile = outfile + data['_name'] + '-' + '-'.join(data['_spec_version'].split('-')[-2:]) + '.csv_PIPE' outfile = outfile + data['_name'] + '-' + '-'.join(data['_spec_version'].split('-')[-2:]) + '.csv_PIPE'
with open(outfile, 'w') as fd: with open(outfile, 'w') as fd:
buf = '\n'.join([header, name, date, precond] + steps + [postcond]) if len(data['_comment']) != 0:
buf = '\n'.join([header, name, date, testcomment, precond] + steps + [postcond])
else:
buf = '\n'.join([header, name, date, precond] + steps + [postcond])
buf = buf.replace('_', '\\_') buf = buf.replace('_', '\\_')
fd.write(buf) fd.write(buf)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment