(tmp_path, monkeypatch)
| 139 | |
| 140 | |
| 141 | def 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 | |
| 159 | def test_cli_subprocess_integration(tmp_path): |
nothing calls this directly
no test coverage detected