Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(doctor): Clean up Dead Stuff #177

Merged
merged 1 commit into from
Dec 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading