@@ -237,7 +237,7 @@ def test_unit_is_pdf_valid_pdf():
237
237
assert result is True
238
238
239
239
240
- def test_unit_is_pdf_valid_pdf_without_file_extension (caplog ):
240
+ def test_unit_is_pdf_valid_pdf_without_file_extension ():
241
241
"""Test is pdf method returns True for file with valid pdf content without basing on file extension."""
242
242
filename = "_sample_docs/layout-parser-paper-fast.pdf"
243
243
@@ -252,36 +252,31 @@ def test_unit_is_pdf_valid_pdf_without_file_extension(caplog):
252
252
assert result is True
253
253
254
254
255
- def test_unit_is_pdf_invalid_extension (caplog ):
255
+ def test_unit_is_pdf_invalid_extension ():
256
256
"""Test is pdf method returns False for file with invalid extension."""
257
257
file = shared .Files (content = b"txt_content" , file_name = "test_file.txt" )
258
258
259
- with caplog .at_level (logging .WARNING ):
260
- result = pdf_utils .is_pdf (file )
259
+ result = pdf_utils .is_pdf (file )
261
260
262
261
assert result is False
263
- assert "The file does not appear to be a valid PDF." in caplog .text
264
262
265
263
266
- def test_unit_is_pdf_invalid_pdf (caplog ):
264
+ def test_unit_is_pdf_invalid_pdf ():
267
265
"""Test is pdf method returns False for file with invalid pdf content."""
268
266
file = shared .Files (content = b"invalid_pdf_content" , file_name = "test_file.pdf" )
269
267
270
- with caplog .at_level (logging .WARNING ):
271
- result = pdf_utils .is_pdf (file )
268
+ result = pdf_utils .is_pdf (file )
272
269
273
270
assert result is False
274
- assert "The file does not appear to be a valid PDF." in caplog .text
275
271
276
- def test_unit_is_pdf_invalid_pdf_without_file_extension (caplog ):
272
+
273
+ def test_unit_is_pdf_invalid_pdf_without_file_extension ():
277
274
"""Test is pdf method returns False for file with invalid pdf content without basing on file extension."""
278
275
file = shared .Files (content = b"invalid_pdf_content" , file_name = "uuid1234" )
279
276
280
- with caplog .at_level (logging .WARNING ):
281
- result = pdf_utils .is_pdf (file )
277
+ result = pdf_utils .is_pdf (file )
282
278
283
279
assert result is False
284
- assert "The file does not appear to be a valid PDF." in caplog .text
285
280
286
281
287
282
def test_unit_get_starting_page_number_missing_key ():
0 commit comments