Commit Graph

35 Commits

Author SHA256 Message Date
f4lco 7c70ed61aa Handle variation in API response: offers can also be a hash 2020-10-20 21:13:31 +02:00
f4lco ecc23b9e6b Update Dockerfile to Python 3 (#7) 2020-04-23 17:41:50 +02:00
f4lco 45d49b515e Remove Python 2 from setup instructions (#7) 2020-04-23 17:41:50 +02:00
f4lco c957fc5b5e Fix exception type in test_retrieval (#7)
Using json.JSONDecodeError should replace using the 'message'
accessor of exceptions, which Python 3 removed.
This works as long as "simplejson" is not added as project
dependency, because "requests" gives preferential treatment to
simplejson, which ships its own version of JSONDecodeError.
2020-04-23 17:41:50 +02:00
f4lco 5d7eb5c4cb Fix str/unicode inconsistencies (#7) 2020-04-23 17:41:50 +02:00
f4lco d2837df10b Replace werkzeug.contrib.SimpleCache with cachetools (#7, fixes #12) 2020-04-23 17:41:35 +02:00
f4lco 5960dd2ebd Fix minor Python 3 renames and deprecations (#7) 2020-04-23 17:38:29 +02:00
f4lco 89d46ff9b3 Set Travis build to Python 3 (#7) 2020-04-23 17:38:20 +02:00
f4lco 5e1adf2ba4 Upgrade dependencies to Python 3 (#7) 2020-04-23 17:38:11 +02:00
f4lco e0079a537f Support empty menu response
In recent weeks many API calls return "null".
Instead of letting the request fail, the parser
now treats "null" as empty menu.
2020-03-28 21:12:17 +01:00
f4lco 0208bffb73 Show full output on test failure (including diff) 2020-03-28 21:09:44 +01:00
f4lco 342157e465 Add logging for response bodies (#11) 2019-12-28 17:36:44 +01:00
f4lco ad5b79ec64 Upgrade dependencies to fix security issues 2019-10-30 22:14:35 +01:00
f4lco 8d37c39821 Switch documentation theme to Alabaster 2019-10-30 21:43:50 +01:00
Falco Duersch c873ca4a29 Update documentation 2019-10-30 21:43:50 +01:00
Falco Duersch 221d1ab964 Cleanup: remove tiny 'canteen' module, document main entry points 2019-10-30 18:50:54 +01:00
f4lco 8edc5a0ced Set retrieval test result to XFAIL on invalid JSON (#6)
This increases build stability - in case we did not receive
valid JSON in the retrieval test, we cannot exercise the
parser at all.
Disadvantage: if the endpoint stops returning JSON, we will
never know.
2019-06-07 11:22:40 +02:00
f4lco 5ccbf57851 Repair debug entry point after using absolute imports
Using absolute imports broke the debug target due to
a Werkzeug bug:
https://github.com/pallets/werkzeug/issues/461
Solution is to avoid running Flask apps using
"python -m", and to use "flask run". This also
gets rid of the coverage exception for
"__main__.py".
2019-01-27 20:47:27 +01:00
f4lco b86284054f Add PyLint 2019-01-27 20:45:51 +01:00
f4lco 6ec0c010e5 Add pydocstyle 2019-01-27 19:41:46 +01:00
Falco Duersch 57c75b02e5 Integrate pycodestyle 2019-01-27 19:18:53 +01:00
f4lco 523cc8ba62 Add tests for Flask views 2019-01-27 18:57:41 +01:00
f4lco e4814cf8dc Improve resource loading: do not rely on correct working directory
Resources will now be loaded from an absolute path,
which was derived from the location of the current
module.
2019-01-27 18:57:41 +01:00
f4lco 30e239c5fe Exclude application init from coverage measurement (main, BASE_URL) 2019-01-27 18:57:41 +01:00
f4lco 7e5879a6ba Improve test target: enable branch coverage, additional HTML output 2019-01-27 18:57:41 +01:00
Falco Duersch 3f73916814 Set coverage threshold to 90% 2019-01-27 18:38:27 +01:00
f4lco fd1e4eb9c5 Upgrade itsdangerous to 1.1.0 (fixes #5)
itsdangerous in version 1.0.0 has been pulled
from PyPI, which lets dependeny resolution fail.

https://palletsprojects.com/blog/itsdangerous-1-1-0-released/

Library authors do not expected incompatible
changes.
2018-10-27 11:38:52 +02:00
Falco Duersch c5dcde37af Add Coveralls integration 2018-10-23 10:39:48 +02:00
Falco Duersch 8b09b81ba3 Enable retrieval test when executed through Travis cron job 2018-10-23 09:12:11 +02:00
Falco Duersch 8a84651fdc Setup Travis CI 2018-10-23 08:43:32 +02:00
Falco Duersch 472535d898 Fix retrieval test 2018-10-22 09:22:40 +02:00
Falco Duersch ce9da66d49 Removed unused variables in test code 2018-10-22 09:22:06 +02:00
Kai Fabian 5adf85ab65 feature/metafeeds: Support for canteen meta feeds and index feed (#2)
* feature/metafeeds: Restructured API, splitted menu and meta feed

* feature/metafeeds: add field 'key' to Canteen

* feature/metafeeds: added helper function for reverse urls

* feature/metafeeds: added menu feed url to meta feed

* feature/metafeeds: added missing test

(added: testing meta feed rendering in retrievaltest)

* feature/metafeeds: added feed index page

* whitespace fix

* feature/metafeeds: added alias urls

* feature/metafeeds: moved meta feed default url

* feature/metafeeds: moved index generation to views

* feature/metafeeds: inlined builder instance creation

* feature/metafeeds: removed unused 'menu' parameter

* feature/metafeeds: replaced 'reverse' module with Flask's url_for

* feature/metafeeds: removed unused import

* feature/metafeeds: removed unused function parameters

* feature/metafeeds: moved menu feed url generation to views.py

* feature/metafeeds: cleanup debug prints

removing debug prints that should never have been committed.
2018-10-22 09:16:14 +02:00
Kai Fabian 0653c75e43 Dockerfile for automated docker deployment (#1)
* Initial Dockerfile

* Dockerfile: install without caching in production

* dockerfile: added ARG/ENV for deployment dir

* dockerfile: removed unnecessary tinkering with PYTHONPATH

* dockerfile: added ARG/ENV for listening port

* dockerfile: added cleanup of tests and makefile

* dockerfile: added health check
2018-10-21 19:22:15 +02:00
Falco Duersch e0b88bbc87 OpenMensa parser for STW Potsdam after canteen website redesign 2018-09-19 17:32:49 +02:00