Handle closed-time typos from SWP API and update local dev setup (#32)
* updated dependencies, fixed "geschlossen" parsing * httpretty.core warning patch --------- Co-authored-by: Hadrian Burkhardt <hadrian.burkhardt@gmx.de>
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
import datetime as _dt
|
||||
|
||||
import httpretty.core as _httpretty_core
|
||||
|
||||
|
||||
class _PatchedDateTime(_dt.datetime):
|
||||
@classmethod
|
||||
def utcnow(cls):
|
||||
return _dt.datetime.now(_dt.UTC)
|
||||
|
||||
|
||||
def pytest_configure():
|
||||
_httpretty_core.datetime = _PatchedDateTime
|
||||
@@ -38,6 +38,10 @@ requires_online_api = pytest.mark.skipif(
|
||||
def test_retrieval(canteen):
|
||||
try:
|
||||
with app.app_context(), app.test_request_context():
|
||||
canteen_xml_feed(canteen.key)
|
||||
response = canteen_xml_feed(canteen.key)
|
||||
assert response.status_code == 200
|
||||
data = response.get_data(as_text=True)
|
||||
assert "<openmensa" in data
|
||||
assert "<canteen>" in data
|
||||
except json.JSONDecodeError:
|
||||
pytest.xfail('JSON endpoint returned garbage (issue #6)')
|
||||
|
||||
Reference in New Issue
Block a user