Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bearddan2000/python-web-bottle-tdd-api-basic-auth-mysql-raw-sql-simple
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-mysql-raw-sql-simple
allure-pytest api auth basic bottle mysql pytest python raw response simple sql sqlalchemy tdd testify web
Last synced: 21 days 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-mysql-raw-sql-simple
- Owner: bearddan2000
- Created: 2023-04-16T02:55:00.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-04-16T02:55:04.000Z (over 1 year ago)
- Last Synced: 2024-07-30T20:50:12.560Z (5 months ago)
- Topics: allure-pytest, api, auth, basic, bottle, mysql, pytest, python, raw, response, simple, sql, sqlalchemy, tdd, testify, web
- Language: Python
- Homepage: https://github.com/bearddan2000/python-web-bottle-tdd-api-basic-auth-mysql-raw-sql-simple
- 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-mysql-raw-sql-simple
## 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:
- animal, 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 `dog` using raw sql.
## Tech stack
- python
- bottle
- sqlalchemy
- pytest
- allure-pytest
- testify
- response
- mysql## Docker stack
- python:latest
- mariadb## To run
`sudo ./install.sh -u`
- Get all dogs: http://localhost/dog
- Schema id, breed, and color
- CRUD opperations
- Create: curl -i -X PUT localhost/dog/ -u 'user:pass'
- Read: http://localhost/dog/ -u 'user:pass'
- Update: curl -i -X POST localhost/dog/// -u 'user:pass'
- Delete: curl -i -X DELETE localhost/dog/ -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)