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

Testing lolviz.

parent 6f447b5f
["Bio", "IPython", "PIL", "__future__", "__main__", "_abc", "_ast", "_bootlocale", "_codecs", "_collections", "_collections_abc", "_compat_pickle", "_compression", "_contextvars", "_dummy_thread", "_frozen_importlib", "_frozen_importlib_external", "_functools", "_heapq", "_imp", "_io", "_ivp", "_locale", "_markupbase", "_operator", "_posixsubprocess", "_py_abc", "_pydecimal", "_pyio", "_signal", "_sitebuiltins", "_socket", "_sre", "_stat", "_string", "_strptime", "_sysconfigdata__emscripten_", "_testcapi", "_thread", "_threading_local", "_warnings", "_weakref", "_weakrefset", "abc", "aifc", "antigravity", "argparse", "asciitree", "ast", "astropy", "asynchat", "asyncio", "asyncore", "atexit", "atomicwrites", "attr", "autograd", "bar", "base64", "basthon", "bdb", "binhex", "bisect", "bleach", "bs4", "builtins", "bz2", "cProfile", "calendar", "cgi", "cgitb", "chunk", "cloudpickle", "cmd", "code", "codecs", "codeop", "collections", "colorsys", "compileall", "concurrent", "configparser", "contextlib", "contextvars", "copy", "copyreg", "crypt", "cssselect", "csv", "cycler", "cytoolz", "dataclasses", "datetime", "dateutil", "decimal", "decorator", "difflib", "dis", "distlib", "distutils", "doctest", "docutils", "dummy_threading", "easy_install", "email", "encodings", "enum", "errno", "filecmp", "fileinput", "fnmatch", "folium", "foo", "formatter", "fractions", "freesasa", "ftplib", "functools", "future", "genericpath", "getopt", "getpass", "gettext", "glob", "graphviz", "gzip", "hashlib", "heapq", "hmac", "html", "html5lib", "http", "imageio", "imaplib", "imghdr", "imp", "importlib", "inspect", "io", "ipaddress", "ipythonblocks", "itertools", "jedi", "jinja2", "joblib", "js", "json", "keyword", "kiwisolver", "linecache", "locale", "logging", "lxml", "lzma", "mailbox", "mailcap", "markupsafe", "marshal", "math", "matplotlib", "micropip", "mimetypes", "mne", "modulefinder", "more_itertools", "mpl_toolkits", "mpmath", "msgpack", "multiprocessing", "netrc", "networkx", "nltk", "nntplib", "nose", "ntpath", "nturl2path", "numbers", "numcodecs", "numpy", "opcode", "operator", "optparse", "os", "osmiter", "p5", "packaging", "pandas", "parso", "pathlib", "patsy", "pdb", "pickle", "pickletools", "pipes", "pkg_resources", "pkgutil", "platform", "plistlib", "pluggy", "poplib", "posix", "posixpath", "pprint", "profile", "proj4py", "pstats", "pty", "py", "py_compile", "pyclbr", "pydoc", "pydoc_data", "pygments", "pyodide", "pyodide_interrupts", "pyparsing", "pyroutelib3", "pysat", "pystone", "pytest", "pytz", "pywt", "qrcode", "queue", "quopri", "random", "re", "regex", "reprlib", "requests", "rlcompleter", "runpy", "sched", "scipy", "secrets", "select", "selectors", "setuptools", "shelve", "shlex", "shutil", "signal", "site", "sitecustomize", "six", "skimage", "sklearn", "smtpd", "smtplib", "sndhdr", "socket", "socketserver", "soupsieve", "sqlite3", "sre_compile", "sre_constants", "sre_parse", "ssl", "stat", "statistics", "statsmodels", "string", "stringprep", "struct", "subprocess", "sunau", "symbol", "sympy", "symtable", "sys", "sysconfig", "tabnanny", "tarfile", "telnetlib", "tempfile", "textwrap", "this", "threading", "time", "timeit", "token", "tokenize", "toolz", "trace", "traceback", "tracemalloc", "traits", "tty", "turtle", "tutor", "types", "typing", "uncertainties", "unittest", "urllib", "uu", "uuid", "warnings", "wave", "weakref", "webbrowser", "webencodings", "wsgiref", "xdrlib", "xlrd", "xml", "xmlrpc", "yt", "zarr", "zipapp", "zipfile", "zipimport"]
\ No newline at end of file
["Bio", "IPython", "PIL", "__future__", "__main__", "_abc", "_ast", "_bootlocale", "_codecs", "_collections", "_collections_abc", "_compat_pickle", "_compression", "_contextvars", "_dummy_thread", "_frozen_importlib", "_frozen_importlib_external", "_functools", "_heapq", "_imp", "_io", "_ivp", "_locale", "_markupbase", "_operator", "_posixsubprocess", "_py_abc", "_pydecimal", "_pyio", "_signal", "_sitebuiltins", "_socket", "_sre", "_stat", "_string", "_strptime", "_sysconfigdata__emscripten_", "_testcapi", "_thread", "_threading_local", "_warnings", "_weakref", "_weakrefset", "abc", "aifc", "antigravity", "argparse", "asciitree", "ast", "astropy", "asynchat", "asyncio", "asyncore", "atexit", "atomicwrites", "attr", "autograd", "bar", "base64", "basthon", "bdb", "binhex", "bisect", "bleach", "bs4", "builtins", "bz2", "cProfile", "calendar", "cgi", "cgitb", "chunk", "cloudpickle", "cmd", "code", "codecs", "codeop", "collections", "colorsys", "compileall", "concurrent", "configparser", "contextlib", "contextvars", "copy", "copyreg", "crypt", "cssselect", "csv", "cycler", "cytoolz", "dataclasses", "datetime", "dateutil", "decimal", "decorator", "difflib", "dis", "distlib", "distutils", "doctest", "docutils", "dummy_threading", "easy_install", "email", "encodings", "enum", "errno", "filecmp", "fileinput", "fnmatch", "folium", "foo", "formatter", "fractions", "freesasa", "ftplib", "functools", "future", "genericpath", "getopt", "getpass", "gettext", "glob", "graphviz", "gzip", "hashlib", "heapq", "hmac", "html", "html5lib", "http", "imageio", "imaplib", "imghdr", "imp", "importlib", "inspect", "io", "ipaddress", "ipythonblocks", "itertools", "jedi", "jinja2", "joblib", "js", "json", "keyword", "kiwisolver", "linecache", "locale", "logging", "lolviz", "lxml", "lzma", "mailbox", "mailcap", "markupsafe", "marshal", "math", "matplotlib", "micropip", "mimetypes", "mne", "modulefinder", "more_itertools", "mpl_toolkits", "mpmath", "msgpack", "multiprocessing", "netrc", "networkx", "nltk", "nntplib", "nose", "ntpath", "nturl2path", "numbers", "numcodecs", "numpy", "opcode", "operator", "optparse", "os", "osmiter", "p5", "packaging", "pandas", "parso", "pathlib", "patsy", "pdb", "pickle", "pickletools", "pipes", "pkg_resources", "pkgutil", "platform", "plistlib", "pluggy", "poplib", "posix", "posixpath", "pprint", "profile", "proj4py", "pstats", "pty", "py", "py_compile", "pyclbr", "pydoc", "pydoc_data", "pygments", "pyodide", "pyodide_interrupts", "pyparsing", "pyroutelib3", "pysat", "pystone", "pytest", "pytz", "pywt", "qrcode", "queue", "quopri", "random", "re", "regex", "reprlib", "requests", "rlcompleter", "runpy", "sched", "scipy", "secrets", "select", "selectors", "setuptools", "shelve", "shlex", "shutil", "signal", "site", "sitecustomize", "six", "skimage", "sklearn", "smtpd", "smtplib", "sndhdr", "socket", "socketserver", "soupsieve", "sqlite3", "sre_compile", "sre_constants", "sre_parse", "ssl", "stat", "statistics", "statsmodels", "string", "stringprep", "struct", "subprocess", "sunau", "symbol", "sympy", "symtable", "sys", "sysconfig", "tabnanny", "tarfile", "telnetlib", "tempfile", "textwrap", "this", "threading", "time", "timeit", "token", "tokenize", "toolz", "trace", "traceback", "tracemalloc", "traits", "tty", "turtle", "tutor", "types", "typing", "uncertainties", "unittest", "urllib", "uu", "uuid", "warnings", "wave", "weakref", "webbrowser", "webencodings", "wsgiref", "xdrlib", "xlrd", "xml", "xmlrpc", "yt", "zarr", "zipapp", "zipfile", "zipimport"]
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 2.40.1 (20161225.0304)
-->
<!-- Title: G Pages: 1 -->
<svg width="166pt" height="41pt"
viewBox="0.00 0.00 166.00 41.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 37)">
<title>G</title>
<polygon fill="#ffffff" stroke="transparent" points="-4,4 -4,-37 162,-37 162,4 -4,4"/>
<!-- node -->
<g id="node" class="node">
<title>node</title>
<polygon fill="none" stroke="#000000" stroke-width=".5" points="158,-33 0,-33 0,0 158,0 158,-33"/>
<polygon fill="#fefecd" stroke="transparent" points="1,-19.5 1,-31.5 20,-31.5 20,-19.5 1,-19.5"/>
<polyline fill="none" stroke="#000000" points="1,-19.5 20,-19.5 20,-31.5 "/>
<text text-anchor="start" x="7.9984" y="-22.4" font-family="Helvetica,sans-Serif" font-size="9.00" fill="#444443">0</text>
<polygon fill="#fefecd" stroke="transparent" points="20,-19.5 20,-31.5 55,-31.5 55,-19.5 20,-19.5"/>
<polyline fill="none" stroke="#000000" points="20,-19.5 55,-19.5 55,-31.5 "/>
<text text-anchor="start" x="34.9984" y="-22.4" font-family="Helvetica,sans-Serif" font-size="9.00" fill="#444443">1</text>
<polygon fill="#fefecd" stroke="transparent" points="55,-19.5 55,-31.5 86,-31.5 86,-19.5 55,-19.5"/>
<polyline fill="none" stroke="#000000" points="55,-19.5 86,-19.5 86,-31.5 "/>
<text text-anchor="start" x="67.9984" y="-22.4" font-family="Helvetica,sans-Serif" font-size="9.00" fill="#444443">2</text>
<polygon fill="#fefecd" stroke="transparent" points="86,-19.5 86,-31.5 157,-31.5 157,-19.5 86,-19.5"/>
<polyline fill="none" stroke="#000000" points="86,-19.5 157,-19.5 "/>
<text text-anchor="start" x="118.9985" y="-22.4" font-family="Helvetica,sans-Serif" font-size="9.00" fill="#444443">3</text>
<polygon fill="#fefecd" stroke="transparent" points="1,-.5 1,-19.5 20,-19.5 20,-.5 1,-.5"/>
<polyline fill="none" stroke="#000000" points="20,-.5 20,-19.5 "/>
<text text-anchor="start" x="3.7922" y="-6.6" font-family="Helvetica,sans-Serif" font-size="11.00" fill="#444443">&#39;hi&#39;</text>
<polygon fill="#fefecd" stroke="transparent" points="20,-.5 20,-19.5 55,-19.5 55,-.5 20,-.5"/>
<polyline fill="none" stroke="#000000" points="55,-.5 55,-19.5 "/>
<text text-anchor="start" x="22.8507" y="-6.6" font-family="Helvetica,sans-Serif" font-size="11.00" fill="#444443">&#39;mom&#39;</text>
<polygon fill="#fefecd" stroke="transparent" points="55,-.5 55,-19.5 86,-19.5 86,-.5 55,-.5"/>
<polyline fill="none" stroke="#000000" points="86,-.5 86,-19.5 "/>
<text text-anchor="start" x="57.6553" y="-6.6" font-family="Helvetica,sans-Serif" font-size="11.00" fill="#444443">{3, 4}</text>
<polygon fill="#fefecd" stroke="transparent" points="86,-.5 86,-19.5 157,-19.5 157,-.5 86,-.5"/>
<text text-anchor="start" x="87.9093" y="-6.7" font-family="Helvetica,sans-Serif" font-size="11.00" fill="#444443">{&#39;parrt&#39;: &#39;user&#39;}</text>
</g>
</g>
</svg>
digraph G {
nodesep=.05;
node [penwidth="0.5", width=.1,height=.1];
node [shape="box", space="0.0", margin="0.01", fontcolor="#444443", fontname="Helvetica", label=<<table BORDER="0" CELLBORDER="0" CELLSPACING="0">
<tr>
<td cellspacing="0" cellpadding="0" bgcolor="#fefecd" border="1" sides="br" valign="top"><font color="#444443" point-size="9">0</font></td>
<td cellspacing="0" cellpadding="0" bgcolor="#fefecd" border="1" sides="br" valign="top"><font color="#444443" point-size="9">1</font></td>
<td cellspacing="0" cellpadding="0" bgcolor="#fefecd" border="1" sides="br" valign="top"><font color="#444443" point-size="9">2</font></td>
<td cellspacing="0" cellpadding="0" bgcolor="#fefecd" border="1" sides="b" valign="top"><font color="#444443" point-size="9">3</font></td>
</tr>
<tr>
<td port="0" bgcolor="#fefecd" border="1" sides="r" align="center"><font point-size="11">'hi'</font></td>
<td port="1" bgcolor="#fefecd" border="1" sides="r" align="center"><font point-size="11">'mom'</font></td>
<td port="2" bgcolor="#fefecd" border="1" sides="r" align="center"><font point-size="11">{3, 4}</font></td>
<td port="3" bgcolor="#fefecd" border="0" align="center"><font point-size="11">{'parrt': 'user'}</font></td>
</tr></table>
>];
}
Please wait a moment while I gather a list of all available modules...
Bio binhex json requests
IPython bisect keyword rlcompleter
PIL bleach kiwisolver runpy
__future__ bs4 linecache sched
_abc builtins locale scipy
_ast bz2 logging secrets
_bisect cProfile lxml select
_blake2 calendar lzma selectors
_bootlocale cgi mailbox setuptools
_bz2 cgitb mailcap shelve
_codecs chunk markupsafe shlex
_codecs_cn cloudpickle marshal shutil
_codecs_hk cmath math signal
_codecs_iso2022 cmd matplotlib site
_codecs_jp code micropip sitecustomize
_codecs_kr codecs mimetypes six
_codecs_tw codeop mmap skimage
_collections collections mne sklearn
_collections_abc colorsys modulefinder smtpd
_compat_pickle compileall more_itertools smtplib
_compression concurrent mpl_toolkits sndhdr
_contextvars configparser mpmath socket
_crypt contextlib msgpack socketserver
_csv contextvars multiprocessing soupsieve
_datetime copy netrc sqlite3
_decimal copyreg networkx sre_compile
_dummy_thread crypt nltk sre_constants
_functools cssselect nntplib sre_parse
_heapq csv nose ssl
_imp cycler ntpath stat
_io cytoolz nturl2path statistics
_ivp dataclasses numbers statsmodels
_json datetime numcodecs string
_locale dateutil numpy stringprep
_lsprof decimal opcode struct
_markupbase decorator operator subprocess
_md5 difflib optparse sunau
_multibytecodec dis os symbol
_operator distlib osmiter sympy
_pickle distutils p5 symtable
_posixsubprocess doctest packaging sys
_py_abc docutils pandas sysconfig
_pydecimal dummy_threading parser tabnanny
_pyio easy_install parso tarfile
_queue email pathlib telnetlib
_random encodings patsy tempfile
_sha1 enum pdb textwrap
_sha256 errno pickle this
_sha3 faulthandler pickletools threading
_sha512 filecmp pipes time
_signal fileinput pkg_resources timeit
_sitebuiltins fnmatch pkgutil token
_socket folium platform tokenize
_sqlite3 formatter plistlib toolz
_sre fractions pluggy trace
_stat freesasa poplib traceback
_string ftplib posix tracemalloc
_strptime functools posixpath traits
_struct future pprint tty
_symtable gc profile turtle
_sysconfigdata__emscripten_ genericpath proj4py tutor
_testcapi getopt pstats types
_thread getpass pty typing
_threading_local gettext pwd uncertainties
_tracemalloc glob py unicodedata
_warnings graphviz py_compile unittest
_weakref gzip pyclbr urllib
_weakrefset hashlib pydoc uu
abc heapq pydoc_data uuid
aifc hmac pyexpat warnings
antigravity html pygments wave
argparse html5lib pyodide weakref
array http pyodide_interrupts webbrowser
asciitree imageio pyparsing webencodings
ast imaplib pyroutelib3 wsgiref
astropy imghdr pysat xdrlib
asynchat imp pystone xlrd
asyncio importlib pytest xml
asyncore inspect pytz xmlrpc
atexit io pywt xxsubtype
atomicwrites ipaddress qrcode yt
attr ipythonblocks queue zarr
autograd itertools quopri zipapp
base64 jedi random zipfile
basthon jinja2 re zipimport
bdb joblib regex zlib
binascii js reprlib
Bio binhex json reprlib
IPython bisect keyword requests
PIL bleach kiwisolver rlcompleter
__future__ bs4 linecache runpy
_abc builtins locale sched
_ast bz2 logging scipy
_bisect cProfile lolviz secrets
_blake2 calendar lxml select
_bootlocale cgi lzma selectors
_bz2 cgitb mailbox setuptools
_codecs chunk mailcap shelve
_codecs_cn cloudpickle markupsafe shlex
_codecs_hk cmath marshal shutil
_codecs_iso2022 cmd math signal
_codecs_jp code matplotlib site
_codecs_kr codecs micropip sitecustomize
_codecs_tw codeop mimetypes six
_collections collections mmap skimage
_collections_abc colorsys mne sklearn
_compat_pickle compileall modulefinder smtpd
_compression concurrent more_itertools smtplib
_contextvars configparser mpl_toolkits sndhdr
_crypt contextlib mpmath socket
_csv contextvars msgpack socketserver
_datetime copy multiprocessing soupsieve
_decimal copyreg netrc sqlite3
_dummy_thread crypt networkx sre_compile
_functools cssselect nltk sre_constants
_heapq csv nntplib sre_parse
_imp cycler nose ssl
_io cytoolz ntpath stat
_ivp dataclasses nturl2path statistics
_json datetime numbers statsmodels
_locale dateutil numcodecs string
_lsprof decimal numpy stringprep
_markupbase decorator opcode struct
_md5 difflib operator subprocess
_multibytecodec dis optparse sunau
_operator distlib os symbol
_pickle distutils osmiter sympy
_posixsubprocess doctest p5 symtable
_py_abc docutils packaging sys
_pydecimal dummy_threading pandas sysconfig
_pyio easy_install parser tabnanny
_queue email parso tarfile
_random encodings pathlib telnetlib
_sha1 enum patsy tempfile
_sha256 errno pdb textwrap
_sha3 faulthandler pickle this
_sha512 filecmp pickletools threading
_signal fileinput pipes time
_sitebuiltins fnmatch pkg_resources timeit
_socket folium pkgutil token
_sqlite3 formatter platform tokenize
_sre fractions plistlib toolz
_stat freesasa pluggy trace
_string ftplib poplib traceback
_strptime functools posix tracemalloc
_struct future posixpath traits
_symtable gc pprint tty
_sysconfigdata__emscripten_ genericpath profile turtle
_testcapi getopt proj4py tutor
_thread getpass pstats types
_threading_local gettext pty typing
_tracemalloc glob pwd uncertainties
_warnings graphviz py unicodedata
_weakref gzip py_compile unittest
_weakrefset hashlib pyclbr urllib
abc heapq pydoc uu
aifc hmac pydoc_data uuid
antigravity html pyexpat warnings
argparse html5lib pygments wave
array http pyodide weakref
asciitree imageio pyodide_interrupts webbrowser
ast imaplib pyparsing webencodings
astropy imghdr pyroutelib3 wsgiref
asynchat imp pysat xdrlib
asyncio importlib pystone xlrd
asyncore inspect pytest xml
atexit io pytz xmlrpc
atomicwrites ipaddress pywt xxsubtype
attr ipythonblocks qrcode yt
autograd itertools queue zarr
base64 jedi quopri zipapp
basthon jinja2 random zipfile
bdb joblib re zipimport
binascii js regex zlib
Enter any module name to get more help. Or, type "modules spam" to search
for modules whose name or summary contain the string "spam".
......
......@@ -2,6 +2,7 @@ from pathlib import Path
import base64
import time
from urllib.parse import quote
import re
_test_data = Path(__file__).parent / "data"
......@@ -188,7 +189,6 @@ for block in grid:
grid.to_text()
grid.show_image()
""")
print(result)
assert 'result' not in result['result']
assert result['stderr'] == ""
with open(_test_data / "ipythonblocks_to_text.txt") as f:
......@@ -198,3 +198,23 @@ grid.show_image()
with open(_test_data / "ipythonblocks_save_image.png", 'rb') as f:
target = f.read()
assert png == target
def test_lolviz(selenium):
result = selenium.run_basthon("""
import lolviz
ma_liste = ['hi', 'mom', {3, 4}, {"parrt":"user"}]
o = lolviz.listviz(ma_liste)
print(o.source)
o
""")
assert result['stderr'] == ""
target = re.sub('node[0-9]+', 'node', result['stdout'])
with open(_test_data / "lolviz_source.gv") as f:
assert target == f.read()
target = re.sub('node[0-9]+', 'node',
result['result']['result']['image/svg+xml'])
with open(_test_data / "lolviz.svg") as f:
assert target == f.read()
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