Commit ef839a3a authored by Romain Casati's avatar Romain Casati
Browse files

Testing matplotlib.

parent d227203c
<div style="margin: 0 auto; text-align: center;width: 640.0px" id="matplotlib_"><div id="matplotlib_top" style="font-weight: bold; text-align: center">Figure 1</div><div style="position: relative"><canvas id="matplotlib_nvas" width="640" height="480" style="left: 0; top: 0; z-index: 0; outline: 0;width: 640.0px; height: 480.0px"></canvas><canvas id="matplotlib_rubberband" width="640" height="480" style="position: absolute; left: 0; top: 0; z-index: 0; outline: 0; width: 640.0px; height: 480.0px" tabindex="0"></canvas></div><div><span><button class="fa fa-home matplotlib-toolbar-button"></button><button class="fa fa-arrow-left matplotlib-toolbar-button"></button><button class="fa fa-arrow-right matplotlib-toolbar-button"></button><span style="min-width: 16px;">&nbsp;</span><button class="fa fa-arrows matplotlib-toolbar-button"></button><button class="fa fa-search-plus matplotlib-toolbar-button"></button><span style="min-width: 16px;">&nbsp;</span><button class="fa matplotlib-toolbar-button" id="text">pdf</button><button class="fa matplotlib-toolbar-button" id="text">png</button><button class="fa matplotlib-toolbar-button" id="text">svg</button></span><div id="matplotlib_message" style="min-height: 1.5em"></div></div></div>
\ No newline at end of file
......@@ -22,8 +22,22 @@ def test_PIL(selenium):
def test_matplotlib(selenium):
#assert False
import matplotlib.pyplot as plt
plt.plot([0, 1], [0, 1])
""", return_data=False)
# can't access content like this
# elem = result['content']
# because of selenium's StaleElementReferenceException
# bypassing it via JS
html = selenium.run_js("return window._basthon_eval_data.display.content.outerHTML")
html = re.sub('matplotlib_[0-9a-f]+', 'matplotlib_', html)
with open(_test_data / 'matplotlib.html') as f:
target =
assert html == target
def test_folium(selenium):
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment