Skip to content

Commit

Permalink
Fix overlay tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mraspaud committed Nov 11, 2019
1 parent e388f12 commit 36ae7c6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pycoast/cw_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -649,8 +649,8 @@ def _iterate_db(self, db_name, tag, resolution, level, zero_pad, db_root_path=No
else:
format_string += 'L%s.shp'

if type(level) not in (list,):
level = range(1,level+1)
if not isinstance(level, list):
level = range(1, level + 1)

for i in level:

Expand Down
4 changes: 2 additions & 2 deletions pycoast/tests/test_pycoast.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def test_europe(self):
area_extent = (-3363403.31, -2291879.85, 2630596.69, 2203620.1)
area_def = (proj4_string, area_extent)
cw = ContourWriterPIL(gshhs_root_dir)
cw.add_coastlines(img, area_def, resolution='l', level=[4])
cw.add_coastlines(img, area_def, resolution='l', level=4)
cw.add_rivers(img, area_def, level=5, outline='blue')
cw.add_borders(img, area_def, outline=(255, 0, 0))

Expand Down Expand Up @@ -753,7 +753,7 @@ def test_foreground(self):
self.assertTrue(fft_metric(euro_data, res),
'Writing of contours failed')

overlays = {'coasts': {'level': 4, 'resolution': 'l'},
overlays = {'coasts': {'level': [1, 2, 3, 4], 'resolution': 'l'},
'borders': {'outline': (255, 0, 0), 'resolution': 'c'},
'rivers': {'outline': 'blue', 'resolution': 'c', 'level': 5}}

Expand Down

0 comments on commit 36ae7c6

Please sign in to comment.