Skip to content

Commit

Permalink
even more pylint debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
IshayuR committed Oct 31, 2024
1 parent b3a0e86 commit f126859
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
5 changes: 3 additions & 2 deletions Backend/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@

app = Flask(__name__)

user_acc_info = {"Name": "Eric", "Location": "Connecticut", "Occupation": "Student"} # Example user information
# Example user information
user_acc_info = {"Name": "Eric", "Location": "Connecticut", "Occupation": "Student"}

@app.route("/get_random_pet", methods=["GET"])
def get_random_pet_endpoint():
Expand All @@ -32,4 +33,4 @@ def replace_user_information():
return jsonify(replace_user_location(new_location)), 200

if __name__ == "__main__":
app.run(host="0.0.0.0", port=5000, debug=True)
app.run(host="0.0.0.0", port=5000, debug=True)
7 changes: 5 additions & 2 deletions Backend/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,8 @@ def test_remove_user_favorite():
def test_change_user_location():
"""Test for http://localhost:5000/change_user_location."""
url = "http://localhost:5000"
response = requests.put(f"{url}/change_user_location", json={"Location": "New York"}, timeout=10)
assert response.json() == {"Location": "New York", "Name": "Eric", "Occupation": "Student", "Password": "2020"}
response = requests.put(f"{url}/change_user_location", json={"Location": "New York"},
timeout=10)
assert response.json() == {"Location": "New York", "Name": "Eric", "Occupation":
"Student", "Password": "2020"}

5 changes: 3 additions & 2 deletions Backend/user_func.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
""" This module handles user-related functionalities such as managing favorites and updating user information. """
""" This module handles user-related functionalities such as
managing favorites and updating user information. """

user_favorite_database = [] # Simulate a database for user favorites
user_acc_info = {
Expand All @@ -22,4 +23,4 @@ def replace_user_location(new_location):
"""Change the user account location."""
new_location = new_location.get("Location")
user_acc_info["Location"] = new_location # Set new location associated with the user
return user_acc_info # Return updated user account information
return user_acc_info # Return updated user account information

0 comments on commit f126859

Please sign in to comment.