Commit 7ccd632f authored by Romain Casati's avatar Romain Casati
Browse files

Testing rcviz.

parent e4c4286a
["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", "binarytree", "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
["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", "binarytree", "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", "rcviz", "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
Please wait a moment while I gather a list of all available modules...
Bio binhex keyword rlcompleter
IPython bisect kiwisolver runpy
PIL bleach linecache sched
__future__ bs4 locale scipy
_abc builtins logging secrets
_ast bz2 lolviz select
_bisect cProfile lxml selectors
_blake2 calendar lzma setuptools
_bootlocale cgi mailbox shelve
_bz2 cgitb mailcap shlex
_codecs chunk markupsafe shutil
_codecs_cn cloudpickle marshal signal
_codecs_hk cmath math site
_codecs_iso2022 cmd matplotlib sitecustomize
_codecs_jp code micropip six
_codecs_kr codecs mimetypes skimage
_codecs_tw codeop mmap sklearn
_collections collections mne smtpd
_collections_abc colorsys modulefinder smtplib
_compat_pickle compileall more_itertools sndhdr
_compression concurrent mpl_toolkits socket
_contextvars configparser mpmath socketserver
_crypt contextlib msgpack soupsieve
_csv contextvars multiprocessing sqlite3
_datetime copy netrc sre_compile
_decimal copyreg networkx sre_constants
_dummy_thread crypt nltk sre_parse
_functools cssselect nntplib ssl
_heapq csv nose stat
_imp cycler ntpath statistics
_io cytoolz nturl2path statsmodels
_ivp dataclasses numbers string
_json datetime numcodecs stringprep
_locale dateutil numpy struct
_lsprof decimal opcode subprocess
_markupbase decorator operator sunau
_md5 difflib optparse symbol
_multibytecodec dis os sympy
_operator distlib osmiter symtable
_pickle distutils p5 sys
_posixsubprocess doctest packaging sysconfig
_py_abc docutils pandas tabnanny
_pydecimal dummy_threading parser tarfile
_pyio easy_install parso telnetlib
_queue email pathlib tempfile
_random encodings patsy textwrap
_sha1 enum pdb this
_sha256 errno pickle threading
_sha3 faulthandler pickletools time
_sha512 filecmp pipes timeit
_signal fileinput pkg_resources token
_sitebuiltins fnmatch pkgutil tokenize
_socket folium platform toolz
_sqlite3 formatter plistlib trace
_sre fractions pluggy traceback
_stat freesasa poplib tracemalloc
_string ftplib posix traits
_strptime functools posixpath tty
_struct future pprint turtle
_symtable gc profile tutor
_sysconfigdata__emscripten_ genericpath proj4py types
_testcapi getopt pstats typing
_thread getpass pty uncertainties
_threading_local gettext pwd unicodedata
_tracemalloc glob py unittest
_warnings graphviz py_compile urllib
_weakref gzip pyclbr uu
_weakrefset hashlib pydoc uuid
abc heapq pydoc_data warnings
aifc hmac pyexpat wave
antigravity html pygments weakref
argparse html5lib pyodide webbrowser
array http pyodide_interrupts webencodings
asciitree imageio pyparsing wsgiref
ast imaplib pyroutelib3 xdrlib
astropy imghdr pysat xlrd
asynchat imp pystone xml
asyncio importlib pytest xmlrpc
asyncore inspect pytz xxsubtype
atexit io pywt yt
atomicwrites ipaddress qrcode zarr
attr ipythonblocks queue zipapp
autograd itertools quopri zipfile
base64 jedi random zipimport
basthon jinja2 re zlib
bdb joblib regex
binarytree js reprlib
binascii json requests
Bio binhex keyword requests
IPython bisect kiwisolver rlcompleter
PIL bleach linecache runpy
__future__ bs4 locale sched
_abc builtins logging scipy
_ast bz2 lolviz 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 rcviz zipimport
bdb joblib re zlib
binarytree js regex
binascii json reprlib
Enter any module name to get more help. Or, type "modules spam" to search
for modules whose name or summary contain the string "spam".
......
digraph {
graph [fontname=helvetica label="nodes=15"]
node [fontname=helvetica]
edge [fontname=helvetica]
[label="{ fibo(5) | ret: 5 }" fontsize=13 labelfontsize=13 shape=Mrecord]
[label="{ fibo(4) | ret: 3 }" fontsize=13 labelfontsize=13 shape=Mrecord]
[label="{ fibo(3) | ret: 2 }" fontsize=13 labelfontsize=13 shape=Mrecord]
[label="{ fibo(2) | ret: 1 }" fontsize=13 labelfontsize=13 shape=Mrecord]
[label="{ fibo(1) | ret: 1 }" fontsize=13 labelfontsize=13 shape=Mrecord]
[label="{ fibo(0) | ret: 0 }" fontsize=13 labelfontsize=13 shape=Mrecord]
[label="{ fibo(1) | ret: 1 }" fontsize=13 labelfontsize=13 shape=Mrecord]
[label="{ fibo(2) | ret: 1 }" fontsize=13 labelfontsize=13 shape=Mrecord]
[label="{ fibo(1) | ret: 1 }" fontsize=13 labelfontsize=13 shape=Mrecord]
[label="{ fibo(0) | ret: 0 }" fontsize=13 labelfontsize=13 shape=Mrecord]
[label="{ fibo(3) | ret: 2 }" fontsize=13 labelfontsize=13 shape=Mrecord]
[label="{ fibo(2) | ret: 1 }" fontsize=13 labelfontsize=13 shape=Mrecord]
[label="{ fibo(1) | ret: 1 }" fontsize=13 labelfontsize=13 shape=Mrecord]
[label="{ fibo(0) | ret: 0 }" fontsize=13 labelfontsize=13 shape=Mrecord]
[label="{ fibo(1) | ret: 1 }" fontsize=13 labelfontsize=13 shape=Mrecord]
-> [label="1 (⇑9)" color="# d d d" fontcolor="#999999" fontsize=8 labelfontsize=8]
-> [label="10 (⇑14)" color="#828282" fontcolor="#999999" fontsize=8 labelfontsize=8]
-> [label="2 (⇑5)" color="#1a1a1a" fontcolor="#999999" fontsize=8 labelfontsize=8]
-> [label="7 (⇑8)" color="#5b5b5b" fontcolor="#999999" fontsize=8 labelfontsize=8]
-> [label="3 (⇑3)" color="#272727" fontcolor="#999999" fontsize=8 labelfontsize=8]
-> [label="6 (⇑4)" color="#4e4e4e" fontcolor="#999999" fontsize=8 labelfontsize=8]
-> [label="4 (⇑1)" color="#343434" fontcolor="#999999" fontsize=8 labelfontsize=8]
-> [label="5 (⇑2)" color="#414141" fontcolor="#999999" fontsize=8 labelfontsize=8]
-> [label="8 (⇑6)" color="#686868" fontcolor="#999999" fontsize=8 labelfontsize=8]
-> [label="9 (⇑7)" color="#757575" fontcolor="#999999" fontsize=8 labelfontsize=8]
-> [label="11 (⇑12)" color="#8f8f8f" fontcolor="#999999" fontsize=8 labelfontsize=8]
-> [label="14 (⇑13)" color="#b6b6b6" fontcolor="#999999" fontsize=8 labelfontsize=8]
-> [label="12 (⇑10)" color="#9c9c9c" fontcolor="#999999" fontsize=8 labelfontsize=8]
-> [label="13 (⇑11)" color="#a9a9a9" fontcolor="#999999" fontsize=8 labelfontsize=8]
}
\ No newline at end of file
......@@ -223,3 +223,27 @@ o
def test_binarytree(selenium):
# already tested in test_patched_modules
assert True
def test_rcviz(selenium):
from ast import literal_eval
result = selenium.run_basthon("""
from rcviz import viz
@viz
def fibo(n):
if n < 2:
return n
return fibo(n - 1) + fibo(n - 2)
print(fibo(4))
fibo.callgraph()
print(fibo(5))
fibo.callgraph().source
""")
assert result['stderr'] == ""
assert result['stdout'] == "3\n5\n"
target = literal_eval(result['result']['result']['text/plain'])
target = re.sub(r'[0-9]+ -> [0-9]+ \[label=', ' -> [label=', target)
target = re.sub(r'[0-9]+ \[label=', ' [label=', target)
with open(_test_data / "rcviz.gv") 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