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

Testing Pandas.

parent a46c17d8
<div>
<style scoped>
.dataframe tbody tr th:only-of-type {
vertical-align: middle;
}
.dataframe tbody tr th {
vertical-align: top;
}
.dataframe thead th {
text-align: right;
}
</style>
<table border="1" class="dataframe">
<thead>
<tr style="text-align: right;">
<th></th>
<th>language</th>
<th>verbosity</th>
</tr>
</thead>
<tbody>
<tr>
<th>0</th>
<td>Python</td>
<td>0.1</td>
</tr>
<tr>
<th>1</th>
<td>C</td>
<td>0.5</td>
</tr>
<tr>
<th>2</th>
<td>Java</td>
<td>0.9</td>
</tr>
</tbody>
</table>
</div>
\ No newline at end of file
from pathlib import Path
import re
_test_data = Path(__file__).parent / "data"
def test_all(selenium):
# ensure all hacked modules are tested
......@@ -30,8 +32,20 @@ def test_folium(selenium):
def test_pandas(selenium):
#assert False
pass
result = selenium.run_basthon("""
import pandas as pd
df = pd.DataFrame({
'language': ["Python", "C", "Java"],
'verbosity': [0.1, 0.5, 0.9]
})
df.display()
""")
assert result['stderr'] == ""
assert result['display']['display_type'] == 'html'
with open(_test_data / "pandas.html") as f:
assert result['display']['content'] == f.read()
def test_sympy(selenium):
......@@ -57,6 +71,6 @@ def test_turtle(selenium):
# bypassing it via JS
svg = selenium.run_js("return window._basthon_eval_data.display.content.outerHTML")
svg = re.sub('\"af_[0-9a-f]+_', '\"af_', svg)
with open(Path(__file__).parent / 'data' / 'turtle.svg') as f:
with open(_test_data / 'turtle.svg') as f:
target = f.read()
assert svg == target
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