From 4aebd9ab45576e7dc8667118c8ea32cb3a1dc400 Mon Sep 17 00:00:00 2001 From: Animesh Pathak Date: Fri, 14 Jun 2024 09:39:13 +0000 Subject: [PATCH 01/10] Revert "fix: docker and readme instruction" This reverts commit 1195b762fe8bf9e222de57676ceb1bb0bb84c4c5. --- fastapi-postgres/README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/fastapi-postgres/README.md b/fastapi-postgres/README.md index eca7442..d902662 100644 --- a/fastapi-postgres/README.md +++ b/fastapi-postgres/README.md @@ -32,8 +32,6 @@ Keploy can be installed on Linux directly and on Windows with the help of WSL. B docker-compose up -d ``` -> Note: Update the `SQLALCHEMY_DATABASE_URL` in the `database.py` file if you want to use a keploy with docker. - ### Capture the Testcases This command will start the recording of API calls using ebpf:- From b96e84bc1595fb90f8de060db2693e2a937a3115 Mon Sep 17 00:00:00 2001 From: Animesh Pathak Date: Fri, 14 Jun 2024 09:46:44 +0000 Subject: [PATCH 02/10] fix: refactor flask-mongo change Signed-off-by: Animesh Pathak --- flask-mongo/Dockerfile | 6 +- flask-mongo/README.md | 643 +++++++++++++++++++++++++++++---- flask-mongo/app.py | 80 ++-- flask-mongo/docker-compose.yml | 6 +- flask-mongo/requirements.txt | 10 +- 5 files changed, 613 insertions(+), 132 deletions(-) diff --git a/flask-mongo/Dockerfile b/flask-mongo/Dockerfile index 961d93b..f892efb 100644 --- a/flask-mongo/Dockerfile +++ b/flask-mongo/Dockerfile @@ -1,5 +1,5 @@ # Use the official Python image as the base image -FROM python:3.10.12 +FROM python:3.9 # Set the working directory within the container WORKDIR /app @@ -11,7 +11,7 @@ COPY . . RUN pip3 install -r requirements.txt # Expose the port that the Flask app will run on -EXPOSE 5000 +EXPOSE 6000 # Start the Flask application -CMD ["python3", "app.py"] +CMD ["python3", "app.py"] \ No newline at end of file diff --git a/flask-mongo/README.md b/flask-mongo/README.md index 8a6cd42..526fad3 100644 --- a/flask-mongo/README.md +++ b/flask-mongo/README.md @@ -1,103 +1,600 @@ -# Sample Flask+Mongo app to demo Keploy +This application is a simple student management API built using Python's Flask framework and MongoDB for data storage. It allows you to perform basic CRUD (Create, Read, Update, Delete) operations on student records. The API supports CORS (Cross-Origin Resource Sharing) to facilitate cross-domain requests. -## Clone the sample flask-mongo application +## Table of Contents -```bash -git clone https://github.com/keploy/samples-python.git && cd samples-python/flask-mongo-local -``` - -## Install all dependencies +# Introduction -```bash -pip install -r requirements.txt -``` +๐Ÿช„ Dive into the world of Student CRUD Apps and see how seamlessly Keploy integrated with [Flask](https://flask.palletsprojects.com/en/3.0.x/) and [MongoDB](https://www.mongodb.com/). Buckle up, it's gonna be a fun ride! ๐ŸŽข -## Start the MongoDB server +## Pre-Requisite ๐Ÿ› ๏ธ -```bash -sudo service mongod start -``` +- Install WSL (`wsl --install`) for Windows Windows. -## Setup Keploy +## Optional ๐Ÿ› ๏ธ -Let's get started by setting up the Keploy alias with this command: +- Install Colima( `brew install colima && colima start` ) for MacOS MacOs. +## Get Started! ๐ŸŽฌ -```bash -curl --silent -O -L https://keploy.io/install.sh && source install.sh -``` +## Setup the MongoDB Database ๐Ÿ“ฆ -You should see something like this: +Create a docker network, run - ```bash - โ–“โ–ˆโ–ˆโ–“โ–„ - โ–“โ–“โ–“โ–“โ–ˆโ–ˆโ–“โ–ˆโ–“โ–„ - โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–“โ–’ - โ–€โ–“โ–“โ–ˆโ–ˆโ–ˆโ–„ โ–„โ–„ โ–„ โ–Œ - โ–„โ–Œโ–Œโ–“โ–“โ–ˆโ–ˆโ–ˆโ–ˆโ–„ โ–ˆโ–ˆ โ–“โ–ˆโ–€ โ–„โ–Œโ–€โ–„ โ–“โ–“โ–Œโ–„ โ–“โ–ˆ โ–„โ–Œโ–“โ–“โ–Œโ–„ โ–Œโ–Œ โ–“ - โ–“โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–Œโ–“โ–“ โ–ˆโ–ˆโ–“โ–ˆโ–„ โ–“โ–ˆโ–„โ–“โ–“ โ–โ–ˆโ–Œ โ–ˆโ–ˆ โ–“โ–ˆ โ–ˆโ–Œ โ–ˆโ–ˆ โ–ˆโ–Œ โ–ˆโ–“ - โ–“โ–“โ–“โ–“โ–€โ–€โ–€โ–€โ–“โ–“โ–“โ–“โ–“โ–“โ–Œ โ–ˆโ–ˆ โ–ˆโ–“ โ–“โ–Œโ–„โ–„ โ–โ–ˆโ–“โ–„โ–“โ–ˆโ–€ โ–ˆโ–“โ–ˆ โ–€โ–ˆโ–„โ–„โ–ˆโ–€ โ–ˆโ–“โ–ˆ - โ–“โ–Œ โ–โ–ˆโ–Œ โ–ˆโ–Œ - โ–“ - -Keploy CLI - -Available Commands: - example Example to record and test via keploy - generate-config generate the keploy configuration file - record record the keploy testcases from the API calls - test run the recorded testcases and execute assertions - update Update Keploy - -Flags: - --debug Run in debug mode - -h, --help help for keploy - -v, --version version for keploy - -Use "keploy [command] --help" for more information about a command. +docker network create backend ``` -## Lights, Camera, Record! ๐ŸŽฅ - -To initiate the recording of API calls, execute this command in your terminal: +Start the MongoDB instance- ```bash -keploy record -c "python3 app.py" +docker run -p 27017:27017 -d --network backend --name mongo mongo ``` -Now, your app will start running, and you have to make some API calls!! - -And once you are done, you can stop the recording and give yourself a pat on the back! With that simple spell, you've conjured up a test case with a mock! Explore the **keploy** directory and you'll discover your handiwork in `tests` directory and `mocks.yml`. - -## Check Test Coverage - -We have a `test-app.py` where all the unit test cases has been written. Now using Keploy, we can check it's code coverage!! -Now to run your unit tests with Keploy, you can run the command given below: +## Clone a simple Student Management API ๐Ÿงช ```bash -python3 -m coverage run -p --data-file=.coverage.unit -m pytest -s test_keploy.py test_app.py +git clone https://github.com/keploy/samples-python.git && cd samples-python/flask-mongo ``` -To combine the coverage from the unit tests, and Keploy's API tests we can use the command below: +## Installation ๐Ÿ“ฅ -```bash -python3 -m coverage combine -``` +Depending on your OS, choose your adventure: -Finally, to generate the coverage report for the test run, you can run: +-
+ Linux Linux or Windows Windows -```bash -python3 -m coverage report -``` + Alright, let's equip ourselves with the **latest Keploy binary**: -and if you want the coverage in an html file, you can run: + ```bash + curl --silent --location "https://github.com/keploy/keploy/releases/latest/download/keploy_linux_amd64.tar.gz" | tar xz -C /tmp -```bash -python3 -m coverage html -``` + sudo mkdir -p /usr/local/bin && sudo mv /tmp/keploy /usr/local/bin && keploy + ``` + + If everything goes right, your screen should look a bit like this: -## Wrapping it up ๐ŸŽ‰ + Moving on... +
+ Run App with Docker Container Docker -Congrats on the journey so far! You've seen Keploy's power, flexed your coding muscles, and had a bit of fun too! Now, go out there and keep exploring, innovating, and creating! Remember, with the right tools and a sprinkle of fun, anything's possible.๐Ÿ˜Š๐Ÿš€ + #### Add alias for Keploy: -Happy coding! โœจ๐Ÿ‘ฉโ€๐Ÿ’ป๐Ÿ‘จโ€๐Ÿ’ปโœจ + ```bash + alias keploy='sudo docker run --pull always --name keploy-v2 -p 16789:16789 --privileged --pid=host -it -v "$(pwd)":/files -v /sys/fs/cgroup:/sys/fs/cgroup -v /sys/kernel/debug:/sys/kernel/debug -v /sys/fs/bpf:/sys/fs/bpf -v /var/run/docker.sock:/var/run/docker.sock -v '"$HOME"'/.keploy-config:/root/.keploy-config -v '"$HOME"'/.keploy:/root/.keploy --rm ghcr.io/keploy/keploy' + ``` + + ### Lights, Camera, Record! ๐ŸŽฅ + + Build the app image: + + ```bash + docker build -t flask-app:1.0 . + ``` + + Capture the test-cases- + + ```shell + keploy record -c "docker run -p 6000:6000 --name flask-app --network backend flask-app:1.0" + ``` + + ๐Ÿ”ฅ**Make some API calls**. Postman, Hoppscotch or even curl - take your pick! + + Let's make URLs short and sweet: + + ### Generate testcases + + To generate testcases we just need to **make some API calls.** + + **1. Make a POST request** + + ```bash + curl -X PUT -H "Content-Type: application/json" -d '{"name": "Jane Smith", "age": 21}' http://localhost:6000/students/12345 + ``` + + **2. Make a GET request** + + ```bash + curl http://localhost:6000/students + ``` + + **3. Make a PUT request** + + ```bash + curl -X PUT -H "Content-Type: application/json" -d '{"name": "Jane Smith", "age": 21}' http://localhost:6000/students/12345 + ``` + + **4. Make a GET request** + + ```bash + curl http://localhost:6000/students/12345 + ``` + + **5. Make a DELETE request** + + ```bash + curl -X DELETE http://localhost:6000/students/12345 + ``` + + Give yourself a pat on the back! With that simple spell, you've conjured up a test case with a mock! Explore the **Keploy directory** and you'll discover your handiwork in `test-1.yml` and `mocks.yml`. + + ```yaml + version: api.keploy.io/v1beta2 + kind: Http + name: test-1 + spec: + metadata: {} + req: + method: POST + proto_major: 1 + proto_minor: 1 + url: http://localhost:6000/students + header: + Accept: "*/*" + Content-Length: "56" + Content-Type: application/json + Host: localhost:6000 + User-Agent: curl/7.81.0 + body: '{"student_id": "12344", "name": "John Doeww", "age": 10}' + body_type: "" + timestamp: 2023-11-13T13:02:32.241333562Z + resp: + status_code: 200 + header: + Content-Length: "48" + Content-Type: application/json + Date: Mon, 13 Nov 2023 13:02:32 GMT + Server: Werkzeug/2.2.2 Python/3.9.18 + body: | + { + "message": "Student created successfully" + } + body_type: "" + status_message: "" + proto_major: 0 + proto_minor: 0 + timestamp: 2023-11-13T13:02:34.752123715Z + objects: [] + assertions: + noise: + - header.Date + created: 1699880554 + curl: |- + curl --request POST \ + --url http://localhost:6000/students \ + --header 'Host: localhost:6000' \ + --header 'User-Agent: curl/7.81.0' \ + --header 'Accept: */*' \ + --header 'Content-Type: application/json' \ + --data '{"student_id": "12344", "name": "John Doeww", "age": 10}' + ``` + + This is how `mocks.yml` generated would look like:- + + ```yaml + version: api.keploy.io/v1beta2 + kind: Mongo + name: mocks + spec: + metadata: + operation: '{ OpMsg flags: 0, sections: [{ SectionSingle msg: {"find":"students","filter":{"student_id":"12345"},"projection":{"_id":{"$numberInt":"0"}},"limit":{"$numberInt":"1"},"singleBatch":true,"lsid":{"id":{"$binary":{"base64":"vPKsEFRdTLytlbnyVimqIA==","subType":"04"}}},"$db":"studentsdb"} }], checksum: 0 }' + requests: + - header: + length: 187 + requestId: 2127584089 + responseTo: 0 + Opcode: 2013 + message: + flagBits: 0 + sections: + - '{ SectionSingle msg: {"find":"students","filter":{"student_id":"12345"},"projection":{"_id":{"$numberInt":"0"}},"limit":{"$numberInt":"1"},"singleBatch":true,"lsid":{"id":{"$binary":{"base64":"vPKsEFRdTLytlbnyVimqIA==","subType":"04"}}},"$db":"studentsdb"} }' + checksum: 0 + read_delay: 3469848802 + responses: + - header: + length: 166 + requestId: 154 + responseTo: 2127584089 + Opcode: 2013 + message: + flagBits: 0 + sections: + - '{ SectionSingle msg: {"cursor":{"firstBatch":[{"student_id":"12345","name":"John Doe","age":{"$numberInt":"20"}}],"id":{"$numberLong":"0"},"ns":"studentsdb.students"},"ok":{"$numberDouble":"1.0"}} }' + checksum: 0 + read_delay: 869555 + created: 1699880576 + reqTimestampMock: 2023-11-13T13:02:56.385067848Z + resTimestampMock: 2023-11-13T13:02:56.386374941Z + ``` + + Want to see if everything works as expected? + + #### Run Tests + + Time to put things to the test ๐Ÿงช + + ```shell + keploy test -c "sudo docker run -p 6000:6000 --rm --network backend --name flask-app flask-app:1.0" --delay 10 + ``` + + > The `--delay` flag? Oh, that's just giving your app a little breather (in seconds) before the test cases come knocking. + + Final thoughts? Dive deeper! Try different API calls, tweak the DB response in the `mocks.yml`, or fiddle with the request or response in `test-x.yml`. Run the tests again and see the magic unfold!โœจ๐Ÿ‘ฉโ€๐Ÿ’ป๐Ÿ‘จโ€๐Ÿ’ปโœจ + + ## Wrapping it up ๐ŸŽ‰ + + Congrats on the journey so far! You've seen Keploy's power, flexed your coding muscles, and had a bit of fun too! Now, go out there and keep exploring, innovating, and creating! Remember, with the right tools and a sprinkle of fun, anything's possible.๐Ÿ˜Š๐Ÿš€ + + Happy coding! โœจ๐Ÿ‘ฉโ€๐Ÿ’ป๐Ÿ‘จโ€๐Ÿ’ปโœจ + +
+
+ +
+ Run App on ๐Ÿง Linux + + We'll be running our sample application right on Linux, but just to make things a tad more thrilling, we'll have the database (PostgreSQL) chill on Docker. Ready? Let's get the party started!๐ŸŽ‰ + + ### ๐Ÿ“ผ Roll the Tape - Recording Time! + + Install the dependencies: + + ```bash + pip install -r requirements.txt + ``` + + Now, let's Capture the test-cases- + + In `app.py`, replace the MongoDB connection URL with - `mongodb://0.0.0.0:27017/` + + Ready, set, record! Here's how: + + ```bash + keploy record -c "python3 app.py" + ``` + + Keep an eye out for the `-c `flag! It's the command charm to run the app. + + Alright, magician! With the app alive and kicking, let's weave some test cases. The spell? Making some API calls! Postman, Hoppscotch, or the classic curl - pick your wand. + + ### Generate testcases + + To generate testcases we just need to **make some API calls.** + + **1. Make a POST request** + + ```bash + curl -X PUT -H "Content-Type: application/json" -d '{"name": "Jane Smith", "age": 21}' http://localhost:6000/students/12345 + ``` + + **2. Make a GET request** + + ```bash + curl http://localhost:6000/students + ``` + + **3. Make a PUT request** + + ```bash + curl -X PUT -H "Content-Type: application/json" -d '{"name": "Jane Smith", "age": 21}' http://localhost:6000/students/12345 + ``` + + **4. Make a GET request** + + ```bash + curl http://localhost:6000/students/12345 + ``` + + **5. Make a DELETE request** + + ```bash + curl -X DELETE http://localhost:6000/students/12345 + ``` + + Give yourself a pat on the back! With that simple spell, you've conjured up a test case with a mock! Explore the **Keploy directory** and you'll discover your handiwork in `test-1.yml` and `mocks.yml`. + + ```yaml + version: api.keploy.io/v1beta2 + kind: Http + name: test-1 + spec: + metadata: {} + req: + method: POST + proto_major: 1 + proto_minor: 1 + url: http://localhost:6000/students + header: + Accept: "*/*" + Content-Length: "56" + Content-Type: application/json + Host: localhost:6000 + User-Agent: curl/7.81.0 + body: '{"student_id": "12344", "name": "John Doeww", "age": 10}' + body_type: "" + timestamp: 2023-11-13T13:02:32.241333562Z + resp: + status_code: 200 + header: + Content-Length: "48" + Content-Type: application/json + Date: Mon, 13 Nov 2023 13:02:32 GMT + Server: Werkzeug/2.2.2 Python/3.9.18 + body: | + { + "message": "Student created successfully" + } + body_type: "" + status_message: "" + proto_major: 0 + proto_minor: 0 + timestamp: 2023-11-13T13:02:34.752123715Z + objects: [] + assertions: + noise: + - header.Date + created: 1699880554 + curl: |- + curl --request POST \ + --url http://localhost:6000/students \ + --header 'Host: localhost:6000' \ + --header 'User-Agent: curl/7.81.0' \ + --header 'Accept: */*' \ + --header 'Content-Type: application/json' \ + --data '{"student_id": "12344", "name": "John Doeww", "age": 10}' + ``` + + This is how `mocks.yml` generated would look like:- + + ```yaml + version: api.keploy.io/v1beta2 + kind: Mongo + name: mocks + spec: + metadata: + operation: '{ OpMsg flags: 0, sections: [{ SectionSingle msg: {"find":"students","filter":{"student_id":"12345"},"projection":{"_id":{"$numberInt":"0"}},"limit":{"$numberInt":"1"},"singleBatch":true,"lsid":{"id":{"$binary":{"base64":"vPKsEFRdTLytlbnyVimqIA==","subType":"04"}}},"$db":"studentsdb"} }], checksum: 0 }' + requests: + - header: + length: 187 + requestId: 2127584089 + responseTo: 0 + Opcode: 2013 + message: + flagBits: 0 + sections: + - '{ SectionSingle msg: {"find":"students","filter":{"student_id":"12345"},"projection":{"_id":{"$numberInt":"0"}},"limit":{"$numberInt":"1"},"singleBatch":true,"lsid":{"id":{"$binary":{"base64":"vPKsEFRdTLytlbnyVimqIA==","subType":"04"}}},"$db":"studentsdb"} }' + checksum: 0 + read_delay: 3469848802 + responses: + - header: + length: 166 + requestId: 154 + responseTo: 2127584089 + Opcode: 2013 + message: + flagBits: 0 + sections: + - '{ SectionSingle msg: {"cursor":{"firstBatch":[{"student_id":"12345","name":"John Doe","age":{"$numberInt":"20"}}],"id":{"$numberLong":"0"},"ns":"studentsdb.students"},"ok":{"$numberDouble":"1.0"}} }' + checksum: 0 + read_delay: 869555 + created: 1699880576 + reqTimestampMock: 2023-11-13T13:02:56.385067848Z + resTimestampMock: 2023-11-13T13:02:56.386374941Z + ``` + + Want to see if everything works as expected? + + #### Run Tests + + Time to put things to the test ๐Ÿงช + + ```shell + keploy test -c "python3 app.py" --delay 10 + ``` + + > The `--delay` flag? Oh, that's just giving your app a little breather (in seconds) before the test cases come knocking. + + Final thoughts? Dive deeper! Try different API calls, tweak the DB response in the `mocks.yml`, or fiddle with the request or response in `test-x.yml`. Run the tests again and see the magic unfold!โœจ๐Ÿ‘ฉโ€๐Ÿ’ป๐Ÿ‘จโ€๐Ÿ’ปโœจ + + ## Wrapping it up ๐ŸŽ‰ + + Congrats on the journey so far! You've seen Keploy's power, flexed your coding muscles, and had a bit of fun too! Now, go out there and keep exploring, innovating, and creating! Remember, with the right tools and a sprinkle of fun, anything's possible. ๐Ÿ˜Š๐Ÿš€ + + Happy coding! โœจ๐Ÿ‘ฉโ€๐Ÿ’ป๐Ÿ‘จโ€๐Ÿ’ปโœจ +
+ +
+ +
+ +-
+ MacOS MacOs + + Dive straight in, but first in case you're using **Keploy** with **Colima**, give it a gentle nudge with (`colima start`). Let's make sure it's awake and ready for action! + + ### Add alias for Keploy ๐Ÿฐ: + + For the sake of convenience (and a bit of Mac magic ๐Ÿช„), let's set up a shortcut for Keploy: + + ### Use Keploy with Docker-Desktop + + Note: To run Keploy on MacOS through [Docker](https://docs.docker.com/desktop/release-notes/#4252) the version must be `4.25.2` or above. + + #### Creating Docker Volume + + ```bash + docker volume create --driver local --opt type=debugfs --opt device=debugfs debugfs + ``` + + ```bash + alias keploy='sudo docker run --pull always --name keploy-v2 -p 16789:16789 --privileged --pid=host -it -v "$(pwd)":/files -v /sys/fs/cgroup:/sys/fs/cgroup -v debugfs:/sys/kernel/debug:rw -v /sys/fs/bpf:/sys/fs/bpf -v /var/run/docker.sock:/var/run/docker.sock -v '"$HOME"'/.keploy-config:/root/.keploy-config -v '"$HOME"'/.keploy:/root/.keploy --rm ghcr.io/keploy/keploy' + ``` + + ### Use Keploy with Colima + + ```bash + alias keploy='sudo docker run --pull always --name keploy-v2 -p 16789:16789 --privileged --pid=host -it -v "$(pwd)":/files -v /sys/fs/cgroup:/sys/fs/cgroup -v /sys/kernel/debug:/sys/kernel/debug -v /sys/fs/bpf:/sys/fs/bpf -v /var/run/docker.sock:/var/run/docker.sock -v '"$HOME"'/.keploy-config:/root/.keploy-config -v '"$HOME"'/.keploy:/root/.keploy --rm ghcr.io/keploy/keploy' + ``` + + ### Lights, Camera, Record! ๐ŸŽฅ + + Build the app image: + + ```bash + docker build -t flask-app:1.0 . + ``` + + Capture the test-cases- + + ```shell + keploy record -c "docker run -p 6000:6000 --name DjangoApp --network backend --name flask-app flask-app:1.0" + ``` + + ๐Ÿ”ฅ**Make some API calls**. Postman, Hoppscotch or even curl - take your pick! + + Let's make URLs short and sweet: + + ### Generate testcases + + To generate testcases we just need to **make some API calls.** + + **1. Make a POST request** + + ```bash + curl -X PUT -H "Content-Type: application/json" -d '{"name": "Jane Smith", "age": 21}' http://localhost:6000/students/12345 + ``` + + **2. Make a GET request** + + ```bash + curl http://localhost:6000/students + ``` + + **3. Make a PUT request** + + ```bash + curl -X PUT -H "Content-Type: application/json" -d '{"name": "Jane Smith", "age": 21}' http://localhost:6000/students/12345 + ``` + + **4. Make a GET request** + + ```bash + curl http://localhost:6000/students/12345 + ``` + + **5. Make a DELETE request** + + ```bash + curl -X DELETE http://localhost:6000/students/12345 + ``` + + Give yourself a pat on the back! With that simple spell, you've conjured up a test case with a mock! Explore the **Keploy directory** and you'll discover your handiwork in `test-1.yml` and `mocks.yml`. + + ```yaml + version: api.keploy.io/v1beta2 + kind: Http + name: test-1 + spec: + metadata: {} + req: + method: POST + proto_major: 1 + proto_minor: 1 + url: http://localhost:6000/students + header: + Accept: "*/*" + Content-Length: "56" + Content-Type: application/json + Host: localhost:6000 + User-Agent: curl/7.81.0 + body: '{"student_id": "12344", "name": "John Doeww", "age": 10}' + body_type: "" + timestamp: 2023-11-13T13:02:32.241333562Z + resp: + status_code: 200 + header: + Content-Length: "48" + Content-Type: application/json + Date: Mon, 13 Nov 2023 13:02:32 GMT + Server: Werkzeug/2.2.2 Python/3.9.18 + body: | + { + "message": "Student created successfully" + } + body_type: "" + status_message: "" + proto_major: 0 + proto_minor: 0 + timestamp: 2023-11-13T13:02:34.752123715Z + objects: [] + assertions: + noise: + - header.Date + created: 1699880554 + curl: |- + curl --request POST \ + --url http://localhost:6000/students \ + --header 'Host: localhost:6000' \ + --header 'User-Agent: curl/7.81.0' \ + --header 'Accept: */*' \ + --header 'Content-Type: application/json' \ + --data '{"student_id": "12344", "name": "John Doeww", "age": 10}' + ``` + + This is how `mocks.yml` generated would look like:- + + ```yaml + version: api.keploy.io/v1beta2 + kind: Mongo + name: mocks + spec: + metadata: + operation: '{ OpMsg flags: 0, sections: [{ SectionSingle msg: {"find":"students","filter":{"student_id":"12345"},"projection":{"_id":{"$numberInt":"0"}},"limit":{"$numberInt":"1"},"singleBatch":true,"lsid":{"id":{"$binary":{"base64":"vPKsEFRdTLytlbnyVimqIA==","subType":"04"}}},"$db":"studentsdb"} }], checksum: 0 }' + requests: + - header: + length: 187 + requestId: 2127584089 + responseTo: 0 + Opcode: 2013 + message: + flagBits: 0 + sections: + - '{ SectionSingle msg: {"find":"students","filter":{"student_id":"12345"},"projection":{"_id":{"$numberInt":"0"}},"limit":{"$numberInt":"1"},"singleBatch":true,"lsid":{"id":{"$binary":{"base64":"vPKsEFRdTLytlbnyVimqIA==","subType":"04"}}},"$db":"studentsdb"} }' + checksum: 0 + read_delay: 3469848802 + responses: + - header: + length: 166 + requestId: 154 + responseTo: 2127584089 + Opcode: 2013 + message: + flagBits: 0 + sections: + - '{ SectionSingle msg: {"cursor":{"firstBatch":[{"student_id":"12345","name":"John Doe","age":{"$numberInt":"20"}}],"id":{"$numberLong":"0"},"ns":"studentsdb.students"},"ok":{"$numberDouble":"1.0"}} }' + checksum: 0 + read_delay: 869555 + created: 1699880576 + reqTimestampMock: 2023-11-13T13:02:56.385067848Z + resTimestampMock: 2023-11-13T13:02:56.386374941Z + ``` + + Want to see if everything works as expected? + + #### Run Tests + + Time to put things to the test ๐Ÿงช + + ```shell + keploy test -c "sudo docker run -p 6000:6000 --rm --network backend --name flask-app flask-app:1.0" --delay 10 + ``` + + > The `--delay` flag? Oh, that's just giving your app a little breather (in seconds) before the test cases come knocking. + + Final thoughts? Dive deeper! Try different API calls, tweak the DB response in the `mocks.yml`, or fiddle with the request or response in `test-x.yml`. Run the tests again and see the magic unfold!โœจ๐Ÿ‘ฉโ€๐Ÿ’ป๐Ÿ‘จโ€๐Ÿ’ปโœจ + + ## Wrapping it up ๐ŸŽ‰ + + Congrats on the journey so far! You've seen Keploy's power, flexed your coding muscles, and had a bit of fun too! Now, go out there and keep exploring, innovating, and creating! Remember, with the right tools and a sprinkle of fun, anything's possible.๐Ÿ˜Š๐Ÿš€ + + Happy coding! โœจ๐Ÿ‘ฉโ€๐Ÿ’ป๐Ÿ‘จโ€๐Ÿ’ปโœจ +
\ No newline at end of file diff --git a/flask-mongo/app.py b/flask-mongo/app.py index 730db9f..9e88224 100644 --- a/flask-mongo/app.py +++ b/flask-mongo/app.py @@ -1,56 +1,42 @@ from flask import Flask, request, jsonify from pymongo import MongoClient from flask_cors import CORS -from bson import ObjectId +import collections.abc app = Flask(__name__) cors = CORS(app, resources={r"/api/*": {"origins": "*"}}) -client = MongoClient('mongodb://localhost:27017/task_manager') -db = client['task_manager'] -collection = db['tasks'] - -@app.route('/api/tasks', methods=['POST']) -def create_task(): - data = request.get_json() - task = { - 'title': data['title'], - 'description': data['description'] - } - result = collection.insert_one(task) - return jsonify({'message': 'Task created successfully', 'id': str(result.inserted_id)}), 201 - -@app.route('/api/tasks', methods=['GET']) -def get_all_tasks(): - tasks = [] - for task in collection.find(): - tasks.append({ - 'id': str(task['_id']), - 'title': task['title'], - 'description': task['description'] - }) - return jsonify({'tasks': tasks}) - -@app.route('/api/tasks/', methods=['PUT']) -def update_task(task_id): - data = request.get_json() - updated_task = { - 'title': data['title'], - 'description': data['description'] - } - try: - result = collection.update_one({'_id': ObjectId(task_id)}, {'$set': updated_task}) - if result.modified_count == 0: - return jsonify({'error': 'Task not found or no changes were made'}), 404 - else: - return jsonify({'message': 'Task updated successfully'}) - except Exception as e: - return jsonify({'error': str(e)}), 500 - -@app.route('/api/tasks/', methods=['DELETE']) -def delete_task(task_id): - collection.delete_one({'_id': ObjectId(task_id)}) - return jsonify({'message': 'Task deleted successfully'}) +# Connect to MongoDB +client = MongoClient('mongodb://mongo:27017/') +db = client['studentsdb'] +students_collection = db['students'] + +@app.route('/students', methods=['GET']) +def get_students(): + students = list(students_collection.find({}, {'_id': 0})) + return jsonify(students) + +@app.route('/students/', methods=['GET']) +def get_student(student_id): + student = students_collection.find_one({'student_id': student_id}, {'_id': 0}) + return jsonify(student) + +@app.route('/students', methods=['POST']) +def create_student(): + new_student = request.json + students_collection.insert_one(new_student) + return jsonify({'message': 'Student created successfully'}) + +@app.route('/students/', methods=['PUT']) +def update_student(student_id): + updated_student = request.json + students_collection.update_one({'student_id': student_id}, {'$set': updated_student}) + return jsonify({'message': 'Student updated successfully'}) + +@app.route('/students/', methods=['DELETE']) +def delete_student(student_id): + students_collection.delete_one({'student_id': student_id}) + return jsonify({'message': 'Student deleted successfully'}) if __name__ == '__main__': - app.run(host='0.0.0.0', port=5000, debug=True) + app.run(host='0.0.0.0', port=6000, debug=True) \ No newline at end of file diff --git a/flask-mongo/docker-compose.yml b/flask-mongo/docker-compose.yml index 1d71e32..2970065 100644 --- a/flask-mongo/docker-compose.yml +++ b/flask-mongo/docker-compose.yml @@ -1,4 +1,4 @@ -version: "3" +version: '3' services: mongo: image: mongo @@ -16,7 +16,7 @@ services: build: context: . ports: - - "5000:5000" + - "6000:6000" depends_on: - mongo networks: @@ -26,4 +26,4 @@ networks: backend: external: true volumes: - data: + data: \ No newline at end of file diff --git a/flask-mongo/requirements.txt b/flask-mongo/requirements.txt index 324ca18..7a03746 100644 --- a/flask-mongo/requirements.txt +++ b/flask-mongo/requirements.txt @@ -1,6 +1,4 @@ -Flask==3.0.3 -Flask-Cors==4.0.0 -pymongo==4.6.3 -coverage==7.4.4 -bson==0.5.10 -keploy==2.0.0a33 \ No newline at end of file +Flask +pymongo==4.4.1 +Flask-Cors==3.0.10 +Werkzeug==2.2.2 \ No newline at end of file From caf3803d5ed66af7557f901876eae4849f358a84 Mon Sep 17 00:00:00 2001 From: Aman172003 Date: Sat, 3 Aug 2024 00:52:00 +0530 Subject: [PATCH 03/10] feat: Created a sample app using flask and redis Signed-off-by: Aman172003 --- flask-redis | 1 + 1 file changed, 1 insertion(+) create mode 160000 flask-redis diff --git a/flask-redis b/flask-redis new file mode 160000 index 0000000..3bc60d1 --- /dev/null +++ b/flask-redis @@ -0,0 +1 @@ +Subproject commit 3bc60d17215859317113497b3439a2814df566a5 From 8fff64f50b182347d61e699a55e1800b53fe4863 Mon Sep 17 00:00:00 2001 From: Aman172003 Date: Sat, 3 Aug 2024 00:55:07 +0530 Subject: [PATCH 04/10] feat: Created a sample app using flask and redis Signed-off-by: Aman172003 --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 9e475d0..28cacb4 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,8 @@ This repo contains the samples for [Keploy's](https://keploy.io) integration wit 4. [FastAPI-Twilio](https://github.com/keploy/samples-python/tree/main/fastapi-twilio) - This application is a SMS sending API built using Python's FastAPI and Twilio for their SMS sharing service. +4. [Flask-Redis](https://github.com/keploy/samples-python/tree/main/flask-redis) - This is an Application to Signup, Login and Fetch all users from a database. + ## Community Support โค๏ธ ### ๐Ÿค” Questions? From 18ae0ca2b4e5300b8f9faa22412206fda9c26d68 Mon Sep 17 00:00:00 2001 From: Aman172003 Date: Sat, 3 Aug 2024 03:49:24 +0530 Subject: [PATCH 05/10] changes Signed-off-by: Aman172003 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 28cacb4..3db0377 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ This repo contains the samples for [Keploy's](https://keploy.io) integration wit 4. [FastAPI-Twilio](https://github.com/keploy/samples-python/tree/main/fastapi-twilio) - This application is a SMS sending API built using Python's FastAPI and Twilio for their SMS sharing service. -4. [Flask-Redis](https://github.com/keploy/samples-python/tree/main/flask-redis) - This is an Application to Signup, Login and Fetch all users from a database. +4. [Flask-Redis](https://github.com/keploy/samples-python/tree/main/flask-redis) - This Flask-based application provides a book management system utilizing Redis for caching and storage. It supports adding, retrieving, updating, and deleting book records, with optimized search functionality and cache management for improved performance. The API endpoints ensure efficient data handling and quick access to book information ## Community Support โค๏ธ From 274847dddd62c3ffccaea912f8405ca5ee9245ed Mon Sep 17 00:00:00 2001 From: Aman172003 Date: Sat, 3 Aug 2024 04:12:37 +0530 Subject: [PATCH 06/10] init Signed-off-by: Aman172003 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3db0377..55de833 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ This repo contains the samples for [Keploy's](https://keploy.io) integration wit 4. [FastAPI-Twilio](https://github.com/keploy/samples-python/tree/main/fastapi-twilio) - This application is a SMS sending API built using Python's FastAPI and Twilio for their SMS sharing service. -4. [Flask-Redis](https://github.com/keploy/samples-python/tree/main/flask-redis) - This Flask-based application provides a book management system utilizing Redis for caching and storage. It supports adding, retrieving, updating, and deleting book records, with optimized search functionality and cache management for improved performance. The API endpoints ensure efficient data handling and quick access to book information +5. [Flask-Redis](https://github.com/keploy/samples-python/tree/main/flask-redis) - This Flask-based application provides a book management system utilizing Redis for caching and storage. It supports adding, retrieving, updating, and deleting book records, with optimized search functionality and cache management for improved performance. The API endpoints ensure efficient data handling and quick access to book information. ## Community Support โค๏ธ From d979cd090e3f84f7af1d0abcaf21d02d9d0d9c34 Mon Sep 17 00:00:00 2001 From: Aman172003 Date: Sat, 3 Aug 2024 04:27:12 +0530 Subject: [PATCH 07/10] initialized Signed-off-by: Aman172003 --- flask-redis | 1 - 1 file changed, 1 deletion(-) delete mode 160000 flask-redis diff --git a/flask-redis b/flask-redis deleted file mode 160000 index 3bc60d1..0000000 --- a/flask-redis +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 3bc60d17215859317113497b3439a2814df566a5 From a54a565d70e053b9a35d2e1c84abfae7289fa000 Mon Sep 17 00:00:00 2001 From: Aman172003 Date: Sat, 3 Aug 2024 04:31:11 +0530 Subject: [PATCH 08/10] updated Signed-off-by: Aman172003 --- flask-redis/.idea/.gitignore | 8 + flask-redis/.idea/flask-redis.iml | 8 + .../inspectionProfiles/profiles_settings.xml | 6 + flask-redis/.idea/misc.xml | 7 + flask-redis/.idea/modules.xml | 8 + flask-redis/.idea/vcs.xml | 6 + flask-redis/Dockerfile | 26 + flask-redis/README.md | 160 +++++ .../__pycache__/redisClient.cpython-311.pyc | Bin 0 -> 617 bytes flask-redis/api.txt | 44 ++ flask-redis/app.py | 14 + flask-redis/docker-compose.yml | 36 ++ flask-redis/dump.rdb | Bin 0 -> 201 bytes flask-redis/keploy.yml | 43 ++ .../reports/test-run-0/test-set-0-report.yaml | 606 ++++++++++++++++++ flask-redis/keploy/test-set-0/mocks.yaml | 417 ++++++++++++ .../keploy/test-set-0/tests/test-1.yaml | 47 ++ .../keploy/test-set-0/tests/test-2.yaml | 50 ++ .../keploy/test-set-0/tests/test-3.yaml | 43 ++ .../keploy/test-set-0/tests/test-4.yaml | 49 ++ .../keploy/test-set-0/tests/test-5.yaml | 50 ++ .../keploy/test-set-0/tests/test-6.yaml | 42 ++ flask-redis/redisClient.py | 12 + flask-redis/requirements.txt | 3 + .../__pycache__/book_routes.cpython-311.pyc | Bin 0 -> 7792 bytes .../routes/__pycache__/user.cpython-311.pyc | Bin 0 -> 3458 bytes flask-redis/routes/book_routes.py | 133 ++++ 27 files changed, 1818 insertions(+) create mode 100644 flask-redis/.idea/.gitignore create mode 100644 flask-redis/.idea/flask-redis.iml create mode 100644 flask-redis/.idea/inspectionProfiles/profiles_settings.xml create mode 100644 flask-redis/.idea/misc.xml create mode 100644 flask-redis/.idea/modules.xml create mode 100644 flask-redis/.idea/vcs.xml create mode 100644 flask-redis/Dockerfile create mode 100644 flask-redis/README.md create mode 100644 flask-redis/__pycache__/redisClient.cpython-311.pyc create mode 100644 flask-redis/api.txt create mode 100644 flask-redis/app.py create mode 100644 flask-redis/docker-compose.yml create mode 100644 flask-redis/dump.rdb create mode 100755 flask-redis/keploy.yml create mode 100755 flask-redis/keploy/reports/test-run-0/test-set-0-report.yaml create mode 100755 flask-redis/keploy/test-set-0/mocks.yaml create mode 100755 flask-redis/keploy/test-set-0/tests/test-1.yaml create mode 100755 flask-redis/keploy/test-set-0/tests/test-2.yaml create mode 100755 flask-redis/keploy/test-set-0/tests/test-3.yaml create mode 100755 flask-redis/keploy/test-set-0/tests/test-4.yaml create mode 100755 flask-redis/keploy/test-set-0/tests/test-5.yaml create mode 100755 flask-redis/keploy/test-set-0/tests/test-6.yaml create mode 100644 flask-redis/redisClient.py create mode 100644 flask-redis/requirements.txt create mode 100644 flask-redis/routes/__pycache__/book_routes.cpython-311.pyc create mode 100644 flask-redis/routes/__pycache__/user.cpython-311.pyc create mode 100644 flask-redis/routes/book_routes.py diff --git a/flask-redis/.idea/.gitignore b/flask-redis/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/flask-redis/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/flask-redis/.idea/flask-redis.iml b/flask-redis/.idea/flask-redis.iml new file mode 100644 index 0000000..909438d --- /dev/null +++ b/flask-redis/.idea/flask-redis.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/flask-redis/.idea/inspectionProfiles/profiles_settings.xml b/flask-redis/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..105ce2d --- /dev/null +++ b/flask-redis/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/flask-redis/.idea/misc.xml b/flask-redis/.idea/misc.xml new file mode 100644 index 0000000..a6218fe --- /dev/null +++ b/flask-redis/.idea/misc.xml @@ -0,0 +1,7 @@ + + + + + + \ No newline at end of file diff --git a/flask-redis/.idea/modules.xml b/flask-redis/.idea/modules.xml new file mode 100644 index 0000000..0360b3b --- /dev/null +++ b/flask-redis/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/flask-redis/.idea/vcs.xml b/flask-redis/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/flask-redis/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/flask-redis/Dockerfile b/flask-redis/Dockerfile new file mode 100644 index 0000000..9c0e897 --- /dev/null +++ b/flask-redis/Dockerfile @@ -0,0 +1,26 @@ +# Use the official Python image from the Docker Hub +FROM python:3.10-slim + +# RUN apt-get update && apt-get install -y curl +# Set the working directory in the container +WORKDIR /app + +# Copy the requirements file into the container +COPY requirements.txt . + +# Install the Python dependencies +RUN pip install --no-cache-dir -r requirements.txt + +# Copy the rest of the application code into the container +COPY . . + +# Download Keploy CA certificate and setup script +# RUN curl -o ca.crt https://raw.githubusercontent.com/keploy/keploy/main/pkg/core/proxy/asset/ca.crt && \ +# curl -o setup_ca.sh https://raw.githubusercontent.com/keploy/keploy/main/pkg/core/proxy/asset/setup_ca.sh && \ +# chmod +x setup_ca.sh # Make the setup script executable + +# Expose the port the app runs on +EXPOSE 5000 + +# Define the command to run the app +CMD ["python", "app.py"] diff --git a/flask-redis/README.md b/flask-redis/README.md new file mode 100644 index 0000000..7364e9d --- /dev/null +++ b/flask-redis/README.md @@ -0,0 +1,160 @@ +# flask-redis + +A sample App using flask and redis + +## Setup application + +1. Clone the repository and move to flask-redis folder +2. Create a .env file and copy-paste below credentials: + +```bash +REDIS_HOST=redis +REDIS_PORT=6379 +``` + +# Installing Redis + +```sh +brew install redis +``` +If homebrew is not installed, then go to https://brew.sh/ and install it. + +```bash +git clone https://github.com/keploy/samples-typescript && cd samples-typescript/flask-redis + +# Install the dependencies +pip3 install -r requirements.txt +``` + +# Installing Keploy + +Let's get started by setting up the Keploy alias with this command: + +```sh +curl -O https://raw.githubusercontent.com/keploy/keploy/main/keploy.sh && source keploy.sh +``` + +## Using Keploy : + +There are 2 ways you can run this sample application. + +1. [Natively on Linux/WSL](#natively-on-ubuntuwsl) +2. [Using Docker](#running-sample-app-using-docker) + +# Natively on Ubuntu/WSL + +## Let's install certificates + +1. **Install required packages:** + + ```sh + sudo apt-get install -y --no-install-recommends ca-certificates curl + ``` + + This command installs necessary packages without additional recommended packages. + +2. **Download CA certificate:** + + ```sh + curl -o ca.crt https://raw.githubusercontent.com/keploy/keploy/main/pkg/core/proxy/asset/ca.crt + ``` + + This command downloads the CA certificate to `ca.crt`. + +3. **Download setup script:** + + ```sh + curl -o setup_ca.sh https://raw.githubusercontent.com/keploy/keploy/main/pkg/core/proxy/asset/setup_ca.sh + ``` + + This command downloads the setup script to `setup_ca.sh`. + +4. **Make the setup script executable:** + + ```sh + chmod +x setup_ca.sh + ``` + + This command changes the permissions of `setup_ca.sh` to make it executable. + +5. **Run the setup script:** + + ```sh + source ./setup_ca.sh + ``` + + This command executes the setup script in the current shell. + +6. **Start the redis server:** + ```sh + redis-server + ``` + This command starts the redis server. + +## Capture the test cases + +1. **Start recording tests:** + ```bash + sudo -E env "PATH=$PATH" keploybin record -c 'python3 app.py' + ``` + +## Let's Generate the test cases + +Make API Calls using Hoppscotch, Postman or cURL command. Keploy will capture those calls to generate test suites containing test cases and data mocks. + +1. Refer to flask-redis/api.txt to make api calls. + +2. **Observe terminal output:** + Let's go ahead and create a few more test cases for different endpoints! + +## Running the test cases + +1. **Start the application:** + + ```bash + python3 app.py + ``` + +2. **Run the recorded tests:** + + ```bash + sudo -E env "PATH=$PATH" keploybin test -c 'python3 app.py' --delay 10 + ``` + +3. **Observe test run results:** + _Voila!! Our test cases have passed ๐ŸŒŸ_ + +--- + +# Using Docker + +Since we have to setup our app using docker(make sure your docker is running) + +## Create a custom network for Keploy since we are using the Docker + +```bash +docker network create keploy-network +``` + +## Capture the testcases + +We will run the keploy in record mode with docker-compose to start our application:- + +```bash +keploy record -c "sudo docker-compose up" --containerName "flask-web" + +``` + +#### Let's generate the testcases. + +Make API Calls using [Hoppscotch](https://hoppscotch.io), [Postman](https://postman.com) or curl command. Keploy with capture those calls to generate the test-suites containing testcases and data mocks. + +1. Refer to flask-redis/api.txt to make api calls + +## Running the testcases + +```bash +keploy test -c 'sudo docker-compose up' --containerName "flask-web" --delay 10 +``` + +_Voila!! Our testcases has passed ๐ŸŒŸ_ diff --git a/flask-redis/__pycache__/redisClient.cpython-311.pyc b/flask-redis/__pycache__/redisClient.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f0e977eb49475dc96ba126eff0af5fa3d7faae04 GIT binary patch literal 617 zcmZWmzfaph6nf{b9Xw>n z#>$kcg8ng4Ggv2e>V#N~!o<{f7gF`dJKgtwe&4foUtG5WXy3QL9ZK{+RkASp5X?px zoC5XQRa^(kzq ztY)jj^_^hTqJL46M18*{PMh9;rDw`8o%TJ~=TtBh{)PF+DZjR4=+(sU))`CsoNxLCMh4!bC|&K`F7c sBqP5FB;uZ$UzDDz;9pb@G*PKGmVq5)M0{q-0oMPb9b0d1@c6qL0O<=!bpQYW literal 0 HcmV?d00001 diff --git a/flask-redis/keploy.yml b/flask-redis/keploy.yml new file mode 100755 index 0000000..7b17386 --- /dev/null +++ b/flask-redis/keploy.yml @@ -0,0 +1,43 @@ +path: "" +appId: 0 +appName: "" +command: sudo docker-compose up +port: 0 +dnsPort: 26789 +proxyPort: 16789 +debug: false +disableTele: false +disableANSI: false +containerName: flask-web +networkName: "" +buildDelay: 30 +test: + selectedTests: {} + globalNoise: + global: {} + test-sets: {} + delay: 5 + apiTimeout: 5 + skipCoverage: false + coverageReportPath: "" + ignoreOrdering: true + mongoPassword: default@123 + language: "" + removeUnusedMocks: false + fallBackOnMiss: false + jacocoAgentPath: "" + basePath: "" + mocking: true + ignoredTests: {} +record: + filters: [] + recordTimer: 0s +configPath: "" +bypassRules: [] +generateGithubActions: false +keployContainer: keploy-v2 +keployNetwork: keploy-network +cmdType: native +inCi: false + +# Visit [https://keploy.io/docs/running-keploy/configuration-file/] to learn about using keploy through configration file. diff --git a/flask-redis/keploy/reports/test-run-0/test-set-0-report.yaml b/flask-redis/keploy/reports/test-run-0/test-set-0-report.yaml new file mode 100755 index 0000000..34f4af7 --- /dev/null +++ b/flask-redis/keploy/reports/test-run-0/test-set-0-report.yaml @@ -0,0 +1,606 @@ +version: api.keploy.io/v1beta1 +name: test-set-0-report +status: PASSED +success: 6 +failure: 0 +ignored: 0 +total: 6 +tests: + - kind: Http + name: test-set-0 + status: PASSED + started: 1722636974 + completed: 1722636974 + test_case_path: /Users/amanrai/Desktop/flask-redis/keploy/test-set-0 + mock_path: /Users/amanrai/Desktop/flask-redis/keploy/test-set-0/mocks + test_case_id: test-1 + req: + method: POST + proto_major: 1 + proto_minor: 1 + url: http://172.18.0.4:5000/books/ + header: + Accept: '*/*' + Content-Length: "44" + Content-Type: application/json + Host: localhost:5000 + User-Agent: curl/8.6.0 + body: '{"title": "1984", "author": "George Orwell"}' + timestamp: 2024-08-02T22:15:10.596402605Z + resp: + status_code: 201 + header: + Content-Length: "59" + Content-Type: application/json + Date: Fri, 02 Aug 2024 22:16:14 GMT + Server: Werkzeug/3.0.3 Python/3.10.14 + body: | + { + "book_id": 1, + "message": "Book added successfully" + } + status_message: "" + proto_major: 0 + proto_minor: 0 + timestamp: 0001-01-01T00:00:00Z + noise: + header.Date: [] + result: + status_code: + normal: true + expected: 201 + actual: 201 + headers_result: + - normal: true + expected: + key: Server + value: + - Werkzeug/3.0.3 Python/3.10.14 + actual: + key: Server + value: + - Werkzeug/3.0.3 Python/3.10.14 + - normal: true + expected: + key: Content-Length + value: + - "59" + actual: + key: Content-Length + value: + - "59" + - normal: true + expected: + key: Content-Type + value: + - application/json + actual: + key: Content-Type + value: + - application/json + - normal: true + expected: + key: Date + value: + - Fri, 02 Aug 2024 22:15:10 GMT + actual: + key: Date + value: + - Fri, 02 Aug 2024 22:16:14 GMT + body_result: + - normal: true + type: JSON + expected: | + { + "book_id": 1, + "message": "Book added successfully" + } + actual: | + { + "book_id": 1, + "message": "Book added successfully" + } + dep_result: [] + - kind: Http + name: test-set-0 + status: PASSED + started: 1722636974 + completed: 1722636974 + test_case_path: /Users/amanrai/Desktop/flask-redis/keploy/test-set-0 + mock_path: /Users/amanrai/Desktop/flask-redis/keploy/test-set-0/mocks + test_case_id: test-2 + req: + method: GET + proto_major: 1 + proto_minor: 1 + url: http://172.18.0.4:5000/books/?page=1&limit=10 + url_params: + limit: "10" + page: "1" + header: + Accept: '*/*' + Host: localhost:5000 + User-Agent: curl/8.6.0 + body: "" + timestamp: 2024-08-02T22:15:17.339856691Z + resp: + status_code: 200 + header: + Content-Length: "88" + Content-Type: application/json + Date: Fri, 02 Aug 2024 22:16:14 GMT + Server: Werkzeug/3.0.3 Python/3.10.14 + body: | + { + "books": [ + { + "author": "George Orwell", + "title": "1984" + } + ] + } + status_message: "" + proto_major: 0 + proto_minor: 0 + timestamp: 0001-01-01T00:00:00Z + noise: + header.Date: [] + result: + status_code: + normal: true + expected: 200 + actual: 200 + headers_result: + - normal: true + expected: + key: Content-Type + value: + - application/json + actual: + key: Content-Type + value: + - application/json + - normal: true + expected: + key: Date + value: + - Fri, 02 Aug 2024 22:15:17 GMT + actual: + key: Date + value: + - Fri, 02 Aug 2024 22:16:14 GMT + - normal: true + expected: + key: Server + value: + - Werkzeug/3.0.3 Python/3.10.14 + actual: + key: Server + value: + - Werkzeug/3.0.3 Python/3.10.14 + - normal: true + expected: + key: Content-Length + value: + - "88" + actual: + key: Content-Length + value: + - "88" + body_result: + - normal: true + type: JSON + expected: | + { + "books": [ + { + "author": "George Orwell", + "title": "1984" + } + ] + } + actual: | + { + "books": [ + { + "author": "George Orwell", + "title": "1984" + } + ] + } + dep_result: [] + - kind: Http + name: test-set-0 + status: PASSED + started: 1722636974 + completed: 1722636974 + test_case_path: /Users/amanrai/Desktop/flask-redis/keploy/test-set-0 + mock_path: /Users/amanrai/Desktop/flask-redis/keploy/test-set-0/mocks + test_case_id: test-3 + req: + method: GET + proto_major: 1 + proto_minor: 1 + url: http://172.18.0.4:5000/books/1 + header: + Accept: '*/*' + Host: localhost:5000 + User-Agent: curl/8.6.0 + body: "" + timestamp: 2024-08-02T22:15:24.919087736Z + resp: + status_code: 200 + header: + Content-Length: "51" + Content-Type: application/json + Date: Fri, 02 Aug 2024 22:16:14 GMT + Server: Werkzeug/3.0.3 Python/3.10.14 + body: | + { + "author": "George Orwell", + "title": "1984" + } + status_message: "" + proto_major: 0 + proto_minor: 0 + timestamp: 0001-01-01T00:00:00Z + noise: + header.Date: [] + result: + status_code: + normal: true + expected: 200 + actual: 200 + headers_result: + - normal: true + expected: + key: Date + value: + - Fri, 02 Aug 2024 22:15:24 GMT + actual: + key: Date + value: + - Fri, 02 Aug 2024 22:16:14 GMT + - normal: true + expected: + key: Server + value: + - Werkzeug/3.0.3 Python/3.10.14 + actual: + key: Server + value: + - Werkzeug/3.0.3 Python/3.10.14 + - normal: true + expected: + key: Content-Length + value: + - "51" + actual: + key: Content-Length + value: + - "51" + - normal: true + expected: + key: Content-Type + value: + - application/json + actual: + key: Content-Type + value: + - application/json + body_result: + - normal: true + type: JSON + expected: | + { + "author": "George Orwell", + "title": "1984" + } + actual: | + { + "author": "George Orwell", + "title": "1984" + } + dep_result: [] + - kind: Http + name: test-set-0 + status: PASSED + started: 1722636974 + completed: 1722636974 + test_case_path: /Users/amanrai/Desktop/flask-redis/keploy/test-set-0 + mock_path: /Users/amanrai/Desktop/flask-redis/keploy/test-set-0/mocks + test_case_id: test-4 + req: + method: GET + proto_major: 1 + proto_minor: 1 + url: http://172.18.0.4:5000/books/search?query=1984 + url_params: + query: "1984" + header: + Accept: '*/*' + Host: localhost:5000 + User-Agent: curl/8.6.0 + body: "" + timestamp: 2024-08-02T22:15:32.960447823Z + resp: + status_code: 200 + header: + Content-Length: "90" + Content-Type: application/json + Date: Fri, 02 Aug 2024 22:16:14 GMT + Server: Werkzeug/3.0.3 Python/3.10.14 + body: | + { + "results": [ + { + "author": "George Orwell", + "title": "1984" + } + ] + } + status_message: "" + proto_major: 0 + proto_minor: 0 + timestamp: 0001-01-01T00:00:00Z + noise: + header.Date: [] + result: + status_code: + normal: true + expected: 200 + actual: 200 + headers_result: + - normal: true + expected: + key: Content-Length + value: + - "90" + actual: + key: Content-Length + value: + - "90" + - normal: true + expected: + key: Content-Type + value: + - application/json + actual: + key: Content-Type + value: + - application/json + - normal: true + expected: + key: Date + value: + - Fri, 02 Aug 2024 22:15:32 GMT + actual: + key: Date + value: + - Fri, 02 Aug 2024 22:16:14 GMT + - normal: true + expected: + key: Server + value: + - Werkzeug/3.0.3 Python/3.10.14 + actual: + key: Server + value: + - Werkzeug/3.0.3 Python/3.10.14 + body_result: + - normal: true + type: JSON + expected: | + { + "results": [ + { + "author": "George Orwell", + "title": "1984" + } + ] + } + actual: | + { + "results": [ + { + "author": "George Orwell", + "title": "1984" + } + ] + } + dep_result: [] + - kind: Http + name: test-set-0 + status: PASSED + started: 1722636974 + completed: 1722636974 + test_case_path: /Users/amanrai/Desktop/flask-redis/keploy/test-set-0 + mock_path: /Users/amanrai/Desktop/flask-redis/keploy/test-set-0/mocks + test_case_id: test-5 + req: + method: PUT + proto_major: 1 + proto_minor: 1 + url: http://172.18.0.4:5000/books/1 + header: + Accept: '*/*' + Content-Length: "54" + Content-Type: application/json + Host: localhost:5000 + User-Agent: curl/8.6.0 + body: '{"title": "1984 - Updated", "author": "George Orwell"}' + timestamp: 2024-08-02T22:15:39.802018618Z + resp: + status_code: 200 + header: + Content-Length: "123" + Content-Type: application/json + Date: Fri, 02 Aug 2024 22:16:14 GMT + Server: Werkzeug/3.0.3 Python/3.10.14 + body: | + { + "book": { + "author": "George Orwell", + "title": "1984 - Updated" + }, + "message": "Book updated successfully" + } + status_message: "" + proto_major: 0 + proto_minor: 0 + timestamp: 0001-01-01T00:00:00Z + noise: + header.Date: [] + result: + status_code: + normal: true + expected: 200 + actual: 200 + headers_result: + - normal: true + expected: + key: Date + value: + - Fri, 02 Aug 2024 22:15:39 GMT + actual: + key: Date + value: + - Fri, 02 Aug 2024 22:16:14 GMT + - normal: true + expected: + key: Server + value: + - Werkzeug/3.0.3 Python/3.10.14 + actual: + key: Server + value: + - Werkzeug/3.0.3 Python/3.10.14 + - normal: true + expected: + key: Content-Length + value: + - "123" + actual: + key: Content-Length + value: + - "123" + - normal: true + expected: + key: Content-Type + value: + - application/json + actual: + key: Content-Type + value: + - application/json + body_result: + - normal: true + type: JSON + expected: | + { + "book": { + "author": "George Orwell", + "title": "1984 - Updated" + }, + "message": "Book updated successfully" + } + actual: | + { + "book": { + "author": "George Orwell", + "title": "1984 - Updated" + }, + "message": "Book updated successfully" + } + dep_result: [] + - kind: Http + name: test-set-0 + status: PASSED + started: 1722636974 + completed: 1722636974 + test_case_path: /Users/amanrai/Desktop/flask-redis/keploy/test-set-0 + mock_path: /Users/amanrai/Desktop/flask-redis/keploy/test-set-0/mocks + test_case_id: test-6 + req: + method: DELETE + proto_major: 1 + proto_minor: 1 + url: http://172.18.0.4:5000/books/1 + header: + Accept: '*/*' + Host: localhost:5000 + User-Agent: curl/8.6.0 + body: "" + timestamp: 2024-08-02T22:15:47.228393997Z + resp: + status_code: 200 + header: + Content-Length: "45" + Content-Type: application/json + Date: Fri, 02 Aug 2024 22:16:14 GMT + Server: Werkzeug/3.0.3 Python/3.10.14 + body: | + { + "message": "Book deleted successfully" + } + status_message: "" + proto_major: 0 + proto_minor: 0 + timestamp: 0001-01-01T00:00:00Z + noise: + header.Date: [] + result: + status_code: + normal: true + expected: 200 + actual: 200 + headers_result: + - normal: true + expected: + key: Content-Length + value: + - "45" + actual: + key: Content-Length + value: + - "45" + - normal: true + expected: + key: Content-Type + value: + - application/json + actual: + key: Content-Type + value: + - application/json + - normal: true + expected: + key: Date + value: + - Fri, 02 Aug 2024 22:15:47 GMT + actual: + key: Date + value: + - Fri, 02 Aug 2024 22:16:14 GMT + - normal: true + expected: + key: Server + value: + - Werkzeug/3.0.3 Python/3.10.14 + actual: + key: Server + value: + - Werkzeug/3.0.3 Python/3.10.14 + body_result: + - normal: true + type: JSON + expected: | + { + "message": "Book deleted successfully" + } + actual: | + { + "message": "Book deleted successfully" + } + dep_result: [] +test_set: test-set-0 diff --git a/flask-redis/keploy/test-set-0/mocks.yaml b/flask-redis/keploy/test-set-0/mocks.yaml new file mode 100755 index 0000000..1e3ba8b --- /dev/null +++ b/flask-redis/keploy/test-set-0/mocks.yaml @@ -0,0 +1,417 @@ +version: api.keploy.io/v1beta1 +kind: Redis +name: mock-0 +spec: + metadata: + type: config + redisrequests: + - origin: client + message: + - type: string + data: "*4\r\n$6\r\nCLIENT\r\n$7\r\nSETINFO\r\n$8\r\nLIB-NAME\r\n$8\r\nredis-py\r\n" + redisresponses: + - origin: server + message: + - type: string + data: "+OK\r\n" + reqtimestampmock: 2024-08-02T22:15:10.6084523Z + restimestampmock: 2024-08-02T22:15:10.608930466Z +--- +version: api.keploy.io/v1beta1 +kind: Redis +name: mock-1 +spec: + metadata: + type: config + redisrequests: + - origin: client + message: + - type: string + data: "*4\r\n$6\r\nCLIENT\r\n$7\r\nSETINFO\r\n$7\r\nLIB-VER\r\n$5\r\n5.0.8\r\n" + redisresponses: + - origin: server + message: + - type: string + data: "+OK\r\n" + reqtimestampmock: 2024-08-02T22:15:10.610066633Z + restimestampmock: 2024-08-02T22:15:10.610752633Z +--- +version: api.keploy.io/v1beta1 +kind: Redis +name: mock-2 +spec: + metadata: + type: config + redisrequests: + - origin: client + message: + - type: string + data: "*3\r\n$6\r\nINCRBY\r\n$7\r\nbook_id\r\n$1\r\n1\r\n" + redisresponses: + - origin: server + message: + - type: string + data: ":1\r\n" + reqtimestampmock: 2024-08-02T22:15:10.611978716Z + restimestampmock: 2024-08-02T22:15:10.612786841Z +--- +version: api.keploy.io/v1beta1 +kind: Redis +name: mock-3 +spec: + metadata: + type: config + redisrequests: + - origin: client + message: + - type: string + data: "*6\r\n$4\r\nHSET\r\n$6\r\nbook:1\r\n$5\r\ntitle\r\n$4\r\n1984\r\n$6\r\nauthor\r\n$13\r\nGeorge Orwell\r\n" + redisresponses: + - origin: server + message: + - type: string + data: ":2\r\n" + reqtimestampmock: 2024-08-02T22:15:10.613938591Z + restimestampmock: 2024-08-02T22:15:10.614915925Z +--- +version: api.keploy.io/v1beta1 +kind: Redis +name: mock-4 +spec: + metadata: + type: config + redisrequests: + - origin: client + message: + - type: string + data: "*2\r\n$3\r\nGET\r\n$18\r\nbooks_cache:page_1\r\n" + redisresponses: + - origin: server + message: + - type: string + data: "$-1\r\n" + reqtimestampmock: 2024-08-02T22:15:17.343482553Z + restimestampmock: 2024-08-02T22:15:17.344991261Z +--- +version: api.keploy.io/v1beta1 +kind: Redis +name: mock-5 +spec: + metadata: + type: config + redisrequests: + - origin: client + message: + - type: string + data: "*2\r\n$4\r\nKEYS\r\n$6\r\nbook:*\r\n" + redisresponses: + - origin: server + message: + - type: string + data: "*1\r\n$6\r\nbook:1\r\n" + reqtimestampmock: 2024-08-02T22:15:17.345461178Z + restimestampmock: 2024-08-02T22:15:17.346119386Z +--- +version: api.keploy.io/v1beta1 +kind: Redis +name: mock-6 +spec: + metadata: + type: config + redisrequests: + - origin: client + message: + - type: string + data: "*2\r\n$7\r\nHGETALL\r\n$6\r\nbook:1\r\n" + redisresponses: + - origin: server + message: + - type: string + data: "*4\r\n$5\r\ntitle\r\n$4\r\n1984\r\n$6\r\nauthor\r\n$13\r\nGeorge Orwell\r\n" + reqtimestampmock: 2024-08-02T22:15:17.346484636Z + restimestampmock: 2024-08-02T22:15:17.346881469Z +--- +version: api.keploy.io/v1beta1 +kind: Redis +name: mock-7 +spec: + metadata: + type: config + redisrequests: + - origin: client + message: + - type: string + data: "*4\r\n$5\r\nSETEX\r\n$18\r\nbooks_cache:page_1\r\n$3\r\n300\r\n$46\r\n[{\"title\": \"1984\", \"author\": \"George Orwell\"}]\r\n" + redisresponses: + - origin: server + message: + - type: string + data: "+OK\r\n" + reqtimestampmock: 2024-08-02T22:15:17.347539428Z + restimestampmock: 2024-08-02T22:15:17.348107886Z +--- +version: api.keploy.io/v1beta1 +kind: Redis +name: mock-8 +spec: + metadata: + type: config + redisrequests: + - origin: client + message: + - type: string + data: "*2\r\n$7\r\nHGETALL\r\n$6\r\nbook:1\r\n" + redisresponses: + - origin: server + message: + - type: string + data: "*4\r\n$5\r\ntitle\r\n$4\r\n1984\r\n$6\r\nauthor\r\n$13\r\nGeorge Orwell\r\n" + reqtimestampmock: 2024-08-02T22:15:24.91868625Z + restimestampmock: 2024-08-02T22:15:24.918989625Z +--- +version: api.keploy.io/v1beta1 +kind: Redis +name: mock-9 +spec: + metadata: + type: config + redisrequests: + - origin: client + message: + - type: string + data: "*2\r\n$3\r\nGET\r\n$17\r\nsearch:books:1984\r\n" + redisresponses: + - origin: server + message: + - type: string + data: "$-1\r\n" + reqtimestampmock: 2024-08-02T22:15:32.959388379Z + restimestampmock: 2024-08-02T22:15:32.959604088Z +--- +version: api.keploy.io/v1beta1 +kind: Redis +name: mock-10 +spec: + metadata: + type: config + redisrequests: + - origin: client + message: + - type: string + data: "*2\r\n$4\r\nKEYS\r\n$6\r\nbook:*\r\n" + redisresponses: + - origin: server + message: + - type: string + data: "*1\r\n$6\r\nbook:1\r\n" + reqtimestampmock: 2024-08-02T22:15:32.959842713Z + restimestampmock: 2024-08-02T22:15:32.959998921Z +--- +version: api.keploy.io/v1beta1 +kind: Redis +name: mock-11 +spec: + metadata: + type: config + redisrequests: + - origin: client + message: + - type: string + data: "*2\r\n$7\r\nHGETALL\r\n$6\r\nbook:1\r\n" + redisresponses: + - origin: server + message: + - type: string + data: "*4\r\n$5\r\ntitle\r\n$4\r\n1984\r\n$6\r\nauthor\r\n$13\r\nGeorge Orwell\r\n" + reqtimestampmock: 2024-08-02T22:15:32.960231671Z + restimestampmock: 2024-08-02T22:15:32.960389213Z +--- +version: api.keploy.io/v1beta1 +kind: Redis +name: mock-12 +spec: + metadata: + type: config + redisrequests: + - origin: client + message: + - type: string + data: "*4\r\n$5\r\nSETEX\r\n$17\r\nsearch:books:1984\r\n$3\r\n300\r\n$46\r\n[{\"title\": \"1984\", \"author\": \"George Orwell\"}]\r\n" + redisresponses: + - origin: server + message: + - type: string + data: "+OK\r\n" + reqtimestampmock: 2024-08-02T22:15:32.960706004Z + restimestampmock: 2024-08-02T22:15:32.960838838Z +--- +version: api.keploy.io/v1beta1 +kind: Redis +name: mock-13 +spec: + metadata: + type: config + redisrequests: + - origin: client + message: + - type: string + data: "*2\r\n$6\r\nEXISTS\r\n$6\r\nbook:1\r\n" + redisresponses: + - origin: server + message: + - type: string + data: ":1\r\n" + reqtimestampmock: 2024-08-02T22:15:39.801969841Z + restimestampmock: 2024-08-02T22:15:39.802299174Z +--- +version: api.keploy.io/v1beta1 +kind: Redis +name: mock-14 +spec: + metadata: + type: config + redisrequests: + - origin: client + message: + - type: string + data: "*4\r\n$4\r\nHSET\r\n$6\r\nbook:1\r\n$5\r\ntitle\r\n$14\r\n1984 - Updated\r\n" + redisresponses: + - origin: server + message: + - type: string + data: ":0\r\n" + reqtimestampmock: 2024-08-02T22:15:39.802669008Z + restimestampmock: 2024-08-02T22:15:39.803126174Z +--- +version: api.keploy.io/v1beta1 +kind: Redis +name: mock-15 +spec: + metadata: + type: config + redisrequests: + - origin: client + message: + - type: string + data: "*4\r\n$4\r\nHSET\r\n$6\r\nbook:1\r\n$6\r\nauthor\r\n$13\r\nGeorge Orwell\r\n" + redisresponses: + - origin: server + message: + - type: string + data: ":0\r\n" + reqtimestampmock: 2024-08-02T22:15:39.803492508Z + restimestampmock: 2024-08-02T22:15:39.803768216Z +--- +version: api.keploy.io/v1beta1 +kind: Redis +name: mock-16 +spec: + metadata: + type: config + redisrequests: + - origin: client + message: + - type: string + data: "*3\r\n$4\r\nHGET\r\n$6\r\nbook:1\r\n$5\r\ntitle\r\n" + redisresponses: + - origin: server + message: + - type: string + data: "$14\r\n1984 - Updated\r\n" + reqtimestampmock: 2024-08-02T22:15:39.804229258Z + restimestampmock: 2024-08-02T22:15:39.804523466Z +--- +version: api.keploy.io/v1beta1 +kind: Redis +name: mock-17 +spec: + metadata: + type: config + redisrequests: + - origin: client + message: + - type: string + data: "*3\r\n$4\r\nHGET\r\n$6\r\nbook:1\r\n$6\r\nauthor\r\n" + redisresponses: + - origin: server + message: + - type: string + data: "$13\r\nGeorge Orwell\r\n" + reqtimestampmock: 2024-08-02T22:15:39.805022091Z + restimestampmock: 2024-08-02T22:15:39.805174924Z +--- +version: api.keploy.io/v1beta1 +kind: Redis +name: mock-18 +spec: + metadata: + type: config + redisrequests: + - origin: client + message: + - type: string + data: "*6\r\n$5\r\nHMSET\r\n$6\r\nbook:1\r\n$5\r\ntitle\r\n$14\r\n1984 - Updated\r\n$6\r\nauthor\r\n$13\r\nGeorge Orwell\r\n" + redisresponses: + - origin: server + message: + - type: string + data: "+OK\r\n" + reqtimestampmock: 2024-08-02T22:15:39.806458299Z + restimestampmock: 2024-08-02T22:15:39.807372758Z +--- +version: api.keploy.io/v1beta1 +kind: Redis +name: mock-19 +spec: + metadata: + type: config + redisrequests: + - origin: client + message: + - type: string + data: "*2\r\n$6\r\nEXISTS\r\n$6\r\nbook:1\r\n" + redisresponses: + - origin: server + message: + - type: string + data: ":1\r\n" + reqtimestampmock: 2024-08-02T22:15:47.227235428Z + restimestampmock: 2024-08-02T22:15:47.227446803Z +--- +version: api.keploy.io/v1beta1 +kind: Redis +name: mock-20 +spec: + metadata: + type: config + redisrequests: + - origin: client + message: + - type: string + data: "*2\r\n$3\r\nDEL\r\n$6\r\nbook:1\r\n" + redisresponses: + - origin: server + message: + - type: string + data: ":1\r\n" + reqtimestampmock: 2024-08-02T22:15:47.227812303Z + restimestampmock: 2024-08-02T22:15:47.228129511Z +--- +version: api.keploy.io/v1beta1 +kind: Redis +name: mock-21 +spec: + metadata: + type: config + redisrequests: + - origin: client + message: + - type: string + data: "*2\r\n$3\r\nDEL\r\n$18\r\nbooks_cache:page_*\r\n" + redisresponses: + - origin: server + message: + - type: string + data: ":0\r\n" + reqtimestampmock: 2024-08-02T22:15:47.228357053Z + restimestampmock: 2024-08-02T22:15:47.228491803Z diff --git a/flask-redis/keploy/test-set-0/tests/test-1.yaml b/flask-redis/keploy/test-set-0/tests/test-1.yaml new file mode 100755 index 0000000..ddc1544 --- /dev/null +++ b/flask-redis/keploy/test-set-0/tests/test-1.yaml @@ -0,0 +1,47 @@ +version: api.keploy.io/v1beta1 +kind: Http +name: test-1 +spec: + metadata: {} + req: + method: POST + proto_major: 1 + proto_minor: 1 + url: http://localhost:5000/books/ + header: + Accept: '*/*' + Content-Length: "44" + Content-Type: application/json + Host: localhost:5000 + User-Agent: curl/8.6.0 + body: '{"title": "1984", "author": "George Orwell"}' + timestamp: 2024-08-02T22:15:10.596402605Z + resp: + status_code: 201 + header: + Content-Length: "59" + Content-Type: application/json + Date: Fri, 02 Aug 2024 22:15:10 GMT + Server: Werkzeug/3.0.3 Python/3.10.14 + body: | + { + "book_id": 1, + "message": "Book added successfully" + } + status_message: Created + proto_major: 0 + proto_minor: 0 + timestamp: 2024-08-02T22:15:12.681157884Z + objects: [] + assertions: + noise: + header.Date: [] + created: 1722636912 +curl: |- + curl --request POST \ + --url http://localhost:5000/books/ \ + --header 'Accept: */*' \ + --header 'Content-Type: application/json' \ + --header 'Host: localhost:5000' \ + --header 'User-Agent: curl/8.6.0' \ + --data '{"title": "1984", "author": "George Orwell"}' diff --git a/flask-redis/keploy/test-set-0/tests/test-2.yaml b/flask-redis/keploy/test-set-0/tests/test-2.yaml new file mode 100755 index 0000000..85115b2 --- /dev/null +++ b/flask-redis/keploy/test-set-0/tests/test-2.yaml @@ -0,0 +1,50 @@ +version: api.keploy.io/v1beta1 +kind: Http +name: test-2 +spec: + metadata: {} + req: + method: GET + proto_major: 1 + proto_minor: 1 + url: http://localhost:5000/books/?page=1&limit=10 + url_params: + limit: "10" + page: "1" + header: + Accept: '*/*' + Host: localhost:5000 + User-Agent: curl/8.6.0 + body: "" + timestamp: 2024-08-02T22:15:17.339856691Z + resp: + status_code: 200 + header: + Content-Length: "88" + Content-Type: application/json + Date: Fri, 02 Aug 2024 22:15:17 GMT + Server: Werkzeug/3.0.3 Python/3.10.14 + body: | + { + "books": [ + { + "author": "George Orwell", + "title": "1984" + } + ] + } + status_message: OK + proto_major: 0 + proto_minor: 0 + timestamp: 2024-08-02T22:15:19.428364137Z + objects: [] + assertions: + noise: + header.Date: [] + created: 1722636919 +curl: | + curl --request GET \ + --url http://localhost:5000/books/?page=1&limit=10 \ + --header 'Host: localhost:5000' \ + --header 'User-Agent: curl/8.6.0' \ + --header 'Accept: */*' \ diff --git a/flask-redis/keploy/test-set-0/tests/test-3.yaml b/flask-redis/keploy/test-set-0/tests/test-3.yaml new file mode 100755 index 0000000..316a90d --- /dev/null +++ b/flask-redis/keploy/test-set-0/tests/test-3.yaml @@ -0,0 +1,43 @@ +version: api.keploy.io/v1beta1 +kind: Http +name: test-3 +spec: + metadata: {} + req: + method: GET + proto_major: 1 + proto_minor: 1 + url: http://localhost:5000/books/1 + header: + Accept: '*/*' + Host: localhost:5000 + User-Agent: curl/8.6.0 + body: "" + timestamp: 2024-08-02T22:15:24.919087736Z + resp: + status_code: 200 + header: + Content-Length: "51" + Content-Type: application/json + Date: Fri, 02 Aug 2024 22:15:24 GMT + Server: Werkzeug/3.0.3 Python/3.10.14 + body: | + { + "author": "George Orwell", + "title": "1984" + } + status_message: OK + proto_major: 0 + proto_minor: 0 + timestamp: 2024-08-02T22:15:26.965315001Z + objects: [] + assertions: + noise: + header.Date: [] + created: 1722636926 +curl: | + curl --request GET \ + --url http://localhost:5000/books/1 \ + --header 'Accept: */*' \ + --header 'Host: localhost:5000' \ + --header 'User-Agent: curl/8.6.0' \ diff --git a/flask-redis/keploy/test-set-0/tests/test-4.yaml b/flask-redis/keploy/test-set-0/tests/test-4.yaml new file mode 100755 index 0000000..e659f2f --- /dev/null +++ b/flask-redis/keploy/test-set-0/tests/test-4.yaml @@ -0,0 +1,49 @@ +version: api.keploy.io/v1beta1 +kind: Http +name: test-4 +spec: + metadata: {} + req: + method: GET + proto_major: 1 + proto_minor: 1 + url: http://localhost:5000/books/search?query=1984 + url_params: + query: "1984" + header: + Accept: '*/*' + Host: localhost:5000 + User-Agent: curl/8.6.0 + body: "" + timestamp: 2024-08-02T22:15:32.960447823Z + resp: + status_code: 200 + header: + Content-Length: "90" + Content-Type: application/json + Date: Fri, 02 Aug 2024 22:15:32 GMT + Server: Werkzeug/3.0.3 Python/3.10.14 + body: | + { + "results": [ + { + "author": "George Orwell", + "title": "1984" + } + ] + } + status_message: OK + proto_major: 0 + proto_minor: 0 + timestamp: 2024-08-02T22:15:34.98447863Z + objects: [] + assertions: + noise: + header.Date: [] + created: 1722636934 +curl: | + curl --request GET \ + --url http://localhost:5000/books/search?query=1984 \ + --header 'Host: localhost:5000' \ + --header 'User-Agent: curl/8.6.0' \ + --header 'Accept: */*' \ diff --git a/flask-redis/keploy/test-set-0/tests/test-5.yaml b/flask-redis/keploy/test-set-0/tests/test-5.yaml new file mode 100755 index 0000000..7f38a10 --- /dev/null +++ b/flask-redis/keploy/test-set-0/tests/test-5.yaml @@ -0,0 +1,50 @@ +version: api.keploy.io/v1beta1 +kind: Http +name: test-5 +spec: + metadata: {} + req: + method: PUT + proto_major: 1 + proto_minor: 1 + url: http://localhost:5000/books/1 + header: + Accept: '*/*' + Content-Length: "54" + Content-Type: application/json + Host: localhost:5000 + User-Agent: curl/8.6.0 + body: '{"title": "1984 - Updated", "author": "George Orwell"}' + timestamp: 2024-08-02T22:15:39.802018618Z + resp: + status_code: 200 + header: + Content-Length: "123" + Content-Type: application/json + Date: Fri, 02 Aug 2024 22:15:39 GMT + Server: Werkzeug/3.0.3 Python/3.10.14 + body: | + { + "book": { + "author": "George Orwell", + "title": "1984 - Updated" + }, + "message": "Book updated successfully" + } + status_message: OK + proto_major: 0 + proto_minor: 0 + timestamp: 2024-08-02T22:15:41.813988842Z + objects: [] + assertions: + noise: + header.Date: [] + created: 1722636941 +curl: |- + curl --request PUT \ + --url http://localhost:5000/books/1 \ + --header 'Host: localhost:5000' \ + --header 'User-Agent: curl/8.6.0' \ + --header 'Accept: */*' \ + --header 'Content-Type: application/json' \ + --data '{"title": "1984 - Updated", "author": "George Orwell"}' diff --git a/flask-redis/keploy/test-set-0/tests/test-6.yaml b/flask-redis/keploy/test-set-0/tests/test-6.yaml new file mode 100755 index 0000000..228ce8e --- /dev/null +++ b/flask-redis/keploy/test-set-0/tests/test-6.yaml @@ -0,0 +1,42 @@ +version: api.keploy.io/v1beta1 +kind: Http +name: test-6 +spec: + metadata: {} + req: + method: DELETE + proto_major: 1 + proto_minor: 1 + url: http://localhost:5000/books/1 + header: + Accept: '*/*' + Host: localhost:5000 + User-Agent: curl/8.6.0 + body: "" + timestamp: 2024-08-02T22:15:47.228393997Z + resp: + status_code: 200 + header: + Content-Length: "45" + Content-Type: application/json + Date: Fri, 02 Aug 2024 22:15:47 GMT + Server: Werkzeug/3.0.3 Python/3.10.14 + body: | + { + "message": "Book deleted successfully" + } + status_message: OK + proto_major: 0 + proto_minor: 0 + timestamp: 2024-08-02T22:15:49.269456095Z + objects: [] + assertions: + noise: + header.Date: [] + created: 1722636949 +curl: | + curl --request DELETE \ + --url http://localhost:5000/books/1 \ + --header 'Accept: */*' \ + --header 'Host: localhost:5000' \ + --header 'User-Agent: curl/8.6.0' \ diff --git a/flask-redis/redisClient.py b/flask-redis/redisClient.py new file mode 100644 index 0000000..dc01e64 --- /dev/null +++ b/flask-redis/redisClient.py @@ -0,0 +1,12 @@ +import redis +import os + +# Connect to Redis server +client = redis.Redis( + host=os.getenv('REDIS_HOST', 'localhost'), + port=int(os.getenv('REDIS_PORT', 6379)), + db=0 +) + +def get_redis_client(): + return client diff --git a/flask-redis/requirements.txt b/flask-redis/requirements.txt new file mode 100644 index 0000000..bdb539d --- /dev/null +++ b/flask-redis/requirements.txt @@ -0,0 +1,3 @@ +Flask +redis +python-dotenv \ No newline at end of file diff --git a/flask-redis/routes/__pycache__/book_routes.cpython-311.pyc b/flask-redis/routes/__pycache__/book_routes.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ed6050f9ca3915cd087f35658586eeab6ef730e1 GIT binary patch literal 7792 zcmcgxU2NOPwI(T2qD~-Mw2ZAKKL0Y;k>Gio6s^-_kcyARvQ400S2(kT)0U7Db+V zW++jjB&WN5=y-TE9L}8iJ?A^;_&2q+H3XzzPW^7~$3BAifAmsFbiVN7&m=*7M2Lh) zCWuAyI=M()rxsn;T_mcb67(W-oxx>S!hPLM5fUlVlIHUL}6&$=(IMh^d;P>RfiPbpp6&z|`!J)Rw9O^1K z)V+d(P=$l9f`hOp2Y=O71S&ZAMArln4n9XG5O$f~;l!%6BFC4Krbm{(w<;-6xT!2J z#pmvXNz*qkC1+$wj4LyT6OO*s#NH^`W^N`nx6rtJ|sn8nzisS?6^U&_MPVU)~Dr-rlNSR7eN-*guaui)6 z9WUc4GIP`fkz|XlRHj%imPB{i2rfq-wC;)|dQz_cA$|#SNl_yE3H74CXRzo0nuzBE<7Qp^hFIDG-xIHw9fB(*-3N?VZV&-W-#TFU`s(y`V_RFm2LeEEy|~ zj~Ob6Q!AvG1HDsPCLY_>N-+%*}Rz)BX=aZ z;)0Xtis#c!TM?ufXFung=&n!*CCZ_|4QA|d_FH!&{7Sh;$}nu*<5-Ee$e~zD(W2Ke zR~t1`WurWRop@;P1}Kn{)rvJKPlbBJs|jd zyC6kTlbPpFp#G&B)knK#ZRHD(;eL^-J%iGMNH}McqP|?apHugH zCy39;m&|H%u4mvg(sYZ`?6N2Urc#mPCV9&w-&N27fjX0$;rC_DpctP`&Mq&m46PkS z+7j=0WH7Nj8%rodP>3tm=SZ<-7}Bu@A=O|QK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y!28?vz{f?zbDL)sd#AY*Y{Q;=Xb(7UH^g$ip5I z3J>6UXjh~>U#8W&;2frCwZtm184xK?iWT{C%p-~WKX>d90+@=FBE?$A3EIJ>@<3FD z-BEI4VqK~-25spE0b;xmiI?w~7TT^gPGC`J#g(mb#SZJr0?cl$){+$LSt(J=xIO|O z6r_r9uo$DXf^M1>8^(Yw_rp7i`YWr6q!O;PAb9{PEl5VaEkpbaDn${&9x=AdElf@< z-x7)X{IsDh*Kj!7a9EA&4abd!+9M)t@}eFU=3j~e`_#*h9zubUlSeMIlPV02#4>0yH&*63lZs59T!f)SnTHMribpvIlj z=u=ovhy5mlgYq)c%hnY_7supqkp3e6r;&_qo{Vmh$NaVZ8z?{T~y z$5ODXCL=>lMi_-p^)mtwXGPN3!Np~9H6abj^Y9(voAM)|yDpL>w}~EY@4QVM)tq^o z;L`YS$Ky-i+1Qt9)IIHnr#($?3oV+^q6=+?(3a+RNaiO^KWMspF>@r-m~PU^c7tr+ zr8sgD&JoeSxCpAFSl3KY?tF*CnGovGW{_>W)IPFnmjHsA1B-mkiF|8~Z&p{;dDJ{& zkda-AC(rH@Kv45uyXN3t&G(VlU^<8vJK(xgB|Y9#Z=wPE46+X`U>Gl88230)tZOPP f;IhhOZleyJ2HCkw?I-(p2_R^IqmCL}jgRRckqI?x literal 0 HcmV?d00001 diff --git a/flask-redis/routes/__pycache__/user.cpython-311.pyc b/flask-redis/routes/__pycache__/user.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6fec8fa87561325d6bb297484ab306dd067b7972 GIT binary patch literal 3458 zcmds3O-vg{6rR~#dl#=^X$j~+gl`OS;a-*ixJLaFmIf)QFn8q#nAC2<5Nxd@l!BRr;a zTtY~CA|8x5q+^ZOz3Uu8n{XFfM1*}hcc=!z zcPxT*BtkgTD^Je=I_y)^r4dQisr}HBX_?YcHq=LcH5>Ig!y9NIYe_ zBGJFj=mvCd8|hShW+{Z-=2_jGCb||krele?4q8IS(8;nGHsZ6X%z`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HVV!=wp@Q7wF~+;-ymkDwgZi!NYgcT}Ev>fZ+ikJi5xaB3 zj?!r', methods=['GET']) +def get_book(book_id): + # Create a cache key based on the book ID + cache_key = f'book:{book_id}' + + # Check if the key exists in the cache + cached_book = redis_client.hgetall(cache_key) # Use hgetall for hash + + if cached_book: + # Decode the keys and values from bytes to strings + decoded_book = {key.decode('utf-8'): value.decode('utf-8') for key, value in cached_book.items()} + return jsonify(decoded_book), 200 + else: + return jsonify({"message": "Book not found"}), 404 + + +@book.route('/', methods=['PUT']) +def update_book(book_id): + data = request.get_json() + title = data.get('title') + author = data.get('author') + + if not redis_client.exists(f'book:{book_id}'): + return jsonify({"error": "Book not found"}), 404 + + if title: + redis_client.hset(f'book:{book_id}', "title", title) + if author: + redis_client.hset(f'book:{book_id}', "author", author) + + # Retrieve the updated book data + updated_book = { + "title": redis_client.hget(f'book:{book_id}', "title").decode('utf-8'), + "author": redis_client.hget(f'book:{book_id}', "author").decode('utf-8') + } + + # Update the cache with the latest data + redis_client.hmset(f'book:{book_id}', updated_book) + + return jsonify({"message": "Book updated successfully", "book": updated_book}), 200 + + + +@book.route('/', methods=['DELETE']) +def delete_book(book_id): + # Check if the book exists + if not redis_client.exists(f'book:{book_id}'): + return jsonify({"message": "Book not found"}), 404 + + # Delete the book + redis_client.delete(f'book:{book_id}') + + # Invalidate related caches + redis_client.delete(f'books_cache:page_*') # Adjust this if you cache other items + + return jsonify({"message": "Book deleted successfully"}), 200 + +@book.route('/search', methods=['GET']) +def search_books(): + query = request.args.get('query', '') + + if not query: + return jsonify({"error": "Search query is required"}), 400 + + cache_key = f'search:books:{query}' + cached_results = redis_client.get(cache_key) + + if cached_results: + return jsonify(json.loads(cached_results)), 200 + + all_books = redis_client.keys(f'book:*') + search_results = [] + + for book_key in all_books: + book_data = redis_client.hgetall(book_key) + title = book_data[b'title'].decode('utf-8') + author = book_data[b'author'].decode('utf-8') + if query.lower() in title.lower(): + search_results.append({"title": title, "author": author}) + + # Store search results in cache + redis_client.setex(cache_key, 300, json.dumps(search_results)) # Cache for 5 minutes + + return jsonify({"results": search_results}), 200 + From b5b4d6a0cf81dcef05a2516fbac599501d749fda Mon Sep 17 00:00:00 2001 From: Aman172003 Date: Sat, 3 Aug 2024 04:34:01 +0530 Subject: [PATCH 09/10] removed errors Signed-off-by: Aman172003 --- flask-redis/.idea/.gitignore | 8 -------- flask-redis/.idea/flask-redis.iml | 8 -------- .../inspectionProfiles/profiles_settings.xml | 6 ------ flask-redis/.idea/misc.xml | 7 ------- flask-redis/.idea/modules.xml | 8 -------- flask-redis/.idea/vcs.xml | 6 ------ .../__pycache__/redisClient.cpython-311.pyc | Bin 617 -> 0 bytes .../__pycache__/book_routes.cpython-311.pyc | Bin 7792 -> 0 bytes .../routes/__pycache__/user.cpython-311.pyc | Bin 3458 -> 0 bytes 9 files changed, 43 deletions(-) delete mode 100644 flask-redis/.idea/.gitignore delete mode 100644 flask-redis/.idea/flask-redis.iml delete mode 100644 flask-redis/.idea/inspectionProfiles/profiles_settings.xml delete mode 100644 flask-redis/.idea/misc.xml delete mode 100644 flask-redis/.idea/modules.xml delete mode 100644 flask-redis/.idea/vcs.xml delete mode 100644 flask-redis/__pycache__/redisClient.cpython-311.pyc delete mode 100644 flask-redis/routes/__pycache__/book_routes.cpython-311.pyc delete mode 100644 flask-redis/routes/__pycache__/user.cpython-311.pyc diff --git a/flask-redis/.idea/.gitignore b/flask-redis/.idea/.gitignore deleted file mode 100644 index 13566b8..0000000 --- a/flask-redis/.idea/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml -# Editor-based HTTP Client requests -/httpRequests/ -# Datasource local storage ignored files -/dataSources/ -/dataSources.local.xml diff --git a/flask-redis/.idea/flask-redis.iml b/flask-redis/.idea/flask-redis.iml deleted file mode 100644 index 909438d..0000000 --- a/flask-redis/.idea/flask-redis.iml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/flask-redis/.idea/inspectionProfiles/profiles_settings.xml b/flask-redis/.idea/inspectionProfiles/profiles_settings.xml deleted file mode 100644 index 105ce2d..0000000 --- a/flask-redis/.idea/inspectionProfiles/profiles_settings.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - \ No newline at end of file diff --git a/flask-redis/.idea/misc.xml b/flask-redis/.idea/misc.xml deleted file mode 100644 index a6218fe..0000000 --- a/flask-redis/.idea/misc.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/flask-redis/.idea/modules.xml b/flask-redis/.idea/modules.xml deleted file mode 100644 index 0360b3b..0000000 --- a/flask-redis/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/flask-redis/.idea/vcs.xml b/flask-redis/.idea/vcs.xml deleted file mode 100644 index 35eb1dd..0000000 --- a/flask-redis/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/flask-redis/__pycache__/redisClient.cpython-311.pyc b/flask-redis/__pycache__/redisClient.cpython-311.pyc deleted file mode 100644 index f0e977eb49475dc96ba126eff0af5fa3d7faae04..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 617 zcmZWmzfaph6nf{b9Xw>n z#>$kcg8ng4Ggv2e>V#N~!o<{f7gF`dJKgtwe&4foUtG5WXy3QL9ZK{+RkASp5X?px zoC5XQRa^(kzq ztY)jj^_~-Mw2ZAKKL0Y;k>Gio6s^-_kcyARvQ400S2(kT)0U7Db+V zW++jjB&WN5=y-TE9L}8iJ?A^;_&2q+H3XzzPW^7~$3BAifAmsFbiVN7&m=*7M2Lh) zCWuAyI=M()rxsn;T_mcb67(W-oxx>S!hPLM5fUlVlIHUL}6&$=(IMh^d;P>RfiPbpp6&z|`!J)Rw9O^1K z)V+d(P=$l9f`hOp2Y=O71S&ZAMArln4n9XG5O$f~;l!%6BFC4Krbm{(w<;-6xT!2J z#pmvXNz*qkC1+$wj4L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B-mkiF|8~Z&p{;dDJ{& zkda-AC(rH@Kv45uyXN3t&G(VlU^<8vJK(xgB|Y9#Z=wPE46+X`U>Gl88230)tZOPP f;IhhOZleyJ2HCkw?I-(p2_R^IqmCL}jgRRckqI?x diff --git a/flask-redis/routes/__pycache__/user.cpython-311.pyc b/flask-redis/routes/__pycache__/user.cpython-311.pyc deleted file mode 100644 index 6fec8fa87561325d6bb297484ab306dd067b7972..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3458 zcmds3O-vg{6rR~#dl#=^X$j~+gl`OS;a-*ixJLaFmIf)QFn8q#nAC2<5Nxd@l!BRr;a zTtY~CA|8x5q+^ZOz3Uu8n{XFfM1*}hcc=!z zcPxT*BtkgTD^Je=I_y)^r4dQisr}HBX_?YcHq=LcH5>Ig!y9NIYe_ zBGJFj=mvCd8|hShW+{Z-=2_jGCb||krele?4q8IS(8;nGHsZ6X%z`U?dSmJ)D2hql zoJ(s)tirR%0|OrJmtV1Hnjp*V_Cdee%PT003I~xaYtyHO*TH78c zEN28v@eontH6dPusd;9&DP&5AS_S$IbuC+CM{1G1uYe4>U*ED=gPpE}*EXr=Si`7l z-=Zefp*PTdhkTQ+M8lJcCUsX@h#JN>X`;Cvoscxy@4i)9QllwNEw8FkqN_CWaR~E^ zRdDZefGVod1kt0~lBzGp4bz|jHjL=3zI=+U((vn=npsedOe_XVGnqtU>BV2L;gCou zja`Z64oxMOhaRDhbp2JihD=?@7v0NqYOOmv6LZ88hS1?ZwoD3Ld)u0!MAbE z7A`r$B}=&UOg^zXVRa5#fgxKScI4qFyd__;gexy$|7h78PNZk!sTduU8+A7I)c=rW z8drU?ukcx(oXqltBe|n_t9hU0<{5|T*eTZWM`FCMJRKS|U!9iBSmvKROi|JZjwel2 zC?NJd8FS|R!1C#d)SYM|4*V!nE=>*?7yl7RMw&sr#3cynEO05Fs^-#D&?s?}mjN^QIJ9u#`c=6$9c5uiE4n1k#3QkzT zi4uQ4vf4hjl@Ui7d2+#0u3FMnAo9^XAsz4`z!U0u!{x`vZdQ?nCJrOZBj~K5S+s&o z=#^XHpuCi4=(D;+jiN8k9bbI1xWJOG(w_Ef%U5-(V)VlsX2tIb6aiG1emqM*VUnB% zJlDg%keq>j$WzLQd40)nz0rjQJ*AOOSYhcB;z%#G;OR20t>qk$XLK_*H(dnkhXr~Y zpM%JuU4K(9jWoY|DJz!YAy0pq#)WY{Z322ErlE@ zWU-5$WaIf;R-nh0dmXvA5VPcvC4`CrYGwfn50(is?0QGXu8-Xui&aKIfUU4-{SKYA zSBO*=Rr?i6enkP-ptv6G)v6pgGJdtlP?Rf?;U}^V*~{W3PO?LyR8_UKZm6lWSuCsZ zpAU|LleZvYRZUOmCY%M8MYR}WfrXf~fFp{f6o^lCLzr>ipl&NsTQ07!xRN(v{%yF8 zFF{a(w{6S8EjgH9wB>$B?tg_c)wU(H~JD9C)rp0 zir5R-@wG1vCevCbp%0UHVV!=wp@Q7wF~+;-ymkDwgZi!NYgcT}Ev>fZ+ikJi5xaB3 zj?!r Date: Wed, 4 Sep 2024 14:28:11 +0530 Subject: [PATCH 10/10] chore: remove keploy folder Signed-off-by: Animesh Pathak --- django-postgres/README.md | 8 +- .../__pycache__/__init__.cpython-311.pyc | Bin 0 -> 201 bytes .../__pycache__/admin.cpython-311.pyc | Bin 0 -> 404 bytes .../__pycache__/apps.cpython-311.pyc | Bin 0 -> 582 bytes .../__pycache__/models.cpython-311.pyc | Bin 0 -> 1279 bytes .../__pycache__/serializers.cpython-311.pyc | Bin 0 -> 901 bytes .../__pycache__/urls.cpython-311.pyc | Bin 0 -> 520 bytes .../__pycache__/views.cpython-311.pyc | Bin 0 -> 4193 bytes .../__pycache__/0001_initial.cpython-311.pyc | Bin 0 -> 1341 bytes .../__pycache__/__init__.cpython-311.pyc | Bin 0 -> 212 bytes .../__pycache__/__init__.cpython-311.pyc | Bin 0 -> 205 bytes .../__pycache__/settings.cpython-311.pyc | Bin 0 -> 2778 bytes .../__pycache__/urls.cpython-311.pyc | Bin 0 -> 1266 bytes .../__pycache__/wsgi.cpython-311.pyc | Bin 0 -> 743 bytes .../django_postgres/docker-compose.yml | 2 +- .../keploy/test-set-0/mocks.yaml | 815 ------------- .../keploy/test-set-0/tests/test-1.yaml | 51 - .../keploy/test-set-0/tests/test-2.yaml | 43 - .../keploy/test-set-0/tests/test-3.yaml | 51 - .../keploy/test-set-0/tests/test-4.yaml | 43 - .../keploy/test-set-0/tests/test-5.yaml | 51 - .../keploy/test-set-0/tests/test-6.yaml | 43 - .../keploy/test-set-0/tests/test-7.yaml | 43 - .../keploy/testReports/report-1.yaml | 1081 ----------------- .../django_postgres/requirements.txt | 1 + 25 files changed, 6 insertions(+), 2226 deletions(-) create mode 100644 django-postgres/django_postgres/application/__pycache__/__init__.cpython-311.pyc create mode 100644 django-postgres/django_postgres/application/__pycache__/admin.cpython-311.pyc create mode 100644 django-postgres/django_postgres/application/__pycache__/apps.cpython-311.pyc create mode 100644 django-postgres/django_postgres/application/__pycache__/models.cpython-311.pyc create mode 100644 django-postgres/django_postgres/application/__pycache__/serializers.cpython-311.pyc create mode 100644 django-postgres/django_postgres/application/__pycache__/urls.cpython-311.pyc create mode 100644 django-postgres/django_postgres/application/__pycache__/views.cpython-311.pyc create mode 100644 django-postgres/django_postgres/application/migrations/__pycache__/0001_initial.cpython-311.pyc create mode 100644 django-postgres/django_postgres/application/migrations/__pycache__/__init__.cpython-311.pyc create mode 100644 django-postgres/django_postgres/django_postgres/__pycache__/__init__.cpython-311.pyc create mode 100644 django-postgres/django_postgres/django_postgres/__pycache__/settings.cpython-311.pyc create mode 100644 django-postgres/django_postgres/django_postgres/__pycache__/urls.cpython-311.pyc create mode 100644 django-postgres/django_postgres/django_postgres/__pycache__/wsgi.cpython-311.pyc delete mode 100755 django-postgres/django_postgres/keploy/test-set-0/mocks.yaml delete mode 100755 django-postgres/django_postgres/keploy/test-set-0/tests/test-1.yaml delete mode 100755 django-postgres/django_postgres/keploy/test-set-0/tests/test-2.yaml delete mode 100755 django-postgres/django_postgres/keploy/test-set-0/tests/test-3.yaml delete mode 100755 django-postgres/django_postgres/keploy/test-set-0/tests/test-4.yaml delete mode 100755 django-postgres/django_postgres/keploy/test-set-0/tests/test-5.yaml delete mode 100755 django-postgres/django_postgres/keploy/test-set-0/tests/test-6.yaml delete mode 100755 django-postgres/django_postgres/keploy/test-set-0/tests/test-7.yaml delete mode 100755 django-postgres/django_postgres/keploy/testReports/report-1.yaml diff --git a/django-postgres/README.md b/django-postgres/README.md index 91161b4..1f04ac2 100644 --- a/django-postgres/README.md +++ b/django-postgres/README.md @@ -20,7 +20,7 @@ git clone https://github.com/keploy/samples-python.git && cd samples-python/djan Keploy can be installed on Linux directly and on Windows with the help of WSL. Based on your system architecture, install the keploy latest binary release ```bash - curl -O https://raw.githubusercontent.com/keploy/keploy/main/keploy.sh && source keploy.sh + curl -O https://keploy.io/install.sh && source install.sh keploy ``` @@ -92,13 +92,13 @@ This will return all the data saved in the database. ### Make a GET request to get a specific data ```bash -curl --location 'http://127.0.0.1:8000/user/c793c752-ad95-4cff-8cbe-5715a1e8a76e/' +curl --location 'http://127.0.0.1:8000/user/' ``` ### Make a PUT request to update a specific data ```bash -curl --location --request PUT 'http://127.0.0.1:8000/user/efbe12df-3cae-4cbc-b045-dc74840aa82b/' \ +curl --location --request PUT 'http://127.0.0.1:8000/user/' \ --header 'Content-Type: application/json' \ --data-raw ' { "name": "Jane Smith", @@ -111,7 +111,7 @@ curl --location --request PUT 'http://127.0.0.1:8000/user/efbe12df-3cae-4cbc-b04 ### Make a DELETE request to delete a specific data ```bash -curl --location --request DELETE 'http://127.0.0.1:8000/user/ee2af3fc-0503-4a6a-a452-b7d8c87a085b/' +curl --location --request DELETE 'http://127.0.0.1:8000/user/' ``` Now both these API calls were captured as **editable** testcases and written to `keploy/tests` folder. The keploy directory would also have `mocks` file that contains all the outputs of postgres operations. diff --git a/django-postgres/django_postgres/application/__pycache__/__init__.cpython-311.pyc b/django-postgres/django_postgres/application/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cc721f23d69991b90ceb2d0ee8eb2fe0ce2e1a98 GIT binary patch literal 201 zcmZ3^%ge<81b-^0rGe6s7oYZ37g36MN{5<`Xti-(ZeBFZl;*#{D)M6+<9?nlJ zD9Fi7PAtg;s*R7&%*!l^kJl@x{Ka9Do1apelWJGQ3bYL5oML_;@qw9I}J+WY~;gv7=GVxS8Ou}NGxcCcNE?EC;GSeZbGKa(OP zs;o@iDs`(ExX=dC)3fj1+4tVP1VINdzKe(J8_ZudX~NkQ%Tp{KfdVB0GBP3rXp1_c zl{q7a03&0!8F})W>VIa=GXZ$Rvkshh&!F$kYuYE37txH%dHs&eJvU6B^!;j=jw6|< zVXUOp{7TpRRDPx?6GqoYm20?VRa>)!8_V=7EU^o#i!fCg3yqRIPB|(FE+@C4iLzWU zGsp{@DjBZT2e~pf(adc44fGCb{QwU-XsiGL literal 0 HcmV?d00001 diff --git a/django-postgres/django_postgres/application/__pycache__/apps.cpython-311.pyc b/django-postgres/django_postgres/application/__pycache__/apps.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..485ad77adf37ccbe77b4d0b4f4c147a64de6d54b GIT binary patch literal 582 zcmZutJx{|h5IrX;DwHB%Ky+YW>_DKHp#18-= z{!GUzD-&B$nGgf#Bzy_Z_W8Zs-Sg${>-9N6d+%R&Zt;H71SHMh8?o5D3JcYRivyP!zdDgT^ve}&|+LK|&@3zZ~{30cpt{@l!2bVCwTH>0_ za4lw{hLtU0vGCho;>)lQxm;ssUf7j3JGBGJxKQ@4-`zC>k;S9LZBMx248F3*c@3ajL*tW3xN z{1i@4)UI(h$&For0FrFrNQNW{Tef8nw%v zis{?lmKH^qIQ--(-(5Bs~?$C^=*4A69r5;rezls5tih5 z0LhD}^c$1X4VR!TJ%YW*%hd94QI3H+$CM?mdLnFb!e_U*+6AA%T5ksM3Z)W1T}6~4 zdW!88DguVjjnRth;8E&Ut#ZX$bw_Ng>Tixx)2Z2*KB?8cid!8;Yi4!TeNuC&w@NVW z`tZUxYc<;{o1Vq7@nssRab_T-9)U2fV5IAb%&EBN4bUmv-KhuZ2WKMHQZdicFrphm zmVuBjB8W&$j>u>gjTL0Jjp%=_A1P}!pZfiKy zaAUla9caD?vjeSxqdUjXgZCeT>|#5+7-kn6lO27qIUVYQt+7L&&*}4ReLmFZ8&jRa zP;)&j47H4-@nakqFeogw3rk^Psqw0lf7DzF^N(7kBNF82+WEOKKi8N!RV20l6x>vC z5hDLmG0C*}&_>X5Oqn9ycFdOgT0Ho;(qRt2to}Sb7SsNcJmwSPj!?+eX+n~u4tN+` e{X3v9xcZ+a(-KearfR;}8T%#1fB$1LO5iU{fku7+ literal 0 HcmV?d00001 diff --git a/django-postgres/django_postgres/application/__pycache__/serializers.cpython-311.pyc b/django-postgres/django_postgres/application/__pycache__/serializers.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9dde19877d1cb82850b7a6cf2359c669c347b2b0 GIT binary patch literal 901 zcmZ`%J#*7Q5WUlvO(0)G0-2#_P!T&nfFTqNR7sPe5yg%0o$WIxOWes5OqGHnB^CJx zVHo~Q3JTAaP^ELmsXP?yN|B9bl0Dti?d|IA?bCf1#q1R< z&Il)*Dw5EMQo8{yxG(6yt3Ez=3Hb@Lw8-bd5eXZY=!VqZH$ux; z$M>!#YFjK;&`gTSs#14dX;uUnH?qwwcAo9H*Mw#<6&BWG)WF zz&07fB*yFtV@b+K3fB)9`#6eK8PO=N^&u#f4Z2b&Zhnv%o@~zA{WKA6lMZF4FMDZA z$>Hcz+r&wxgxSr;c|RSt`5+$l(%mdIc~1*-n&UrS*WOPRDcbd*8ofEspI%B z>6F}#SH=GI9nrD`vZKOl&~eVX8dL`LKWMyYHYn6IrL^k@DDCnRln1LHcHVqm{+$>4 t2@v4bFav<8ODUa@rx*2SLUu0d&opo;Hgr3FefMj7@2Uu1-;q*u^$*7{+LQnQ literal 0 HcmV?d00001 diff --git a/django-postgres/django_postgres/application/__pycache__/urls.cpython-311.pyc b/django-postgres/django_postgres/application/__pycache__/urls.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3c1e8f8218a4906f0f8efa207dcfa9e7a074cbd4 GIT binary patch literal 520 zcmZ8cJ5K^Z5Z=Apg9Ac{ufoLAh8Vcc%0NuCl*W)4n#+Y<;K<%1yLT#9l$2Kb4>U%9 z%#l!#Ypv)=C`^cjvjQeKJ3G7I%r~#sVlj_Ez6Vd8FL*x{*hpsmS@hxaj3}a*BM-MQ zMpUCZ*F3$YW27O5DPek_Y!a#Qk$KS(dWXA`UrrV{#>PX<|D3MY%Fx_3D(7d4RK_U@ zov1g%D`4EZ>`p#p&*IpnH7h;nvdE4@>O{<@jI)R}B@-&kcRZG&bO#9MoZD@|fTMzq zayBi{zTw zz|3`w@e~~;+d4&i$+pf-WaNeyqr=C`$-b4GUL~Y4CXEScOo<8p-BEK=JWft(38{}s SeM0JULoaE=f;yrIt$qM(R*l~P literal 0 HcmV?d00001 diff --git a/django-postgres/django_postgres/application/__pycache__/views.cpython-311.pyc b/django-postgres/django_postgres/application/__pycache__/views.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..48caa6d7d45ce7f92e67e7462131f4886c1af8dd GIT binary patch literal 4193 zcmc&%YiJzT6~6P>oqdd69a}5OD|@wi#Cl})sMNHPE4$&$AO0B`JNZ#4vtmHYfFMx%!~Zrog*249=gvN7 zB9*qG?cF`ZX;oN42fT?zNR+mv&%C*hs!c_)`+!>w5>G;AMacLF!TB4tka6BrP9NDDHgSK63|{Q%QIEdk|jdx)Q-&~R{tzJO12xcT2tbopRLynYDa2q zMc;w&*$t+;hsdZ675zG6ohNQP$rwEcH)Vsl!ORrjtJEsG#>}Br%HjjI=z~9i52|+f z@9%qqg>lQf6&=mx#jdjp?oz{IMA>~aMthmTYjmr zulxV$7ZE{>slANJg@DjN$3=rnNQx3&lrXsf2Ahl~B*P&kqH)=9rK5_nn!;eTD!rz} zRq47JX98E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YR# literal 0 HcmV?d00001 diff --git a/django-postgres/django_postgres/application/migrations/__pycache__/0001_initial.cpython-311.pyc b/django-postgres/django_postgres/application/migrations/__pycache__/0001_initial.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b9c2567a205266514e6c832972180ba471f8bdc2 GIT binary patch literal 1341 zcmZuxzi-<{6h2ZUB~m{kscs#ql3So@T{W@g7MY5oC=l0y)5a*ANO9SLpmk@7GJln% zlE{;W4jnVK{tH|b@!&CIh7KNSfP-*TfM)SV!=8d7=-o+lQOI}V$M@cS@A%%`2mO)H zD}aoDhQIABrvUhyI>`{H#`!8Seg_ah&IA^xau%=h9QAoKrKWgr7r@jn01Alf3rX?; z+3h)bCPNh<{{S?^Q|dN&tXM|Z(*wh?eJoiHM5e#dnR3}HH+9Yxj(!^fm4iU#A*ZIg zKoxj^#J-dyKpv7RP`aPFjBrTqv(9J)a!`Qcp>#kxdY*Izc6gX(S=r0143rO*1D>$R zGZ}=HWvrwk0CO;Z1*sq?Hjb zZP-RYYR5T8_Rckx;Kd{ ztnjJrxM(WOKfyWK0KD04_8bc}eaALBJ)`R^n}$7j+VpkHHIcvM4uhU!H(_75yUvp9 z_(9i0{?yklecg3Uqr)WM{7?MNm6esxwP{1k?$D!}W{@U^|C+$)a=t2*M|Wd^o0CT0 z#~C1h@T(GK7RIIdSEYBu`Ne0Cqxr?7hc9pc^=0^z7Vf$+0N?QIJb7Ke$Dc90U`QgR z?|70JRvP>7MU}?U=F8o%vUyV3j4GR9@xi!sJ*?i`|0Js3Jo1lgVYPiyZAaC1SbQ`t zy&u+>_S;c?=|%bYv#{PeskfqfD=fChrD|BawZ9hCZoS}-7sA@sNo^~tZH2`j`vJ=dJ74``-obM|1q)NWWJin6s7oYZ37g36MN{5<`Xti-(ZeBFZl;*#{D)M6+<9?nlJ zD9Fi7PAtg;s?E(zF9NfQ_2c6+^D;}~6s7oYZ37g36MN{5<`Xti-(ZeBFZl;*#{D)M6+<9w$FO vJ~J<~BtBlRpz;@oO>TZlX-=wL5i8I_kdun}fy4)9Mn=XD3^1aI87Kw-Vq!R6 literal 0 HcmV?d00001 diff --git a/django-postgres/django_postgres/django_postgres/__pycache__/settings.cpython-311.pyc b/django-postgres/django_postgres/django_postgres/__pycache__/settings.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..64c167bb6de54b1a5a8df49a6bb68095c16f0da0 GIT binary patch literal 2778 zcmb7G&2!sC6qo!dJGSejPMUsD)E3%05Sg@T3k*|GY$Y{y>|i+!=pq#F+Syi?RIQve zI{64Q9Jq1ez;GzT^q(nAXPVI|Gn|;=pqbu!;>jP0$LS13mY#OszOVi5dr$r?olY`v zeL4HGwUuU=zkMK zqqLGi8FUI|(KP&K&}o$WIYwCJ6q-eIAUBK7^yz$`o+WHMqGZuIWg4AVX29oZcyj21 zGK=0(=Fml%$-k>D!ep)CXvq^=4k5L3ovs1uE0Sp!#(;`h;7zJJ!n0IzC-|Ff*uM_I< zX6txknt{L(CN{sT>0M0!k1rdy#vJ_}oNb=mbXB)5?UKdT?y|kN;HZ0dY#kZKuGa9_g*@lx29|`TX*f37 z7W%llrzg2xaC&}%8K_{xarP}t-7^!56jKUFpIqp`g4PC&bCVhloJ})05$aynEK4WN z{$U9)rh<6PD4Ir#w7m>uiKDh`t%LVW`%ymbE)Fer2tqpE(`+pC;UUhxAO|?XVEt&# zU7ieJ7_u;?FAsQQTKSVsAVE5&Ar$+s{}82iODF<)K=9s}=$(mJGyr@&4iV;n^$?OV z#mP;K;2l?9A3#2)b^8sQ0K6YP)S8c=hJ>$I16XTTP%LyzZz2_7K(2Fn5B?#&6|BQ)QjFj~t;y!eV(yf0NtUZhm6%N{3gY^eQFytdIO z*Q&BR+1`Xb+9p9}kFwm0Biz!uy5qhxi~(&Q<2dSyk99BJrP!uu+v7$|H~x{(|9O#H z%QtW2V_rt2gW{bQSmB#IF0vXK9o| zT_F`Z7eRwc+yvL66TsMYuuM8c*MgdQFpw~9_wL(TS|A#JEhbCqBnR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i.cpython-311.pyc b/django-postgres/django_postgres/django_postgres/__pycache__/wsgi.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a163e98a8bff9e2866a8aaa25c2c56345ceaf965 GIT binary patch literal 743 zcmZWn&ubGw6n?XtHoCPz#1@Z3=_O!xRXm9ZLTgB)=^+&*2%B|xvO8gRX4#pfO;0`e zH`uGEiu9jJr6BCZfG2N(-iiljyIqO;=I47e?|t8!H=kEmEzt67@^NsC0Dk03DV6KZ zMWi>!5I_$C6c`NkkX}t@#AeS#K+v$f37?iq=fyRs1WP9dz^NXEATWTKCt5izP0(8o zj4srd55HS)y3H2$1s~854@8QCp~pkvCPJz(B@!p87!qIEmeo?29B8{Xs)*pi(PPYe z&j|J;_HZnM5hD#o#)RRqm(r^v?!_d){l1qZjQXCUg7^D6-V2QuiHE?`&fCbmV zsl)@y$bBpcu_C1s`NVMo;Y+(=5oewjVi>*jK^{NW#PzwC^xsc3pBFzt)1tc=C0e_-rH++nqBwR?$+y<+lTl5c?DY%r6><&y_!{BS5tA_ z%n&lWU0k$%orj%=PfZP&RS6%{RPfBwjsY2XBc`&I1>`Sqku$q|r-{eJk%Ch{qM@)E z<)Z^fdU3*tY$OvE3GNgijj|@!`kxy8r{_fMWO8}qX;G19X-$LaKL_%yp5`V(Xl_(d zWe)jt2at7iGjB6^IQ_fN!1!Q&gSD@)HeI);4|dL=eGcs@v}d)AX>H@Iws~ILJX*