Skip to content
Snippets Groups Projects
Commit 5dd63a84 authored by Florian Obersteiner's avatar Florian Obersteiner
Browse files

minor refactor

parent 5f540bbd
Branches
Tags
1 merge request!5introduction of pathlib.Path
This commit is part of merge request !5. Comments created here will be created in the context of that merge request.
......@@ -12,24 +12,24 @@ fns = (wd/'examples').glob('*.ict')
def compareFiles(fn, strIn, strOut, skiplines=0, nlines=-1): # pragma: no cover
strOut.seek(0)
strIn.seek(0)
input = strIn.readlines()
output = strOut.readlines()
content_in = strIn.readlines()
content_out = strOut.readlines()
strIn.close()
strOut.close()
if nlines > 0:
input = input[skiplines:(skiplines+nlines)]
output = output[skiplines:(skiplines+nlines)]
content_in = content_in[skiplines:(skiplines+nlines)]
content_out = content_out[skiplines:(skiplines+nlines)]
else:
input = input[skiplines:]
output = output[skiplines:]
content_in = content_in[skiplines:]
content_out = content_out[skiplines:]
if not len(input) == len(output):
if not len(content_in) == len(content_out):
return False
for i in range(len(input)):
inline = input[i].strip().replace(" ", "")
outline = output[i].strip().replace(" ", "")
for inline, outline in zip(content_in, content_out):
inline = inline.strip().replace(" ", "")
outline = outline.strip().replace(" ", "")
if not inline == outline:
valid_data_line = False
# maybe this is a data line in which we only have different number formatting?
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment