feat(translate): refonte du design de la page de traduction et du sélecteur de moteurs (Etapes 1-3)
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 2m12s
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 2m12s
This commit is contained in:
@@ -613,21 +613,14 @@ class TestWriteErrorHandling:
|
||||
input_file = tmp_path / "input.docx"
|
||||
doc.save(input_file)
|
||||
|
||||
readonly_dir = tmp_path / "readonly"
|
||||
readonly_dir.mkdir()
|
||||
# Create a file instead of a directory to force a write error on both Windows and Unix
|
||||
readonly_dir = tmp_path / "readonly_file"
|
||||
readonly_dir.write_text("blocked")
|
||||
output_file = readonly_dir / "output.docx"
|
||||
|
||||
import os
|
||||
import stat
|
||||
|
||||
os.chmod(readonly_dir, stat.S_IRUSR | stat.S_IXUSR)
|
||||
|
||||
try:
|
||||
with pytest.raises(WordProcessorError) as exc_info:
|
||||
translator.translate_file(input_file, output_file, "fr")
|
||||
assert exc_info.value.code == WordProcessorError.DOCX_WRITE_ERROR
|
||||
finally:
|
||||
os.chmod(readonly_dir, stat.S_IRWXU)
|
||||
with pytest.raises(WordProcessorError) as exc_info:
|
||||
translator.translate_file(input_file, output_file, "fr")
|
||||
assert exc_info.value.code == WordProcessorError.DOCX_WRITE_ERROR
|
||||
|
||||
|
||||
class TestMultipleSections:
|
||||
|
||||
Reference in New Issue
Block a user