MCPcopy Create free account
hub / github.com/BYVoid/OpenCC / test_cli_resource_zip_support

Function test_cli_resource_zip_support

python/tests/test_cli.py:141–156  ·  view source on GitHub ↗
(tmp_path, monkeypatch)

Source from the content-addressed store, hash-verified

139
140
141def test_cli_resource_zip_support(tmp_path, monkeypatch):
142 input_path = tmp_path / 'input.txt'
143 output_path = tmp_path / 'output.txt'
144 resource_zip = tmp_path / 'opencc-resources.zip'
145 input_path.write_text('打印机和鼠标', encoding='utf-8')
146 _write_resource_zip(resource_zip)
147
148 _run_cli(
149 monkeypatch,
150 '-c', 's2twp.json',
151 '-i', str(input_path),
152 '-o', str(output_path),
153 '--resource-zip', str(resource_zip),
154 )
155
156 assert output_path.read_text(encoding='utf-8') == '印表機和滑鼠'
157
158
159def test_cli_subprocess_integration(tmp_path):

Callers

nothing calls this directly

Calls 3

_run_cliFunction · 0.85
strClass · 0.85
_write_resource_zipFunction · 0.70

Tested by

no test coverage detected