MCPcopy Create free account
hub / github.com/alibaba/open-code-review / write_mock_wrapper

Function write_mock_wrapper

acp/testdata/python-client-smoke.py:94–108  ·  view source on GitHub ↗
(root, script)

Source from the content-addressed store, hash-verified

92
93
94def write_mock_wrapper(root, script):
95 if os.name == "nt":
96 wrapper = root / "mock-ocr.cmd"
97 wrapper.write_text(
98 f'@echo off\r\n"{sys.executable}" -u "{script}" --mock-ocr %*\r\n',
99 encoding="utf-8",
100 )
101 return wrapper
102 import shlex
103 wrapper = root / "mock-ocr"
104 wrapper.write_text("#!/bin/sh\nexec " + shlex.quote(sys.executable) + " " +
105 shlex.quote(str(script)) +
106 ' --mock-ocr "$@"\n', encoding="utf-8")
107 wrapper.chmod(0o700)
108 return wrapper
109
110
111class SmokeClient:

Callers 1

smokeFunction · 0.85

Calls 1

strFunction · 0.85

Tested by

no test coverage detected