Skip to content
Snippets Groups Projects
Commit 3e71420c authored by Sebastien Jourdain's avatar Sebastien Jourdain
Browse files

Remove usage of the keyword with to allow old python

Change-Id: I9661715be9fee31060c1959d4044c953d3d88185
parent 736f789b
No related branches found
No related tags found
No related merge requests found
......@@ -32,32 +32,35 @@ writer.Write()
# Try to load JSON file and compare with dumped data
print "Writing file:", tmp_file
with open(tmp_file, "r") as json_file:
json_obj = json.load(json_file)
slice = json_obj['RTData']
if json_obj["dimensions"] != dim_ref:
print "Dimension ERROR"
sys.exit(1)
else:
print "Dimension OK"
if json_obj["origin"] != origin_ref:
print "Origin ERROR"
sys.exit(1)
else:
print "Origin OK"
if json_obj["spacing"] != spacing_ref:
print "Spacing ERROR"
sys.exit(1)
else:
print "Spacing OK"
if len(slice) == 441:
print "Slice size OK"
else:
print "Slice size ERROR - Size of ", str(len(slice))
json_file = open(tmp_file, "r")
json_obj = json.load(json_file)
json_file.close()
slice = json_obj['RTData']
if json_obj["dimensions"] != dim_ref:
print "Dimension ERROR"
sys.exit(1)
else:
print "Dimension OK"
if json_obj["origin"] != origin_ref:
print "Origin ERROR"
sys.exit(1)
else:
print "Origin OK"
if json_obj["spacing"] != spacing_ref:
print "Spacing ERROR"
sys.exit(1)
else:
print "Spacing OK"
if len(slice) == 441:
print "Slice size OK"
else:
print "Slice size ERROR - Size of ", str(len(slice))
sys.exit(1)
for i in range(len(expected_first_values)):
if expected_first_values[i] != slice[i]:
sys.exit(1)
for i in range(len(expected_first_values)):
if expected_first_values[i] != slice[i]:
sys.exit(1)
print "All good..."
sys.exit()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment