Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a490278 commit 9d46338Copy full SHA for 9d46338
1 file changed
lib/matplotlib/tests/test_colors.py
@@ -1,7 +1,9 @@
1
import copy
2
import itertools
3
4
+from io import BytesIO
5
import numpy as np
6
+from PIL import Image
7
import pytest
8
9
from numpy.testing import assert_array_equal, assert_array_almost_equal
@@ -1141,6 +1143,13 @@ def test_repr_png():
1141
1143
cmap = plt.get_cmap('viridis')
1142
1144
png = cmap._repr_png_()
1145
assert len(png) > 0
1146
+ img = Image.open(BytesIO(png))
1147
+ assert img.width > 0
1148
+ assert img.height > 0
1149
+ assert 'Title' in img.text
1150
+ assert 'Description' in img.text
1151
+ assert 'Author' in img.text
1152
+ assert 'Software' in img.text
1153
1154
1155
def test_repr_html():
0 commit comments