diff --git a/Tst/json_to_barescript.py b/Tst/json_to_barescript.py index 063904bcfe98a88e6d88e5928173b33c3ffe1e0b..c4db6a17c15aa996fda8f7f07f07c63d09bdea2e 100755 --- a/Tst/json_to_barescript.py +++ b/Tst/json_to_barescript.py @@ -46,13 +46,13 @@ def run(jfile, outfile, reportfunc=False, specfile=None): script += 'report = cfl.TestReport(specfile, rep_version, mib_version, gui=True)\n\n' # init code - script += '# INIT CODE\n{}\n#! CCS.BREAKPOINT\n\n'.format(data['_custom_imports']) + script += '# INIT CODE\n{}\n#! CCS.BREAKPOINT\n\n'.format(data.get('_custom_imports')) script += '# PRECONDITIONS\n# {}\n#! CCS.BREAKPOINT\n\n'.format(replace_newline(data['_precon_descr'])) # script += '{}\n\n\n'.format(data['_precon_code'].strip()) # Add the precondition code for step in data['sequences'][0]['steps']: - comment = '# COMMENT: {}\n'.format(step['_step_comment'].strip()) if step['_step_comment'] != '' else '' + comment = '# COMMENT: {}\n'.format(replace_newline(step['_step_comment'])) if step['_step_comment'] != '' else '' cmd_code = step['_command_code'].strip() cmd_code += '\n' if cmd_code else '' @@ -68,9 +68,9 @@ def run(jfile, outfile, reportfunc=False, specfile=None): '# {}\n' \ '{}' \ '{}' \ - '# VERIFICATION: {}\n{}{}\n#! CCS.BREAKPOINT\n\n'.format(step['_step_number'], step['_description'].strip(), exec_step, + '# VERIFICATION: {}\n{}{}\n#! CCS.BREAKPOINT\n\n'.format(step['_step_number'], replace_newline(step['_description']), exec_step, cmd_code, - step['_verification_description'].strip(), + replace_newline(step['_verification_description']), verif_step, # step['_verification_code'].strip(), # Add verification code comment)