Skip to content

Commit

Permalink
updating readme.md
Browse files Browse the repository at this point in the history
  • Loading branch information
scottpickett committed Dec 19, 2022
1 parent 60dd039 commit 9a35b24
Showing 1 changed file with 25 additions and 22 deletions.
47 changes: 25 additions & 22 deletions flask/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,49 +4,52 @@

This is a simple and generic application intended as a Proof of Concept for:

- containerizing a fully functioning Python Flask application with the following features:

- a web page with a submission form to demo GET and POST functionality
- an API that:
- displays a response (GET)
- takes JSON data submission (POST)
- a "back-end" application that reverses the string representation of the submitted data,
and returns it to the "front-end".
- pre-created test architecture for TDD
- containerizing a fully functioning Python Flask application with the following features:
- a web page with a submission form to demo GET and POST functionality
- an API that:
- displays a response (GET)
- takes JSON data submission (POST)
- a "back-end" application that reverses the string representation of the submitted data, and returns it to the "front-end".
- pre-created test architecture for TDD

## Directories

```
flask
|---app
app.py <--- the main applicaiton file with the Flask views ("front-end")
server.py <--- the "back-end" application file with application functions
wsgi.py <--- the web server callable WSGI Python file to launch the Flask app
flask/
|---app/
app.py <--- the main applicaiton file with the Flask views ("front-end")
server.py <--- the "back-end" application file with application functions
wsgi.py <--- the web server callable WSGI Python file to launch the Flask app
|---static/ <--- directory for static front-end resources, like CSS files
|---templates/ <--- directory for HTML code
|---work_files/ <--- optional directory for writing out or reading in data
|---tests/ <--- directory containing all Python tests (see "tests" below)
|---coverage <--- directory containing coverage.py resources
.coveragerc <--- the configuration file for coverage.py
Dockerfile <--- contains all the commands to build the Flask container
requirements_flask.txt <--- requirements file for starting flask application
requirements.txt <--- requirements for use with a virtual environment, for testing etc
readme.md <--- this file
|---static <--- directory for static front-end resources, like CSS files
|---templates <--- directory for HTML code
|---work_files <--- optional directory for writing out or reading in data
|---tests <--- directory containing all Python tests (see "tests" below)
|---coverage <--- directory containing coverage.py resources
.coveragerc <--- the configuration file for coverage.py
```

## Tests

### Running unit tests

from flask/:
from ```flask/:```

```python3 -m pytest -r tests```

### Reviewing test coverage

from flask/:
from ```flask/:```

ASCII test coverage report:

```python3 -m pytest --cov-config=tests/coverage/.coveragerc --cov-branch --cov=app .```

HTML test coverage report:

```python3 -m pytest --cov-config=tests/coverage/.coveragerc --cov-report=html:tests/coverage/coverage_html --cov=app .```

### UI and API testing
Expand Down

0 comments on commit 9a35b24

Please sign in to comment.