diff --git a/readme.md b/readme.md index a158069..51deeac 100644 --- a/readme.md +++ b/readme.md @@ -9,9 +9,9 @@ or with ldap support pip3 install --user ".[ldap]" -or if you want to use bjoern as the HTTP server: +or if you want to also run the tests: - pip3 install --user ".[ldap,bjoern]" + pip3 install --user ".[ldap,test]" #### Windows Same as above, but for mysql you have to follow this guide: @@ -19,7 +19,7 @@ Same as above, but for mysql you have to follow this guide: https://www.radishlogic.com/coding/python-3/installing-mysqldb-for-python-3-in-windows/ ### Configuration -1. Rename `flaschengeist.example.cfg` to `flaschengeist.cfg` +1. Rename `flaschengeist.example.toml` to `flaschengeist.toml` 2. Move it to either 1. the module path (where flaschegeist is installed) 2. `~/.config/` @@ -27,13 +27,24 @@ https://www.radishlogic.com/coding/python-3/installing-mysqldb-for-python-3-in-w 3. Change at least the database parameters ### Database installation - run_flaschengeist --install + run_flaschengeist install ### Run - run_flaschengeist + run_flaschengeist run or with debug messages: - run_flaschengeist --debug + run_flaschengeist run --debug + +## Tests + $ pip install '.[test]' + $ pytest +Run with coverage report: + + $ coverage run -m pytest + $ coverage report +Or with html output (open `htmlcov/index.html` in a browser): + + $ coverage html ## Development ### Code Style @@ -74,7 +85,7 @@ Or if you just want to use `git blame`, configure git like this: example_bp = Blueprint("example", __name__, url_prefix="/example") - permissions = {"EXAMPLE_HELLO": "example_hello"} + permissions = ["example_hello"] class PluginExample(Plugin): def __init__(self, conf): diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..6218c19 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,9 @@ +[bdist_wheel] +universal = True + +[tool:pytest] +testpaths = tests + +[coverage:run] +branch = True +source = flaschengeist \ No newline at end of file diff --git a/setup.py b/setup.py index 97d3100..d2c164b 100644 --- a/setup.py +++ b/setup.py @@ -21,7 +21,7 @@ setup( # Needed for python < 3.7 "backports-datetime-fromisoformat", ], - extras_require={"ldap": ["flask_ldapconn", "ldap3"], "tests": ["pytest"]}, + extras_require={"ldap": ["flask_ldapconn", "ldap3"], "test": ["pytest", "coverage"]}, entry_points={ "flaschengeist.plugin": [ # Authentication providers