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

chore: test cases #25

Merged
merged 5 commits into from
Nov 2, 2024
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: 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
Loading