https://github.com/bearddan2000/python-web-bottle-tdd-api-basic-auth-dolt-chained-sql-pop
Simple web app that serves an api for a bottle project using basic auth.
https://github.com/bearddan2000/python-web-bottle-tdd-api-basic-auth-dolt-chained-sql-pop
allure-pytest api auth basic bottle chained dolt pop pytest python response sql sqlalchemy tdd testify web
Last synced: 8 months ago
JSON representation
Simple web app that serves an api for a bottle project using basic auth.
- Host: GitHub
- URL: https://github.com/bearddan2000/python-web-bottle-tdd-api-basic-auth-dolt-chained-sql-pop
- Owner: bearddan2000
- Created: 2023-11-04T12:13:59.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-11-04T12:14:01.000Z (about 2 years ago)
- Last Synced: 2025-01-29T16:32:54.866Z (10 months ago)
- Topics: allure-pytest, api, auth, basic, bottle, chained, dolt, pop, pytest, python, response, sql, sqlalchemy, tdd, testify, web
- Language: Python
- Homepage: https://github.com/bearddan2000/python-web-bottle-tdd-api-basic-auth-dolt-chained-sql-pop
- Size: 10.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# python-web-bottle-tdd-api-basic-auth-dolt-chained-sql-pop
## Description
Simple web app that serves an api for a bottle project using basic auth.
Requires basic authentication for endpoints.
| username | password |
| ------- | -------- |
| *user* | *pass* |
Uses and replicate over 4 databases on the same server:
- beverage, the prod
- test_api, for remotely testing api by *testify*
- test_chained, tests strategy chained sql functions by *pytest*
- test_raw, tests strategy raw sql by *pytest*
*Note: test data should not be on same server as prod; only brevity made it necessary.*
Pytests are aggregated to a single folder, reports, and viewable with an allure server.
Uses sqlalchemy query a table `pop` using chained sql functions.
## Tech stack
- python
- bottle
- sqlalchemy
- pytest
- allure-pytest
- testify
- response
- dolt
## Docker stack
- python:latest
- dolthub/dolt-sql-serverdb
## To run
`sudo ./install.sh -u`
- Get all pops: http://localhost/pop
- Schema id, name, and color
- CRUD opperations
- Create: curl -i -X PUT localhost/pop/ -u 'user:pass'
- Read: http://localhost/pop/ -u 'user:pass'
- Update: curl -i -X POST localhost/pop/// -u 'user:pass'
- Delete: curl -i -X DELETE localhost/pop/ -u 'user:pass'
## To stop
`sudo ./install.sh -d`
## For help
`sudo ./install.sh -h`
## Credit
[Bottle sqlalchemy setup](https://github.com/iurisilvio/bottle-sqlalchemy/blob/master/examples/basic.py)