Skip to content
Snippets Groups Projects
Commit ac0ba15a authored by Paul McCarthy's avatar Paul McCarthy :mountain_bicyclist:
Browse files

bugfix to test

parent 5f11f96f
No related branches found
No related tags found
No related merge requests found
Pipeline #
......@@ -750,9 +750,14 @@ def _test_Image_changeData(imgtype):
newdmin = dmin - 100
newdmax = dmax + 100
# random value below the data range
minx, miny, minz = randvox()
img[minx, miny, minz] = newdmin
# random value below the data range,
# making sure not to overwrite the
# max
while True:
minx, miny, minz = randvox()
if not np.isclose(img[minx, miny, minz], dmax):
img[minx, miny, minz] = newdmin
break
assert notified.get('data', False)
assert notified.get('dataRange', False)
......@@ -762,13 +767,14 @@ def _test_Image_changeData(imgtype):
notified.pop('data')
notified.pop('dataRange')
# random value above the data range
maxx, maxy, maxz = randvox()
while (maxx, maxy, maxz) == (minx, miny, minz):
# random value above the data range,
# making sure not to overwrite the
# min
while True:
maxx, maxy, maxz = randvox()
img[maxx, maxy, maxz] = newdmax
if not np.isclose(img[maxx, maxy, maxz], newdmin):
img[maxx, maxy, maxz] = newdmax
break
assert notified.get('data', False)
assert notified.get('dataRange', False)
......
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