diff --git a/Backend/Dockerfile b/Backend/Dockerfile deleted file mode 100644 index 15c7bd8..0000000 --- a/Backend/Dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -FROM python:3.9-slim -WORKDIR /Docker1 -COPY main.py main.py -COPY requirements.txt requirements.txt -COPY PetFuc.py PetFuc.py -COPY UserFuc.py UserFuc.py -COPY test_main.py test_main.py -RUN pip3 install -r requirements.txt -CMD [ "python3", "main.py" ] - - diff --git a/Backend/__pycache__/PetFuc.cpython-310.pyc b/Backend/__pycache__/PetFuc.cpython-310.pyc deleted file mode 100644 index 67e63b8..0000000 Binary files a/Backend/__pycache__/PetFuc.cpython-310.pyc and /dev/null differ diff --git a/Backend/__pycache__/UserFuc.cpython-310.pyc b/Backend/__pycache__/UserFuc.cpython-310.pyc deleted file mode 100644 index 4f147aa..0000000 Binary files a/Backend/__pycache__/UserFuc.cpython-310.pyc and /dev/null differ diff --git a/Backend/__pycache__/test_main.cpython-310-pytest-8.3.3.pyc b/Backend/__pycache__/test_main.cpython-310-pytest-8.3.3.pyc deleted file mode 100644 index 37f94f2..0000000 Binary files a/Backend/__pycache__/test_main.cpython-310-pytest-8.3.3.pyc and /dev/null differ diff --git a/Backend/dockerfile b/Backend/dockerfile deleted file mode 100644 index fd397fc..0000000 --- a/Backend/dockerfile +++ /dev/null @@ -1,30 +0,0 @@ -# Use Python as the base image -FROM python:3.8-slim-buster - -# Install pip and Python dependencies -RUN apt-get update && apt-get install -y python3 python3-pip - -# Keeps Python from generating .pyc files in the container -ENV PYTHONDONTWRITEBYTECODE=1 - -# Turns off buffering for easier container logging -ENV PYTHONUNBUFFERED=1 - - -# Set the working directory in the container -WORKDIR /app - - -# Install pip requirements -COPY Backend/requirements.txt . -RUN python3 -m pip install -r requirements.txt - -# Copy main application file -COPY Backend/main.py . - -# Set the port for the application -ENV PORT=5000 -EXPOSE 5000 - -# Command to run the application -CMD ["python3", "main.py"] diff --git a/Backend/pet_func.py b/Backend/pet_func.py deleted file mode 100644 index 6638903..0000000 --- a/Backend/pet_func.py +++ /dev/null @@ -1,11 +0,0 @@ -""" 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(): - """Return a random pet's information.""" - randomint = "9" # API generates a random integer representing a PET ID - # API accesses database and returns information associated with the random ID - # Returns information such as profile picture of the pet - return jsonify({"id": randomint, "name": "Sam", "sex": "Male", "Age": "8", - "location": "Connecticut", "Breed": "Pug"}) # Return pet details diff --git a/Backend/test_main.py b/Backend/test_main.py deleted file mode 100644 index ad27f16..0000000 --- a/Backend/test_main.py +++ /dev/null @@ -1,44 +0,0 @@ -""" 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(): - """Test for http://localhost:5000/get_random_pet.""" - url = "http://localhost:5000" - response = requests.get(f"{url}/get_random_pet", timeout=10) - expected_response = {"id": "9", "name": "Sam", "sex": "Male", "Age": "8", - "location": "Connecticut", "Breed": "Pug"} - assert response.json() == expected_response - -def test_add_user_favorite(): - """Test for http://localhost:5000/add_user_favorite.""" - url = "http://localhost:5000" - favorite_pet1 = {"id": "9", "name": "Sam", "sex": "Male", "Age": "8", - "location": "Connecticut", "Breed": "Pug"} - response = requests.post(f"{url}/add_user_favorite", json=favorite_pet1, timeout=10) - assert response.json() == [favorite_pet1] - favorite_pet2 = {"id": "90", "name": "Ben", "sex": "Male", "Age": "2", - "location": "New York", "Breed": "Husky"} - response = requests.post(f"{url}/add_user_favorite", json=favorite_pet2, timeout=10) - assert response.json() == [favorite_pet1, favorite_pet2] - -def test_remove_user_favorite(): - """Test for http://localhost:5000/remove_user_favorite.""" - url = "http://localhost:5000" - favorite_pet1 = {"id": "9", "name": "Sam", "sex": "Male", "Age": "8", - "location": "Connecticut", "Breed": "Pug"} - response = requests.delete(f"{url}/remove_user_favorite", json=favorite_pet1, timeout=10) - assert response.json() == [] - favorite_pet2 = {"id": "90", "name": "Ben", "sex": "Male", "Age": "2", - "location": "New York", "Breed": "Husky"} - response = requests.delete(f"{url}/remove_user_favorite", json=favorite_pet2, timeout=10) - assert response.json() == [] - -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"} - \ No newline at end of file diff --git a/Backend/user_func.py b/Backend/user_func.py deleted file mode 100644 index 51ff4ad..0000000 --- a/Backend/user_func.py +++ /dev/null @@ -1,26 +0,0 @@ -""" 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" -} - -def add_user_favorite(json_data): - """Add user favorite pet to the database.""" - user_favorite_database.append(json_data) - return user_favorite_database # Return updated user favorites database - -def remove_user_favorite(json_data): - """Remove user favorite pet from the database.""" - user_favorite_database.remove(json_data) - return user_favorite_database # Return updated user favorites database - -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