@@ -43,23 +43,14 @@ def test_wasi_env_memory():
43
43
instance = Instance (Module (store , TEST_BYTES ), import_object )
44
44
45
45
def test_wasi ():
46
- python = sys .executable
47
- result = subprocess .check_output (
48
- [
49
- python ,
50
- '-c' ,
51
- 'from wasmer import wasi, Store, Module, Instance; \
52
- store = Store(); \
53
- module = Module(store, open("tests/wasi.wasm", "rb").read()); \
54
- wasi_version = wasi.get_version(module, strict=True); \
55
- wasi_env = wasi.StateBuilder("test-program").argument("--foo").environments({"ABC": "DEF", "X": "YZ"}).map_directory("the_host_current_dir", ".").finalize(); \
56
- import_object = wasi_env.generate_import_object(store, wasi_version); \
57
- instance = Instance(module, import_object); \
58
- instance.exports._start()'
59
- ]
60
- )
46
+ store = Store ()
47
+ wasi_env = \
48
+ wasi .StateBuilder ("test-program" ). \
49
+ argument ("--foo" ). \
50
+ environments ({"ABC" : "DEF" , "X" : "YZ" }). \
51
+ map_directory ("the_host_current_dir" , "." ). \
52
+ finalize ()
53
+ import_object = wasi_env .generate_import_object (store , wasi .Version .LATEST )
61
54
62
- assert result == b'Found program name: `test-program`\n \
63
- Found 1 arguments: --foo\n \
64
- Found 2 environment variables: ABC=DEF, X=YZ\n \
65
- Found 1 preopened directories: DirEntry("/the_host_current_dir")\n '
55
+ instance = Instance (Module (store , TEST_BYTES ), import_object )
56
+ instance .exports ._start ()
0 commit comments