-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✅ [#4796] Added backend tests for ZGW API registration with product
- Loading branch information
1 parent
4740980
commit e48f8ce
Showing
8 changed files
with
672 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Use the official Python image from the Docker Hub | ||
FROM python:3.12-slim | ||
|
||
# Set the working directory | ||
WORKDIR /app | ||
|
||
# Copy the current directory contents into the container at /app | ||
COPY . /app | ||
|
||
# Install the dependencies | ||
RUN pip install Flask | ||
|
||
# Make port 80 available to the world outside this container | ||
EXPOSE 80 | ||
|
||
# Run app.py when the container launches | ||
CMD ["python", "app.py"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import logging | ||
|
||
from flask import Flask, request, jsonify | ||
|
||
app = Flask(__name__) | ||
|
||
# Set up logging to stdout | ||
logging.basicConfig(level=logging.INFO) | ||
|
||
|
||
@app.route("/product", methods=["GET"]) | ||
def handle_request(): | ||
# Log the request body | ||
app.logger.info("Request body: %s", request.data.decode("utf-8")) | ||
|
||
data = { | ||
"url": request.base_url, | ||
"id": "XXXXXXXX", | ||
"code": "XX-00000", | ||
"description": "Product description", | ||
"streeftermijn": "P0D", | ||
"uiterlijkeTermijn": "P0D" | ||
} | ||
|
||
return jsonify(data) | ||
|
||
|
||
if __name__ == "__main__": | ||
app.run(host="0.0.0.0", port=80, debug=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.