diff --git a/app.py b/app.py index feabf0a..caf2229 100644 --- a/app.py +++ b/app.py @@ -2,7 +2,7 @@ Flask Application ''' from flask import Flask, jsonify, request -from models import Experience, Education, Skill, User +#from models import Experience, Education, Skill, User from utils import check_phone_number, correct_spelling, load_data app = Flask(__name__) @@ -33,7 +33,6 @@ def user(): name = body['name'] phone_number = body['phone_number'] email = body['email_address'] - if not check_phone_number(phone_number): return jsonify({"error": "Incorrect phone number"}), 400 @@ -44,10 +43,8 @@ def user(): 'phone_number': phone_number, 'email_address': email } - data['user'].append(new_user) return jsonify(new_user), 201 - if request.method == 'PUT': # Find the user by email and update their information diff --git a/test_pytest.py b/test_pytest.py index 0d4df43..d7dfa82 100644 --- a/test_pytest.py +++ b/test_pytest.py @@ -143,6 +143,9 @@ def test_correct_spelling(text, expected): @pytest.fixture def setup_teardown(): + ''' + Setup temporary file to test load_data + ''' # Create a temporary directory and file for testing with tempfile.TemporaryDirectory() as temp_dir: test_file_path = os.path.join(temp_dir, 'test_resume.json') @@ -188,6 +191,9 @@ def setup_teardown(): yield test_file_path, test_data def test_load_data(setup_teardown): + ''' + Test the load_data util function + ''' test_file_path, test_data = setup_teardown # Test if the load_data function successfully loads the data