Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Basthon
Basthon Kernel
Commits
1988f90f
Commit
1988f90f
authored
Jan 31, 2021
by
Romain Casati
Browse files
Testing importable packages.
parent
c40d1975
Changes
2
Hide whitespace changes
Inline
Side-by-side
tests/data/importables.json
0 → 100644
View file @
1988f90f
[
"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"
,
"_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"
,
"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"
,
"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"
,
"pysat"
,
"pystone"
,
"pytest"
,
"pytz"
,
"pywt"
,
"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"
,
"types"
,
"typing"
,
"uncertainties"
,
"unittest"
,
"urllib"
,
"uu"
,
"uuid"
,
"warnings"
,
"wave"
,
"weakref"
,
"webbrowser"
,
"webencodings"
,
"wsgiref"
,
"xdrlib"
,
"xlrd"
,
"xml"
,
"xmlrpc"
,
"yt"
,
"zarr"
,
"zipapp"
,
"zipfile"
,
"zipimport"
]
tests/test_base.py
View file @
1988f90f
from
pathlib
import
Path
import
json
def
test_setup
(
selenium
):
assert
selenium
.
run_js
(
"return pyodide.version()"
)
==
"0.16.1"
...
...
@@ -67,3 +70,11 @@ def test_put_module(selenium):
import foo
foo.bar"""
)[
'result'
][
'result'
][
'text/plain'
]
assert
result
==
"24"
def
test_importables
(
selenium
):
result
=
selenium
.
run_basthon
(
"from basthon import kernel ; kernel.importables()"
)[
'result'
]
importables
=
eval
(
result
[
'result'
][
'text/plain'
])
with
open
(
Path
(
__file__
).
parent
/
"data"
/
"importables.json"
)
as
f
:
target
=
json
.
load
(
f
)
assert
importables
==
target
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment