Fix integration test
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,30 @@
|
|||||||
|
sh*t
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="de" translate="no">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate, proxy-revalidate, max-age=0" />
|
||||||
|
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
|
||||||
|
<meta http-equiv="Expires" content="0" />
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
|
||||||
|
<meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0' name='viewport' />
|
||||||
|
<meta name="mobile-web-app-capable" content="yes">
|
||||||
|
<meta name="format-detection" content="telephone=no" />
|
||||||
|
<meta name="robots" content="noindex, nofollow" />
|
||||||
|
<link rel="shortcut icon" href="/favicon.gif" />
|
||||||
|
<link rel="icon" href="/favicon.gif" type="image/gif" />
|
||||||
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||||
|
<meta http-equiv="Content-Security-Policy" content="default-src 'self' 'unsafe-eval' https://*.konkaapps.de https://maps.googleapis.com https://* http://cdn.pushwoosh.com; font-src 'self' data: https://*.gstatic.com/; style-src 'self' blob: 'unsafe-inline' https://*.googleapis.com/; img-src 'self' https://*.konkaapps.de https://* data:">
|
||||||
|
<title>Webspeiseplan</title>
|
||||||
|
<script src="/bluebird.min.js"></script>
|
||||||
|
<link rel="stylesheet/less" href="/compressed.less?v=2.35.0" type="text/less" />
|
||||||
|
<script src="/less.min.js" type="text/javascript"></script>
|
||||||
|
<script src="https://cdn.polyfill.io/v3/polyfill.min.js"></script>
|
||||||
|
<link rel="manifest" href="manifest.json">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="modal-wrapper"></div>
|
||||||
|
<div id="app"></div>
|
||||||
|
<noscript>Bitte aktivieren Sie die Javascript unterstützung um fortzufahren.</noscript>
|
||||||
|
<script type="text/javascript" src="/vendors~main.23d6bc4b70a8a600f268.js"></script><script type="text/javascript" src="/main.b25ba5c971eb2b45f391.js"></script></body>
|
||||||
|
</html>
|
||||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,382 @@
|
|||||||
|
{
|
||||||
|
"success": true,
|
||||||
|
"content": [
|
||||||
|
{
|
||||||
|
"id": 128,
|
||||||
|
"name": "Pasta Theke togo",
|
||||||
|
"logoImage": null,
|
||||||
|
"reihenfolgeInApp": 14,
|
||||||
|
"titelNaehrwerte": null,
|
||||||
|
"gerichtkategorieID": 128,
|
||||||
|
"languageTypeID": 1,
|
||||||
|
"bildschirmeID": null,
|
||||||
|
"outletID": 10,
|
||||||
|
"benutzerID": 35,
|
||||||
|
"timestampLog": "2023-10-04T10:33:36"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 9,
|
||||||
|
"name": "ALT",
|
||||||
|
"logoImage": null,
|
||||||
|
"reihenfolgeInApp": 1,
|
||||||
|
"titelNaehrwerte": null,
|
||||||
|
"gerichtkategorieID": 9,
|
||||||
|
"languageTypeID": 1,
|
||||||
|
"bildschirmeID": null,
|
||||||
|
"outletID": null,
|
||||||
|
"benutzerID": 35,
|
||||||
|
"timestampLog": "2023-10-13T10:48:05"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 161,
|
||||||
|
"name": "Offer 1",
|
||||||
|
"logoImage": null,
|
||||||
|
"reihenfolgeInApp": 1,
|
||||||
|
"titelNaehrwerte": null,
|
||||||
|
"gerichtkategorieID": 153,
|
||||||
|
"languageTypeID": 2,
|
||||||
|
"bildschirmeID": 12,
|
||||||
|
"outletID": 10,
|
||||||
|
"benutzerID": 35,
|
||||||
|
"timestampLog": "2023-10-13T10:47:38"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 162,
|
||||||
|
"name": "Offer 2",
|
||||||
|
"logoImage": null,
|
||||||
|
"reihenfolgeInApp": 2,
|
||||||
|
"titelNaehrwerte": null,
|
||||||
|
"gerichtkategorieID": 154,
|
||||||
|
"languageTypeID": 2,
|
||||||
|
"bildschirmeID": 13,
|
||||||
|
"outletID": 10,
|
||||||
|
"benutzerID": 35,
|
||||||
|
"timestampLog": "2023-10-13T10:47:30"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 164,
|
||||||
|
"name": "Offer 4",
|
||||||
|
"logoImage": null,
|
||||||
|
"reihenfolgeInApp": 4,
|
||||||
|
"titelNaehrwerte": null,
|
||||||
|
"gerichtkategorieID": 155,
|
||||||
|
"languageTypeID": 2,
|
||||||
|
"bildschirmeID": 15,
|
||||||
|
"outletID": 10,
|
||||||
|
"benutzerID": 35,
|
||||||
|
"timestampLog": "2023-10-13T10:47:13"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 163,
|
||||||
|
"name": "Offer 3",
|
||||||
|
"logoImage": null,
|
||||||
|
"reihenfolgeInApp": 3,
|
||||||
|
"titelNaehrwerte": null,
|
||||||
|
"gerichtkategorieID": 156,
|
||||||
|
"languageTypeID": 2,
|
||||||
|
"bildschirmeID": 14,
|
||||||
|
"outletID": 10,
|
||||||
|
"benutzerID": 35,
|
||||||
|
"timestampLog": "2023-10-13T10:47:21"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 167,
|
||||||
|
"name": "Salad bar",
|
||||||
|
"logoImage": null,
|
||||||
|
"reihenfolgeInApp": 7,
|
||||||
|
"titelNaehrwerte": null,
|
||||||
|
"gerichtkategorieID": 102,
|
||||||
|
"languageTypeID": 2,
|
||||||
|
"bildschirmeID": 11,
|
||||||
|
"outletID": 10,
|
||||||
|
"benutzerID": 35,
|
||||||
|
"timestampLog": "2023-10-13T10:50:24"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 103,
|
||||||
|
"name": "Essen 1",
|
||||||
|
"logoImage": null,
|
||||||
|
"reihenfolgeInApp": 12,
|
||||||
|
"titelNaehrwerte": null,
|
||||||
|
"gerichtkategorieID": 103,
|
||||||
|
"languageTypeID": 1,
|
||||||
|
"bildschirmeID": null,
|
||||||
|
"outletID": 10,
|
||||||
|
"benutzerID": 35,
|
||||||
|
"timestampLog": "2023-10-04T10:29:54"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 168,
|
||||||
|
"name": "Hot Counter",
|
||||||
|
"logoImage": null,
|
||||||
|
"reihenfolgeInApp": 8,
|
||||||
|
"titelNaehrwerte": null,
|
||||||
|
"gerichtkategorieID": 231,
|
||||||
|
"languageTypeID": 2,
|
||||||
|
"bildschirmeID": 11,
|
||||||
|
"outletID": 10,
|
||||||
|
"benutzerID": 35,
|
||||||
|
"timestampLog": "2023-11-01T10:42:06"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 104,
|
||||||
|
"name": "Essen 2",
|
||||||
|
"logoImage": null,
|
||||||
|
"reihenfolgeInApp": 12,
|
||||||
|
"titelNaehrwerte": null,
|
||||||
|
"gerichtkategorieID": 104,
|
||||||
|
"languageTypeID": 1,
|
||||||
|
"bildschirmeID": null,
|
||||||
|
"outletID": 10,
|
||||||
|
"benutzerID": 35,
|
||||||
|
"timestampLog": "2023-10-04T10:30:08"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 105,
|
||||||
|
"name": "Essen 3",
|
||||||
|
"logoImage": null,
|
||||||
|
"reihenfolgeInApp": 12,
|
||||||
|
"titelNaehrwerte": null,
|
||||||
|
"gerichtkategorieID": 105,
|
||||||
|
"languageTypeID": 1,
|
||||||
|
"bildschirmeID": null,
|
||||||
|
"outletID": 10,
|
||||||
|
"benutzerID": 35,
|
||||||
|
"timestampLog": "2023-10-04T10:30:20"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 106,
|
||||||
|
"name": "Essen 4",
|
||||||
|
"logoImage": null,
|
||||||
|
"reihenfolgeInApp": 12,
|
||||||
|
"titelNaehrwerte": null,
|
||||||
|
"gerichtkategorieID": 106,
|
||||||
|
"languageTypeID": 1,
|
||||||
|
"bildschirmeID": null,
|
||||||
|
"outletID": 10,
|
||||||
|
"benutzerID": 35,
|
||||||
|
"timestampLog": "2023-10-04T10:30:30"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 165,
|
||||||
|
"name": "Special Offer",
|
||||||
|
"logoImage": null,
|
||||||
|
"reihenfolgeInApp": 5,
|
||||||
|
"titelNaehrwerte": null,
|
||||||
|
"gerichtkategorieID": 107,
|
||||||
|
"languageTypeID": 2,
|
||||||
|
"bildschirmeID": 13,
|
||||||
|
"outletID": 10,
|
||||||
|
"benutzerID": 30,
|
||||||
|
"timestampLog": "2023-10-16T15:31:18"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 299,
|
||||||
|
"name": "Hei\u00dfe Theke klein",
|
||||||
|
"logoImage": null,
|
||||||
|
"reihenfolgeInApp": 1,
|
||||||
|
"titelNaehrwerte": null,
|
||||||
|
"gerichtkategorieID": 299,
|
||||||
|
"languageTypeID": 1,
|
||||||
|
"bildschirmeID": null,
|
||||||
|
"outletID": 10,
|
||||||
|
"benutzerID": 300,
|
||||||
|
"timestampLog": "2023-11-23T10:05:01"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 166,
|
||||||
|
"name": "Daily Special",
|
||||||
|
"logoImage": null,
|
||||||
|
"reihenfolgeInApp": 6,
|
||||||
|
"titelNaehrwerte": null,
|
||||||
|
"gerichtkategorieID": 108,
|
||||||
|
"languageTypeID": 2,
|
||||||
|
"bildschirmeID": 13,
|
||||||
|
"outletID": 10,
|
||||||
|
"benutzerID": 30,
|
||||||
|
"timestampLog": "2023-10-16T15:31:53"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 300,
|
||||||
|
"name": "Hei\u00dfe Theke togo",
|
||||||
|
"logoImage": null,
|
||||||
|
"reihenfolgeInApp": 1,
|
||||||
|
"titelNaehrwerte": null,
|
||||||
|
"gerichtkategorieID": 300,
|
||||||
|
"languageTypeID": 1,
|
||||||
|
"bildschirmeID": null,
|
||||||
|
"outletID": 10,
|
||||||
|
"benutzerID": 300,
|
||||||
|
"timestampLog": "2023-11-23T10:05:01"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 169,
|
||||||
|
"name": "Dessert 1",
|
||||||
|
"logoImage": null,
|
||||||
|
"reihenfolgeInApp": 9,
|
||||||
|
"titelNaehrwerte": null,
|
||||||
|
"gerichtkategorieID": 109,
|
||||||
|
"languageTypeID": 2,
|
||||||
|
"bildschirmeID": 11,
|
||||||
|
"outletID": 10,
|
||||||
|
"benutzerID": 35,
|
||||||
|
"timestampLog": "2023-10-13T10:51:30"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 170,
|
||||||
|
"name": "Dessert 2",
|
||||||
|
"logoImage": null,
|
||||||
|
"reihenfolgeInApp": 10,
|
||||||
|
"titelNaehrwerte": null,
|
||||||
|
"gerichtkategorieID": 110,
|
||||||
|
"languageTypeID": 2,
|
||||||
|
"bildschirmeID": 11,
|
||||||
|
"outletID": 10,
|
||||||
|
"benutzerID": 35,
|
||||||
|
"timestampLog": "2023-10-13T10:51:50"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 111,
|
||||||
|
"name": "Hei\u00dfe Theke gro\u00df",
|
||||||
|
"logoImage": null,
|
||||||
|
"reihenfolgeInApp": 12,
|
||||||
|
"titelNaehrwerte": null,
|
||||||
|
"gerichtkategorieID": 111,
|
||||||
|
"languageTypeID": 1,
|
||||||
|
"bildschirmeID": 11,
|
||||||
|
"outletID": 10,
|
||||||
|
"benutzerID": 35,
|
||||||
|
"timestampLog": "2023-11-09T09:46:52"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 308,
|
||||||
|
"name": "Offer 1",
|
||||||
|
"logoImage": null,
|
||||||
|
"reihenfolgeInApp": 1,
|
||||||
|
"titelNaehrwerte": null,
|
||||||
|
"gerichtkategorieID": 241,
|
||||||
|
"languageTypeID": 2,
|
||||||
|
"bildschirmeID": null,
|
||||||
|
"outletID": 10,
|
||||||
|
"benutzerID": 35,
|
||||||
|
"timestampLog": "2023-11-29T11:20:02"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 309,
|
||||||
|
"name": "Offer 2",
|
||||||
|
"logoImage": null,
|
||||||
|
"reihenfolgeInApp": 2,
|
||||||
|
"titelNaehrwerte": null,
|
||||||
|
"gerichtkategorieID": 242,
|
||||||
|
"languageTypeID": 2,
|
||||||
|
"bildschirmeID": null,
|
||||||
|
"outletID": 10,
|
||||||
|
"benutzerID": 35,
|
||||||
|
"timestampLog": "2023-11-29T11:20:27"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 310,
|
||||||
|
"name": "Offer 3",
|
||||||
|
"logoImage": null,
|
||||||
|
"reihenfolgeInApp": 3,
|
||||||
|
"titelNaehrwerte": null,
|
||||||
|
"gerichtkategorieID": 243,
|
||||||
|
"languageTypeID": 2,
|
||||||
|
"bildschirmeID": null,
|
||||||
|
"outletID": 10,
|
||||||
|
"benutzerID": 35,
|
||||||
|
"timestampLog": "2023-11-29T11:20:46"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 311,
|
||||||
|
"name": "Offer 4",
|
||||||
|
"logoImage": null,
|
||||||
|
"reihenfolgeInApp": 4,
|
||||||
|
"titelNaehrwerte": null,
|
||||||
|
"gerichtkategorieID": 244,
|
||||||
|
"languageTypeID": 2,
|
||||||
|
"bildschirmeID": null,
|
||||||
|
"outletID": 10,
|
||||||
|
"benutzerID": 35,
|
||||||
|
"timestampLog": "2023-11-29T11:21:15"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 313,
|
||||||
|
"name": "Daily Special",
|
||||||
|
"logoImage": null,
|
||||||
|
"reihenfolgeInApp": 6,
|
||||||
|
"titelNaehrwerte": null,
|
||||||
|
"gerichtkategorieID": 245,
|
||||||
|
"languageTypeID": 2,
|
||||||
|
"bildschirmeID": null,
|
||||||
|
"outletID": 10,
|
||||||
|
"benutzerID": 35,
|
||||||
|
"timestampLog": "2023-11-29T11:22:05"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 314,
|
||||||
|
"name": "Hot Counter",
|
||||||
|
"logoImage": null,
|
||||||
|
"reihenfolgeInApp": 8,
|
||||||
|
"titelNaehrwerte": null,
|
||||||
|
"gerichtkategorieID": 246,
|
||||||
|
"languageTypeID": 2,
|
||||||
|
"bildschirmeID": null,
|
||||||
|
"outletID": 10,
|
||||||
|
"benutzerID": 35,
|
||||||
|
"timestampLog": "2023-11-29T11:22:33"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 312,
|
||||||
|
"name": "Special Offer",
|
||||||
|
"logoImage": null,
|
||||||
|
"reihenfolgeInApp": 5,
|
||||||
|
"titelNaehrwerte": null,
|
||||||
|
"gerichtkategorieID": 247,
|
||||||
|
"languageTypeID": 2,
|
||||||
|
"bildschirmeID": null,
|
||||||
|
"outletID": 10,
|
||||||
|
"benutzerID": 35,
|
||||||
|
"timestampLog": "2023-11-29T11:21:44"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 125,
|
||||||
|
"name": "Tagesgericht",
|
||||||
|
"logoImage": null,
|
||||||
|
"reihenfolgeInApp": 13,
|
||||||
|
"titelNaehrwerte": null,
|
||||||
|
"gerichtkategorieID": 125,
|
||||||
|
"languageTypeID": 1,
|
||||||
|
"bildschirmeID": null,
|
||||||
|
"outletID": 10,
|
||||||
|
"benutzerID": 35,
|
||||||
|
"timestampLog": "2023-10-04T10:32:47"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 126,
|
||||||
|
"name": "Pasta Theke gro\u00df",
|
||||||
|
"logoImage": null,
|
||||||
|
"reihenfolgeInApp": 14,
|
||||||
|
"titelNaehrwerte": null,
|
||||||
|
"gerichtkategorieID": 126,
|
||||||
|
"languageTypeID": 1,
|
||||||
|
"bildschirmeID": null,
|
||||||
|
"outletID": 10,
|
||||||
|
"benutzerID": 35,
|
||||||
|
"timestampLog": "2023-10-04T10:33:23"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 127,
|
||||||
|
"name": "Pasta Theke klein",
|
||||||
|
"logoImage": null,
|
||||||
|
"reihenfolgeInApp": 14,
|
||||||
|
"titelNaehrwerte": null,
|
||||||
|
"gerichtkategorieID": 127,
|
||||||
|
"languageTypeID": 1,
|
||||||
|
"bildschirmeID": null,
|
||||||
|
"outletID": 10,
|
||||||
|
"benutzerID": 35,
|
||||||
|
"timestampLog": "2023-10-04T10:33:29"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,70 @@
|
|||||||
|
{
|
||||||
|
"success": true,
|
||||||
|
"content": [
|
||||||
|
{
|
||||||
|
"id": 12,
|
||||||
|
"name": "Mensa Griebnitzsee",
|
||||||
|
"logoImage": "https:\\/\\/swp.konkaapps.de\\/kms-resources\\/outlet\\/SWP_OutletbildJPG.JPG",
|
||||||
|
"outletImage": null,
|
||||||
|
"reihenfolge": 5,
|
||||||
|
"outletRGBColor": null,
|
||||||
|
"oeffnungszeitenRichtext": null,
|
||||||
|
"moZeit1": "08:00 - 18:00 Uhr",
|
||||||
|
"moZeit2": null,
|
||||||
|
"diZeit1": "08:00 - 18:00 Uhr",
|
||||||
|
"diZeit2": null,
|
||||||
|
"miZeit1": "08:00 - 18:00 Uhr",
|
||||||
|
"miZeit2": null,
|
||||||
|
"doZeit1": "08:00 - 18:00 Uhr",
|
||||||
|
"doZeit2": null,
|
||||||
|
"frZeit1": "08:00 - 14:30 Uhr",
|
||||||
|
"frZeit2": null,
|
||||||
|
"saZeit1": "geschlossen",
|
||||||
|
"saZeit2": null,
|
||||||
|
"soZeit1": "geschlossen",
|
||||||
|
"soZeit2": null,
|
||||||
|
"adresseID": 12,
|
||||||
|
"kontaktID": 12,
|
||||||
|
"standortID": 9601,
|
||||||
|
"timestampLog": "2023-11-10T12:33:41",
|
||||||
|
"benutzerID": 30,
|
||||||
|
"outletHasMapposition": null,
|
||||||
|
"homepage": "www.studentenwerk-potsdam.de",
|
||||||
|
"addressInfo": {
|
||||||
|
"id": 12,
|
||||||
|
"additionalInfo": null,
|
||||||
|
"street": "August-Bebel-Stra\\u00dfe 89",
|
||||||
|
"city": "Potsdam",
|
||||||
|
"postalCode": "14482",
|
||||||
|
"countryName": "Deutschland",
|
||||||
|
"countryCode": "DE"
|
||||||
|
},
|
||||||
|
"contactInfo": [
|
||||||
|
{
|
||||||
|
"id": 12,
|
||||||
|
"contactPerson": "Mensaleitung",
|
||||||
|
"phone": "per mail",
|
||||||
|
"fax": null,
|
||||||
|
"email": "mensa-gs@studentenwerk-potsdam.de",
|
||||||
|
"role": null
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"positionInfo": {
|
||||||
|
"longitude": 13.129484554746579,
|
||||||
|
"latitude": 52.39324345
|
||||||
|
},
|
||||||
|
"linkInfo": [],
|
||||||
|
"assignedDishIds": [],
|
||||||
|
"assignedDishes": [],
|
||||||
|
"availableDishCategoryIds": [],
|
||||||
|
"availableDishCategories": [],
|
||||||
|
"availablePickupTimes": [],
|
||||||
|
"availableHolidays": [],
|
||||||
|
"availableOrderInfos": [],
|
||||||
|
"locationInfo": {
|
||||||
|
"id": 9601,
|
||||||
|
"name": "Griebnitzsee"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
File diff suppressed because one or more lines are too long
+65
-15
@@ -1,10 +1,9 @@
|
|||||||
# -*- encoding: utf-8 -*-
|
# -*- encoding: utf-8 -*-
|
||||||
import os
|
import os
|
||||||
|
import re
|
||||||
import httpretty
|
import httpretty
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from stw_potsdam.swp_webspeiseplan_api import SWPWebspeiseplanAPI
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def api_offline():
|
def api_offline():
|
||||||
@@ -21,22 +20,73 @@ def api_online_one_shot():
|
|||||||
|
|
||||||
Subsequent API invocations will return with HTTP status code 500.
|
Subsequent API invocations will return with HTTP status code 500.
|
||||||
"""
|
"""
|
||||||
# pylint: disable=unused-argument
|
|
||||||
def canned_menu(request, uri, response_headers):
|
|
||||||
path = os.path.join(os.path.dirname(__file__),
|
|
||||||
'resources', 'input.json')
|
|
||||||
|
|
||||||
with open(path, encoding='utf-8') as api_response:
|
def make_handler(filename):
|
||||||
return 200, response_headers, api_response.read()
|
path = os.path.join(
|
||||||
|
os.path.dirname(__file__),
|
||||||
|
'resources',
|
||||||
|
'integration-test',
|
||||||
|
filename,
|
||||||
|
)
|
||||||
|
|
||||||
responses = [
|
# pylint: disable=unused-argument
|
||||||
httpretty.Response(body=canned_menu),
|
def handle(request, uri, response_headers):
|
||||||
httpretty.Response(body='invalid', status=500),
|
with open(path, encoding='utf-8') as api_response:
|
||||||
]
|
return 200, response_headers, api_response.read()
|
||||||
|
|
||||||
httpretty.register_uri(httpretty.POST,
|
return handle
|
||||||
SWPWebspeiseplanAPI.URL_BASE,
|
|
||||||
responses=responses)
|
httpretty.register_uri(
|
||||||
|
httpretty.GET,
|
||||||
|
"https://swp.webspeiseplan.de",
|
||||||
|
responses=[
|
||||||
|
httpretty.Response(body=make_handler('index.html')),
|
||||||
|
httpretty.Response(body='invalid', status=500),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
|
||||||
|
httpretty.register_uri(
|
||||||
|
httpretty.GET,
|
||||||
|
'https://swp.webspeiseplan.de/main.b25ba5c971eb2b45f391.js',
|
||||||
|
responses=[
|
||||||
|
httpretty.Response(body=make_handler("snippet.js")),
|
||||||
|
])
|
||||||
|
|
||||||
|
httpretty.register_uri(
|
||||||
|
httpretty.GET,
|
||||||
|
re.compile(r'.*index.php.*model=outlet.*'),
|
||||||
|
match_querystring=True,
|
||||||
|
responses=[
|
||||||
|
httpretty.Response(body=make_handler('outlets.json')),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
|
||||||
|
httpretty.register_uri(
|
||||||
|
httpretty.GET,
|
||||||
|
re.compile(r'.*index.php.*model=location.*'),
|
||||||
|
match_querystring=True,
|
||||||
|
responses=[
|
||||||
|
httpretty.Response(body=make_handler('location.json')),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
|
||||||
|
httpretty.register_uri(
|
||||||
|
httpretty.GET,
|
||||||
|
re.compile(r'.*index.php.*model=menu.*'),
|
||||||
|
match_querystring=True,
|
||||||
|
responses=[
|
||||||
|
httpretty.Response(body=make_handler("menu.json")),
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
|
httpretty.register_uri(
|
||||||
|
httpretty.GET,
|
||||||
|
re.compile(r'.*index.php.*model=mealCategory.*'),
|
||||||
|
match_querystring=True,
|
||||||
|
responses=[
|
||||||
|
httpretty.Response(body=make_handler('meal_category.json')),
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
httpretty.enable(allow_net_connect=False)
|
httpretty.enable(allow_net_connect=False)
|
||||||
yield httpretty
|
yield httpretty
|
||||||
|
|||||||
+10
-14
@@ -7,6 +7,8 @@ from stw_potsdam import views
|
|||||||
# pragma pylint: disable=unused-import,redefined-outer-name,unused-argument
|
# pragma pylint: disable=unused-import,redefined-outer-name,unused-argument
|
||||||
from tests.stub_api import api_offline, api_online_one_shot
|
from tests.stub_api import api_offline, api_online_one_shot
|
||||||
|
|
||||||
|
from .response_util import meal_names
|
||||||
|
|
||||||
# Long test method names are not 'snake case'!
|
# Long test method names are not 'snake case'!
|
||||||
# See https://github.com/PyCQA/pylint/issues/2047
|
# See https://github.com/PyCQA/pylint/issues/2047
|
||||||
# The fix has not been ported to Python 2.x.
|
# The fix has not been ported to Python 2.x.
|
||||||
@@ -46,17 +48,13 @@ def test_canteen_menu_api_unavailable(client, api_offline):
|
|||||||
_request_check_meals(client)
|
_request_check_meals(client)
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.xfail(strict=True)
|
|
||||||
def test_canteen_menu_request(client, api_online_one_shot):
|
def test_canteen_menu_request(client, api_online_one_shot):
|
||||||
raise NotImplementedError()
|
_request_check_meals(client)
|
||||||
# _request_check_meals(client)
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.xfail(strict=True)
|
|
||||||
def test_canteen_menu_cached(client, api_online_one_shot):
|
def test_canteen_menu_cached(client, api_online_one_shot):
|
||||||
raise NotImplementedError()
|
_request_check_meals(client)
|
||||||
# _request_check_meals(client)
|
_request_check_meals(client)
|
||||||
# _request_check_meals(client)
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.xfail(strict=True)
|
@pytest.mark.xfail(strict=True)
|
||||||
@@ -66,14 +64,12 @@ def test_canteen_menu_second_request_indeed_fails(client, api_online_one_shot):
|
|||||||
_request_check_meals(client)
|
_request_check_meals(client)
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.xfail(strict=True)
|
|
||||||
def _request_check_meals(client):
|
def _request_check_meals(client):
|
||||||
raise NotImplementedError()
|
response = client.get('/canteens/griebnitzsee/xml')
|
||||||
# response = client.get("/canteens/griebnitzsee/xml")
|
|
||||||
# assert response.status_code == 200
|
assert response.status_code == 200
|
||||||
# meal = meal_names(response.data)[0]
|
meals = meal_names(response.data)
|
||||||
# print(meal)
|
assert "Rostbratwurst mit Sauerkraut und Salzkartoffeln" in meals
|
||||||
# assert meal == "Gefüllter Germknödel \nmit Vanillesauce und Mohnzucker"
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
|
|||||||
Reference in New Issue
Block a user