mirror of
https://github.com/pyscript/pyscript.git
synced 2025-12-20 10:47:35 -05:00
Split pyscript into multiple files (#1338)
In the future this should help us leak fewer names into the pyscript namespace. Rather than assigning to the pyscript module from JavaScript, we mount a separate private JS module with the extra names needed by PyScript. I moved a bit more interpeter intialization into remote_interpreter. I added a deprecation warning for `pyscript.js`: the proper way to access `js` is `import js`. --------- Co-authored-by: Antonio Cuni <anto.cuni@gmail.com>
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import html
|
||||
from unittest.mock import Mock
|
||||
|
||||
import js
|
||||
import py_markdown
|
||||
import py_tutor
|
||||
import pyscript
|
||||
import pyscript_plugins_tester as ppt
|
||||
|
||||
TUTOR_SOURCE = """
|
||||
@@ -52,7 +52,7 @@ class TestPyTutor:
|
||||
related prism assets have been added to the page head
|
||||
"""
|
||||
# GIVEN a previous call to py_tutor.plugin.append_script_to_page
|
||||
head = pyscript.js.document.head
|
||||
head = js.document.head
|
||||
|
||||
# EXPECT the head to contain a link element pointing to the prism.min.css
|
||||
links = head.getElementsByTagName("link")
|
||||
@@ -76,7 +76,7 @@ class TestPyTutor:
|
||||
to the page body
|
||||
"""
|
||||
# GIVEN a previous call to py_tutor.plugin.append_script_to_page
|
||||
body = pyscript.js.document.body
|
||||
body = js.document.body
|
||||
|
||||
# EXPECT the body of the page to contain a script of type text/javascript
|
||||
# and that contains the py_tutor.PAGE_SCRIPT script
|
||||
@@ -108,7 +108,7 @@ class TestPyTutor:
|
||||
console.info.assert_any_call("Creating new code section element.")
|
||||
|
||||
# EXPECT the page body to contain a section with the input source code
|
||||
body = pyscript.js.document.body
|
||||
body = js.document.body
|
||||
sections = body.getElementsByTagName("section")
|
||||
section = sections[0]
|
||||
assert "code" in section.classList._classes
|
||||
|
||||
Reference in New Issue
Block a user