-
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
e0dfa57
commit 6863dd4
Showing
12 changed files
with
1,319 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
version: '3.8' | ||
|
||
name: rx-mission | ||
|
||
services: | ||
flask_app: | ||
build: ./rx-mission | ||
ports: | ||
- "80:80" | ||
volumes: | ||
- ./rx-mission/:/app/ | ||
|
||
networks: | ||
open-forms-dev: | ||
name: open-forms-dev |
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,23 @@ | ||
import json | ||
|
||
from flask import Flask, jsonify | ||
|
||
app = Flask(__name__) | ||
products = {} | ||
|
||
|
||
@app.route("/product/<string:product_uuid>", methods=["GET"]) | ||
def handle_request(product_uuid): | ||
if product_uuid not in products: | ||
return jsonify({"message": "Product not found"}), 404 | ||
|
||
product = products[product_uuid] | ||
return jsonify(product) | ||
|
||
|
||
if __name__ == "__main__": | ||
with open("./fixtures/rx-mission-products.json", encoding="utf-8") as json_file: | ||
parsed_json = json.load(json_file) | ||
products = {product["id"]: product for product in parsed_json["products"]} | ||
|
||
app.run(host="0.0.0.0", port=80, debug=True) |
Oops, something went wrong.