diff --git a/Tst/json_to_barescript.py b/Tst/json_to_barescript.py index 9ef58a79b86c2e86b44a4978fc0c6fc55a2e1a61..7015b9329ac92115b5d00c529feb66a8caac0bde 100755 --- a/Tst/json_to_barescript.py +++ b/Tst/json_to_barescript.py @@ -31,7 +31,8 @@ def run(jfile, outfile): script += '# Specification Version: ' + data['_spec_version'] + '\n' script += '# Software Version: ' + data['_iasw_version'] + '\n' 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 += '{}\n\n\n'.format(data['_precon_code'].strip()) # Add the precondition code diff --git a/Tst/json_to_csv.py b/Tst/json_to_csv.py index 57723b8f5d3d9f7779b3f01973f54b3318b23758..cb57d96c6cb02c87ffbd5de9dccc6d14a8a8331b 100755 --- a/Tst/json_to_csv.py +++ b/Tst/json_to_csv.py @@ -17,6 +17,7 @@ def run(jfile, outfile): 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 = 'Date||{}|'.format(datetime.datetime.now().strftime('%Y-%m-%d')) + testcomment = 'Comment|{}||'.format(data['_comment']) precond = 'Precond.|{}||'.format(data['_precon_descr']) postcond = 'Postcond.|{}||'.format(data['_postcon_descr']) steps = [] @@ -34,7 +35,10 @@ def run(jfile, outfile): outfile = outfile + data['_name'] + '-' + '-'.join(data['_spec_version'].split('-')[-2:]) + '.csv_PIPE' 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('_', '\\_') fd.write(buf)