Skip to content

Commit

Permalink
Adjusting seed testing.
Browse files Browse the repository at this point in the history
  • Loading branch information
Schpidi committed Mar 14, 2016
1 parent dd34fad commit 5552c22
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions ngeo_browse_server/control/testbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -734,12 +734,16 @@ def test_seed(self):
for (tile,) in cur.fetchall():
# create in-memory file and open it with gdal
gdal.FileFromMemBuffer(vsimem_path, str(tile))
ds = gdal.Open(vsimem_path)
data = ds.ReadAsArray()

# check if it contains any data; (0,0,0,0) is empty
not_empty = numpy.any(data)
any_filled = not_empty or any_filled
try:
ds = gdal.Open(vsimem_path)
data = ds.ReadAsArray()

# check if it contains any data; (0,0,0,0) is empty
not_empty = numpy.any(data)
any_filled = not_empty or any_filled
except RuntimeError:
pass

# delete the file when done
gdal.Unlink(vsimem_path)
Expand Down

0 comments on commit 5552c22

Please sign in to comment.