Skip to content

Commit

Permalink
chore: test cases (#25)
Browse files Browse the repository at this point in the history
* chore: test cases

* ๐Ÿšฟ

* ๐Ÿšฟ

* ๐Ÿšฟ

* ๐Ÿšฟ
  • Loading branch information
siriscmv authored Nov 2, 2024
1 parent 8a63bdf commit 55a7432
Show file tree
Hide file tree
Showing 4 changed files with 696 additions and 9 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ jobs:
pip install pytest pytest-cov pytest-mock coverage
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
pip install -r ./backend/requirements.txt
sudo apt-get update
sudo apt-get install -y texlive-xetex texlive-fonts-extra
- name: Set environment variable for MongoDB
run: echo "MONGODB_HOST_STRING=mongodb://localhost:27017/mydatabase" >> $GITHUB_ENV
Expand Down
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 55a7432

Please sign in to comment.