Skip to content

Commit

Permalink
Test for drawing mask contour on a transparent background.
Browse files Browse the repository at this point in the history
  • Loading branch information
m000 committed Jun 6, 2018
1 parent 26dfd5e commit 4e1e94a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/test_wordcloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,17 @@ def test_mask_contour():
assert_true(all(sm_array[100, 300] == [0, 0, 255]))


def test_mask_contour_transparent():
# test if mask contour can be drawn on a transparent background
# https://github.com/amueller/word_cloud/pull/389
mask = np.ones((600, 600, 3), dtype='ubyte')
mask[:, -10:] = 0
w = WordCloud(mode='RGBA', background_color=None, contour_color='blue', contour_width=2, mask=mask,
max_words=50, width=800, height=800)
w.generate(THIS)
img = w.to_image()


def test_single_color_func():
# test single color function for different color formats
random = Random(42)
Expand Down

0 comments on commit 4e1e94a

Please sign in to comment.