From 5cfdb0eb26e4c3c2b087378c8b882c0eff0409af Mon Sep 17 00:00:00 2001 From: Akshay Date: Wed, 16 Dec 2020 20:01:13 +0530 Subject: add cart endpoints, rework testing files --- tests/json_data/add_user.json | 6 ------ tests/json_data/chair.json | 6 ------ tests/json_data/dumb_sofa.json | 4 ---- tests/json_data/smart_sofa.json | 6 ------ tests/product/chair.json | 6 ++++++ tests/product/dumb_sofa.json | 4 ++++ tests/product/smart_sofa.json | 6 ++++++ tests/requests.txt | 17 +++++++++++++++++ tests/users/add_akshay.json | 8 ++++++++ tests/users/add_user.json | 7 +++++++ 10 files changed, 48 insertions(+), 22 deletions(-) delete mode 100644 tests/json_data/add_user.json delete mode 100644 tests/json_data/chair.json delete mode 100644 tests/json_data/dumb_sofa.json delete mode 100644 tests/json_data/smart_sofa.json create mode 100644 tests/product/chair.json create mode 100644 tests/product/dumb_sofa.json create mode 100644 tests/product/smart_sofa.json create mode 100644 tests/requests.txt create mode 100644 tests/users/add_akshay.json create mode 100644 tests/users/add_user.json (limited to 'tests') diff --git a/tests/json_data/add_user.json b/tests/json_data/add_user.json deleted file mode 100644 index c7b2c15..0000000 --- a/tests/json_data/add_user.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "username": "Ramu Kaka", - "password": "ramu123", - "phone_number": "123454234", - "email_id": "ramu@kaka.com" -} diff --git a/tests/json_data/chair.json b/tests/json_data/chair.json deleted file mode 100644 index bb13c8b..0000000 --- a/tests/json_data/chair.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "Urban Ladder Teak Chair", - "kind": "Chair", - "price": 3500, - "description": "Sleek, modern chair for offices and workplaces" -} diff --git a/tests/json_data/dumb_sofa.json b/tests/json_data/dumb_sofa.json deleted file mode 100644 index 2b09a58..0000000 --- a/tests/json_data/dumb_sofa.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "Home Town Leather Sofa", - "price": 5400 -} diff --git a/tests/json_data/smart_sofa.json b/tests/json_data/smart_sofa.json deleted file mode 100644 index 5d7f7d4..0000000 --- a/tests/json_data/smart_sofa.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "Home Town Leather Sofa", - "kind": "Sofa", - "description": "Comfortable, authentic leather, wooden frame sofa, for living rooms", - "price": 5400 -} diff --git a/tests/product/chair.json b/tests/product/chair.json new file mode 100644 index 0000000..bb13c8b --- /dev/null +++ b/tests/product/chair.json @@ -0,0 +1,6 @@ +{ + "name": "Urban Ladder Teak Chair", + "kind": "Chair", + "price": 3500, + "description": "Sleek, modern chair for offices and workplaces" +} diff --git a/tests/product/dumb_sofa.json b/tests/product/dumb_sofa.json new file mode 100644 index 0000000..2b09a58 --- /dev/null +++ b/tests/product/dumb_sofa.json @@ -0,0 +1,4 @@ +{ + "name": "Home Town Leather Sofa", + "price": 5400 +} diff --git a/tests/product/smart_sofa.json b/tests/product/smart_sofa.json new file mode 100644 index 0000000..5d7f7d4 --- /dev/null +++ b/tests/product/smart_sofa.json @@ -0,0 +1,6 @@ +{ + "name": "Home Town Leather Sofa", + "kind": "Sofa", + "description": "Comfortable, authentic leather, wooden frame sofa, for living rooms", + "price": 5400 +} diff --git a/tests/requests.txt b/tests/requests.txt new file mode 100644 index 0000000..7e38905 --- /dev/null +++ b/tests/requests.txt @@ -0,0 +1,17 @@ +http POST :7878/user/login username=akshay password=password + +http POST :7878/user/login username=akshay password=nigga + +http POST :7878/user/change_password Cookie:user-login=mKT3PRPSKJp/AdsfPCXg3GICmQW2wViUwUKPpsXKp+70ug== old_password=nigga new_password=nigga + +http :7878/user/change_password username=akshay password=password + +http :7878/product/catalog + +http :7878/product/1 + +http POST :7878/cart/add Cookie:user-login=mKT3PRPSKJp/AdsfPCXg3GICmQW2wViUwUKPpsXKp+70ug== product_id:=1 + +http :7878/cart/items Cookie:user-login=mKT3PRPSKJp/AdsfPCXg3GICmQW2wViUwUKPpsXKp+70ug== + +http POST :7878/cart/remove Cookie: product_id:=1 diff --git a/tests/users/add_akshay.json b/tests/users/add_akshay.json new file mode 100644 index 0000000..1d6c405 --- /dev/null +++ b/tests/users/add_akshay.json @@ -0,0 +1,8 @@ + +{ + "username": "Akshay", + "password": "akshay", + "phone_number": "123454234", + "email_id": "aks@hay.com", + "address": "Rv College of Engineering, Mysuru Road, 560087, Near Metro station" +} diff --git a/tests/users/add_user.json b/tests/users/add_user.json new file mode 100644 index 0000000..1f481e9 --- /dev/null +++ b/tests/users/add_user.json @@ -0,0 +1,7 @@ +{ + "username": "Ramu Kaka", + "password": "ramu123", + "phone_number": "123454234", + "email_id": "ramu@kaka.com", + "address": "RA-602, Purva Riviera" +} -- cgit v1.2.3