When testing that the lines in the generated QM input file are correct the current testing will read the generated input file lines:
outfile = open(f'{w_dir_main}/failed/run_1/fixed_QM_inputs/{file.split(".")[0]}.com', "r")
outlines = outfile.readlines()
outfile.close()
Then do something like:
assert outlines[8].strip() == line_8
Where line_8 is defined in the test code to be the expected value.
The .strip() removes the newline character. This assert statement is sensitive to column spacing, which is invariant to the actual QM software, so instead what if we made these assert statements:
assert outlines[8].strip().split() == line_8.split()
When testing that the lines in the generated QM input file are correct the current testing will read the generated input file lines:
outfile = open(f'{w_dir_main}/failed/run_1/fixed_QM_inputs/{file.split(".")[0]}.com', "r")outlines = outfile.readlines()outfile.close()Then do something like:
assert outlines[8].strip() == line_8Where line_8 is defined in the test code to be the expected value.
The .strip() removes the newline character. This assert statement is sensitive to column spacing, which is invariant to the actual QM software, so instead what if we made these assert statements:
assert outlines[8].strip().split() == line_8.split()