Class for autotests flask python apps
Install
pip install tester_flask
Usage in tests
from flask import Flask
from tester_flask import TestFlask
app = Flask(__name__)
@app.route('/', methods=['GET', 'POST'])
def main_page():
return "Flask OK"
@app.route('/redirect', methods=['POST'])
def redirect_page():
return redirect(url_for('main_page'))
class TestFlaskApp(TestFlask):
def setUp(self):
super(TestFlaskApp, self).setUp()
TestFlask.set_up(self, app)
def test_app(self):
assert self.simple_view('main_page').status_code == 200
assert self.param_post('main_page', {'hello': 1}, {'one': 1}).status_code == 200
response = self.simple_post('redirect_page', {'one': 1}, follow=False)
assert self.final_url(response) == self.get_url('main_page')
Development
git clone git@github.com:vb64/test.helper.flask.git
cd test.helper.flask
With Python 3
make setup PYTHON_BIN="/path/to/python3
make tests
With Python 2
make setup2 PYTHON_BIN="/path/to/python2
make tests2
Metadata
Release files for tester-flask 1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| tester_flask-1.2.tar.gz | 3.8 kB | Without provenance | Details for tester_flask-1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| tester_flask-1.2-py3-none-any.whl | Python 3 | none | any | Details for tester_flask-1.2-py3-none-any.whl |
Total release size: 7.8 kB
Release files / tester_flask-1.2.tar.gz
| Download URL | tester_flask-1.2.tar.gz |
|---|---|
| Size | 3.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ed8bfa63472d991abb56c8c112166040729bf609d432eaf37813aa1980b60695
|
|
BLAKE2b-256 checksum How to use checksums |
71e103952b87be892522e10ff2fa5f6635c19ca0405124c798a3606f887ea5a9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.3
|
Release files / tester_flask-1.2-py3-none-any.whl
| Download URL | tester_flask-1.2-py3-none-any.whl |
|---|---|
| Size | 4.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b67378c4be57811d2ca26c0c5acad5f31532b105b6c3291c19125f8fa598a76f
|
|
BLAKE2b-256 checksum How to use checksums |
654475ab9751d8fcb55392525942b9e713e141cb0e79d8a45e34dec05eaa56f0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.3
|
Security for tester-flask 1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.