Skip to content

Commit

Permalink
tests adapted to addded categorical cmaps
Browse files Browse the repository at this point in the history
  • Loading branch information
callumrollo committed Jan 30, 2021
1 parent 59450e7 commit d3ed6d0
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tests/test_cmcrameri.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,15 @@ def test_cmap_import():
no_cmaps = 0
cmap_names = []
for name, cmap in vars(cm).items():
increment = 1
# See if it is a colormap.
if isinstance(cmap, matplotlib.colors.LinearSegmentedColormap):
no_cmaps += 1
if name[-1] != 'S':
increment = 0.5
no_cmaps += increment
cmap_names.append(name)
# Should be twice as many colour maps as files (original and reversed versions)
assert no_cmaps == 2*len(cm.paths)
# Should be as many colour maps as files plus reversed for non categorical ones
assert int(no_cmaps) == len(cm.paths)

test_find_files()
test_cmap_import()

0 comments on commit d3ed6d0

Please sign in to comment.