tests: AcroForm test case did not work correctly; fixed

This commit is contained in:
James R. Barlow
2019-12-30 17:50:32 -08:00
parent 63de7e1677
commit 0c0d53b10f
4 changed files with 12 additions and 3 deletions
+1 -1
View File
@@ -183,7 +183,7 @@ def validate_pdfinfo_options(context):
)
raise InputFileError()
else:
log.warn(
log.warning(
"This PDF has a fillable form. "
"Chances are it is a pure digital "
"document that does not need OCR."
Binary file not shown.
+10 -1
View File
@@ -15,6 +15,8 @@
# You should have received a copy of the GNU General Public License
# along with OCRmyPDF. If not, see <http://www.gnu.org/licenses/>.
import logging
import pytest
import ocrmypdf
@@ -30,4 +32,11 @@ def acroform(resources):
def test_acroform_and_redo(acroform, caplog, no_outpdf):
with pytest.raises(ocrmypdf.exceptions.InputFileError):
check_ocrmypdf(acroform, no_outpdf, '--redo-ocr')
assert '--redo-ocr is not currently possible' in caplog.text
assert '--redo-ocr is not currently possible' in caplog.text
def test_acroform_message(acroform, caplog, spoof_tesseract_noop, outpdf):
caplog.set_level(logging.INFO)
check_ocrmypdf(acroform, outpdf, env=spoof_tesseract_noop)
assert 'fillable form' in caplog.text
assert '--force-ocr' in caplog.text
+1 -1
View File
@@ -276,7 +276,7 @@ def test_input_file_not_readable(caplog, resources, outdir, no_outpdf):
input_file.chmod(0o000)
result = run_ocrmypdf_api(input_file, no_outpdf)
assert result == ExitCode.input_file
assert input_file in caplog.text
assert str(input_file) in caplog.text
def test_input_file_not_a_pdf(caplog, no_outpdf):