From 944d59e5ad75a0ef337fbb8fdbdfe2e109839630 Mon Sep 17 00:00:00 2001 From: "James R. Barlow" Date: Wed, 4 Sep 2019 01:17:52 -0700 Subject: [PATCH] Fix --print-parameters issue when chi_sim is not installed --- tests/test_validation.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/test_validation.py b/tests/test_validation.py index 138c8820..3914986d 100644 --- a/tests/test_validation.py +++ b/tests/test_validation.py @@ -37,15 +37,21 @@ def test_hocr_notlatin_warning(caplog): def test_old_ghostscript(caplog): - with patch('ocrmypdf.exec.ghostscript.version', return_value='9.19'): + with patch('ocrmypdf.exec.ghostscript.version', return_value='9.19'), patch( + 'ocrmypdf.exec.tesseract.has_textonly_pdf', return_value=True + ): vd.check_options_output(make_opts(language='chi_sim', output_type='pdfa')) assert 'Ghostscript does not work correctly' in caplog.text - with patch('ocrmypdf.exec.ghostscript.version', return_value='9.18'): + with patch('ocrmypdf.exec.ghostscript.version', return_value='9.18'), patch( + 'ocrmypdf.exec.tesseract.has_textonly_pdf', return_value=True + ): with pytest.raises(MissingDependencyError): vd.check_options_output(make_opts(output_type='pdfa-3')) - with patch('ocrmypdf.exec.ghostscript.version', return_value='9.24'): + with patch('ocrmypdf.exec.ghostscript.version', return_value='9.24'), patch( + 'ocrmypdf.exec.tesseract.has_textonly_pdf', return_value=True + ): with pytest.raises(MissingDependencyError): vd.check_dependency_versions(make_opts())