Skip to content

Commit

Permalink
test: further fixes to test_report_file_size
Browse files Browse the repository at this point in the history
  • Loading branch information
James R. Barlow committed Nov 12, 2019
1 parent 703b6db commit 5f5421f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/test_validation.py
Expand Up @@ -120,12 +120,16 @@ def test_report_file_size(tmp_path, caplog):

os.truncate(in_, 25001)
os.truncate(out, 50000)
with patch('ocrmypdf._validation.jbig2enc.available', return_value=False):
with patch('ocrmypdf._validation.jbig2enc.available', return_value=True), patch(
'ocrmypdf._validation.pngquant.available', return_value=True
):
vd.report_output_file_size(opts, in_, out)
assert 'No reason' in caplog.text
caplog.clear()

with patch('ocrmypdf._validation.jbig2enc.available', return_value=False):
with patch('ocrmypdf._validation.jbig2enc.available', return_value=False), patch(
'ocrmypdf._validation.pngquant.available', return_value=True
):
vd.report_output_file_size(opts, in_, out)
assert 'optional dependency' in caplog.text
caplog.clear()
Expand Down

0 comments on commit 5f5421f

Please sign in to comment.