Trying to get these series of tests to add their results to content and then at the end of the script to write the collected content to a text file under the correct headings dictated under criteria. The first test works properly but none of the ones after that. No error, just no appended information. I need to figure out what I'm doing wrong and how to have the content be appended under the right sections. Please help!
def writeReport(): #writes content to report file without truncating
reportFile = 'report.txt'
bigspacer = '================================================================================================================================'
littlespacer = '--------------------------------------------------------------------------------------------------------------------------------'
si = ' Single Install'
criteria = ['0',
'1 Did the installation complete successfully',
'2 Installed shortcuts. *.ico files should get installed in bin folder to be used by registry entries and IQR/IQJ images %CADIQ_HOME%\\samples\\cadiq\\compare_*\\*.iqr',
'3 Installed files/folders match those of the central area',
'4 Was the license file correctly copied and updated (temp lic when only the viewer is installed (lic panel should not be displayed))',
'5 Were correct CIQEL files in correct location (updated correctly)',
'6 Were the correct cadscript/bin/plat-XXX/cadscript_XXX installed (no extras)',
'7 Was cadiq or cadiq.bat updated correctly',
'8 Were the correct version_xx.txt and cadscript.cfg files in their correct place',
'9 Was cadscript.cfg updated correctly',
'10 Was the correct pdelib files there',
'11 Does a CADIQ Analysis work',
'12 Overall Pass/Fail']
installpath = drive + ':\\CADIQ\\v' + version + '_' + cadsys + '_si'
passes = 0
fails = 0
NAs = 0
content = bigspacer + '\n' + cadsys + si + '\n' + bigspacer + '\n'
# loop for each test criteria
for test in criteria:
if test == criteria[0]:
continue
content += '\n' + littlespacer + '\n' + test + '\n'
testsuccess = 1
nonapplicable = 0
relevantfolder = None
# test 1
if test == criteria[1]:
content += 'Things' + '\n'
# test 2 (Icons are on desktop, try looking here in test)
if test == criteria[2]:
content += 'Things' + '\n'
# test 3
if test == criteria[3]:
content += 'Things' + '\n'
# test 4
if test == criteria[4]:
content += 'Things' + '\n'
# test 5
if test == criteria[5]:
content += 'Things' + '\n'
# test 6
if test == criteria[6]:
content += 'Things' + '\n'
# test 7
if test == criteria[7]:
content += 'Things' + '\n'
# test 8
if test == criteria[8]:
content += 'Things' + '\n'
# test 9
if test == criteria[9]:
content += 'Things' + '\n'
# test 10
if test == criteria[10]:
content += 'Things' + '\n'
# test 11
if test == criteria[11]:
content += 'Things' + '\n'
# test 12
if test == criteria[12]:
content += 'Things' + '\n'
# end loop
# write
with open(reportFile, 'a') as f:
f.write(content)
Aucun commentaire:
Enregistrer un commentaire