Skip to content

Commit

Permalink
chore: test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
siriscmv committed Nov 2, 2024
1 parent 8a63bdf commit 65cb84b
Show file tree
Hide file tree
Showing 3 changed files with 690 additions and 9 deletions.
11 changes: 11 additions & 0 deletions backend/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,13 @@ def updateProfilePreferences():
for key in data.keys():
user[key] = data[key]

if (
"picture" in data
and data["picture"]
and not data["picture"].startswith("data:image/png;base64,")
):
return jsonify({"error": "Invalid image format"}), 400

user.save()
return jsonify(user.to_json()), 200

Expand Down Expand Up @@ -758,6 +765,10 @@ def generate_resume():

# Copy the template files to the temp directory
template_dir = f"../resume_templates/{template_name}"

if not template_name or not os.path.exists(template_dir):
return jsonify({"error": "Template not found"}), 404

for item in os.listdir(template_dir):
s = os.path.join(template_dir, item)
d = os.path.join(temp_dir, item)
Expand Down
Loading

0 comments on commit 65cb84b

Please sign in to comment.