reimplemented openMensaFeedv2 and fixed linting

This commit is contained in:
Hadrian Burkhardt
2023-12-03 02:51:47 +01:00
committed by f4lco
parent 9e37940334
commit d637d71c8f
16 changed files with 632 additions and 598 deletions
+3 -3
View File
@@ -4,9 +4,8 @@ import json
import logging
import os
import pytest
from stw_potsdam.config import read_canteen_config
from stw_potsdam.views import canteen_xml_feed
from stw_potsdam.views import canteen_xml_feed, app
# pragma pylint: disable=invalid-name,redefined-outer-name
@@ -38,7 +37,8 @@ requires_online_api = pytest.mark.skipif(
@requires_online_api
def test_retrieval(canteen):
try:
canteen_xml_feed(canteen.key)
with app.app_context(), app.test_request_context():
canteen_xml_feed(canteen.key)
except json.JSONDecodeError as e:
pytest.xfail('JSON endpoint returned garbage (issue #6)')
raise e # Appease PyCharm inspection - xfail always raises