MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_inject_module_basic

Function test_inject_module_basic

wasm/tests/test_inject_module.py:1–21  ·  view source on GitHub ↗
(wdriver)

Source from the content-addressed store, hash-verified

1def test_inject_module_basic(wdriver):
2 wdriver.execute_script(
3 """
4const vm = rp.vmStore.init("vm")
5vm.injectModule(
6"mod",
7`
8__all__ = ['get_thing']
9def get_thing(): return __thing()
10`,
11{ __thing: () => 1 },
12true
13)
14vm.execSingle(
15`
16import mod
17assert mod.get_thing() == 1
18`
19);
20 """
21 )

Callers

nothing calls this directly

Calls 1

execute_scriptMethod · 0.80

Tested by

no test coverage detected