File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change 11import base64
2+ import io
23import os
34
5+ from PIL import Image
6+
47import folium
58from folium .plugins .heat_map import HeatMap
69from folium .utilities import temp_html_filepath
@@ -34,10 +37,10 @@ def test_heat_map_with_weights(driver):
3437 # get the canvas as a PNG base64 string
3538 canvas_base64 = driver .execute_script (
3639 "return arguments[0].toDataURL('image/png').substring(21);" , canvas )
37- screenshot = base64 .b64decode (canvas_base64 )
40+ screenshot_bytes = base64 .b64decode (canvas_base64 )
41+ screenshot = Image .open (io .BytesIO (screenshot_bytes ))
3842 path = os .path .dirname (__file__ )
3943 with open (os .path .join (path , 'test_heat_map_selenium_screenshot.png' ), 'rb' ) as f :
40- screenshot_expected = f .read ()
41- if hash (screenshot ) != hash (screenshot_expected ):
42- print (screenshot )
43- assert False , 'screenshot is not as expected'
44+ screenshot_expected = Image .open (f )
45+ if list (screenshot .getdata ()) != list (screenshot_expected .getdata ()):
46+ assert False , 'screenshot is not as expected'
You can’t perform that action at this time.
0 commit comments