Skip to content

Commit

Permalink
Merge pull request #177 from johnludwigm/main
Browse files Browse the repository at this point in the history
  • Loading branch information
mlissner authored Dec 21, 2023
2 parents d9efe0b + 44f36e9 commit c7a609f
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 15 deletions.
2 changes: 1 addition & 1 deletion doctor/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def get_xray(path):
PdfReadError,
):
return {"error": True, "msg": "Exception"}
except Exception as e:
except Exception:
return {"error": True, "msg": "Exception"}
# not reached

Expand Down
11 changes: 0 additions & 11 deletions doctor/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,16 +159,6 @@ def test_wpd_format(self):
class ThumbnailTests(unittest.TestCase):
"""Can we generate thumbnail images from PDF files"""

# def test_locally(self):
# c = Client()
# with open(f"{asset_path}/image-pdf.pdf", "rb") as fp:
# response = c.post(
# "/convert/pdf/thumbnail/",
# {"max_dimension": 350, "file": fp},
# )
#
# self.assertEqual(200, response.status_code)

def test_convert_pdf_to_thumbnail_png(self):
"""Can we generate four thumbanils a pdf?"""
files = make_file(filename="image-pdf.pdf")
Expand Down Expand Up @@ -372,7 +362,6 @@ def test_xray_no_pdf(self):
direction = re.search("yes", pattern)
for file in glob.glob(os.path.join(filepath, pattern)):
filename = os.path.relpath(file, filepath)
filename_sans_ext = filename.split(".")[0]

with open(file, "rb") as f:
files = {"file": (filename, f.read())}
Expand Down
3 changes: 0 additions & 3 deletions doctor/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,6 @@ def convert_audio(request) -> Union[FileResponse, HttpResponse]:
:return: Converted audio
"""
# try:
form = AudioForm(request.GET, request.FILES)
if not form.is_valid():
return HttpResponse("Failed validation", status=BAD_REQUEST)
Expand All @@ -354,8 +353,6 @@ def convert_audio(request) -> Union[FileResponse, HttpResponse]:
response = FileResponse(open(filepath, "rb"))
cleanup_form(form)
return response
# except Exception as e:
# return HttpResponse(str(e))


def embed_text(request) -> Union[FileResponse, HttpResponse]:
Expand Down

0 comments on commit c7a609f

Please sign in to comment.