@@ -398,9 +398,9 @@ def test_general_api_returns_400_unsupported_file(example_filename):
398398 assert response .status_code == 400
399399
400400
401- def test_general_api_returns_400_bad_pdf ():
401+ def test_general_api_returns_422_bad_pdf ():
402402 """
403- Verify that we get a 400 for invalid PDF files
403+ Verify that we get a 422 for invalid PDF files
404404 """
405405 tmp = tempfile .NamedTemporaryFile (suffix = ".pdf" )
406406 tmp .write (b"This is not a valid PDF" )
@@ -409,7 +409,7 @@ def test_general_api_returns_400_bad_pdf():
409409 MAIN_API_ROUTE , files = [("files" , (str (tmp .name ), open (tmp .name , "rb" ), "application/pdf" ))]
410410 )
411411 assert response .json () == {"detail" : "File does not appear to be a valid PDF" }
412- assert response .status_code == 400
412+ assert response .status_code == 422
413413 tmp .close ()
414414
415415 # Don't blow up if this isn't actually a pdf
@@ -420,7 +420,7 @@ def test_general_api_returns_400_bad_pdf():
420420 )
421421
422422 assert response .json () == {"detail" : "File does not appear to be a valid PDF" }
423- assert response .status_code == 400
423+ assert response .status_code == 422
424424
425425
426426def test_general_api_returns_503 (monkeypatch ):
@@ -757,7 +757,7 @@ def test_encrypted_pdf():
757757 assert response .status_code == 200
758758
759759
760- def test_general_api_returns_400_bad_docx ():
760+ def test_general_api_returns_422_bad_docx ():
761761 """
762762 Verify that we get a 400 for invalid docx files
763763 """
@@ -777,7 +777,7 @@ def test_general_api_returns_400_bad_docx():
777777 ],
778778 )
779779 assert response .json ().get ("detail" ) == "File is not a valid docx"
780- assert response .status_code == 400
780+ assert response .status_code == 422
781781
782782
783783def test_general_api_returns_400_bad_json (tmpdir ):
0 commit comments