diff --git a/Backend/main.py b/Backend/main.py index 270ed02..5ed46ed 100644 --- a/Backend/main.py +++ b/Backend/main.py @@ -1,6 +1,5 @@ -# Module main.py -# This module is the main entry point for the pet adoption web application. -# It defines routes and their functions for managing pets and user information. +""" This module is the main entry point for the pet adoption web application. +It defines routes and their functions for managing pets and user information. """ from flask import Flask, request, jsonify from pet_func import get_random_pet from user_func import add_user_favorite, remove_user_favorite, replace_user_location @@ -33,4 +32,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) \ No newline at end of file diff --git a/Backend/pet_func.py b/Backend/pet_func.py index 71477a3..6638903 100644 --- a/Backend/pet_func.py +++ b/Backend/pet_func.py @@ -1,6 +1,5 @@ -# Module pet_func.py -# This module handles pet-related functionalities, providing details about random pets. -# It uses the Flask framework to return pet information in a JSON format. +""" This module handles pet-related functionalities, providing details about random pets. +It uses the Flask framework to return pet information in a JSON format. """ from flask import jsonify def get_random_pet(): diff --git a/Backend/test_main.py b/Backend/test_main.py index 3a7bf11..8cffc9d 100644 --- a/Backend/test_main.py +++ b/Backend/test_main.py @@ -1,6 +1,5 @@ -# Module test_main.py -# This module contains unit tests for the pet adoption web application, testing the functionality -# of various endpoints. It uses the requests library to simulate HTTP requests. +""" This module contains unit tests for the pet adoption web application, testing the functionality +of various endpoints. It uses the requests library to simulate HTTP requests. """ import requests def test_get_random_pet(): @@ -39,4 +38,4 @@ 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"} + assert response.json() == {"Location": "New York", "Name": "Eric", "Occupation": "Student", "Password": "2020"} \ No newline at end of file diff --git a/Backend/user_func.py b/Backend/user_func.py index f02b029..bb4cf17 100644 --- a/Backend/user_func.py +++ b/Backend/user_func.py @@ -1,8 +1,12 @@ -# Module user_func.py -# 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 = {"Name": "Eric", "Password": "2020", "Location": "Connecticut", "Occupation": "Student"} +user_acc_info = { + "Name": "Eric", + "Password": "2020", + "Location": "Connecticut", + "Occupation": "Student" +} def add_user_favorite(json_data): """Add user favorite pet to the database.""" @@ -18,4 +22,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 \ No newline at end of file