diff --git a/backend/report.html b/backend/report.html index c92820f..2352bc0 100644 --- a/backend/report.html +++ b/backend/report.html @@ -328,7 +328,7 @@ div.media { </head> <body> <h1 id="title">Backend Testing Report</h1> - <p>Report generated on 23-Jan-2025 at 12:27:15 by <a href="https://pypi.python.org/pypi/pytest-html">pytest-html</a> + <p>Report generated on 23-Jan-2025 at 12:37:37 by <a href="https://pypi.python.org/pypi/pytest-html">pytest-html</a> v4.1.1</p> <div id="environment-header"> <h2>Environment</h2> @@ -382,7 +382,7 @@ div.media { <h2>Summary</h2> <div class="additional-summary prefix"> </div> - <p class="run-count">8 tests took 00:00:31.</p> + <p class="run-count">9 tests took 97 ms.</p> <p class="filter">(Un)check the boxes to filter the results.</p> <div class="summary__reload"> <div class="summary__reload__button hidden" onclick="location.reload()"> @@ -392,10 +392,10 @@ div.media { <div class="summary__spacer"></div> <div class="controls"> <div class="filters"> - <input checked="true" class="filter" name="filter_checkbox" type="checkbox" data-test-result="failed" /> - <span class="failed">2 Failed,</span> + <input checked="true" class="filter" name="filter_checkbox" type="checkbox" data-test-result="failed" disabled/> + <span class="failed">0 Failed,</span> <input checked="true" class="filter" name="filter_checkbox" type="checkbox" data-test-result="passed" /> - <span class="passed">6 Passed,</span> + <span class="passed">9 Passed,</span> <input checked="true" class="filter" name="filter_checkbox" type="checkbox" data-test-result="skipped" disabled/> <span class="skipped">0 Skipped,</span> <input checked="true" class="filter" name="filter_checkbox" type="checkbox" data-test-result="xfailed" disabled/> @@ -432,7 +432,7 @@ div.media { </table> </body> <footer> - <div id="data-container" data-jsonblob="{"environment": {"Python": "3.12.3", "Platform": "Linux-6.8.0-51-generic-x86_64-with-glibc2.39", "Packages": {"pytest": "8.3.4", "pluggy": "1.5.0"}, "Plugins": {"html": "4.1.1", "anyio": "4.8.0", "metadata": "3.1.1"}}, "tests": {"src/tests/test_main.py::test_turckheim": [{"extras": [], "result": "Passed", "testId": "src/tests/test_main.py::test_turckheim", "resultsTableRow": ["<td class=\"col-result\">Passed</td>", "<td class=\"col-testId\">src/tests/test_main.py::test_turckheim</td>", "<td>start (0 | 0) - 4 - Square Charles Grad (47 | 5) - 3 - Porte de France (157 | 5) - 5 - finish (0 | 0) - 0</td>", "<td>22 min</td>", "<td>20 min</td>", "<td class=\"col-duration\">100 ms</td>", "<td class=\"col-links\"></td>"], "log": "------------------------------ Captured log call -------------------------------\nINFO src.main:main.py:65 No end coordinates provided. Using start=end.\nINFO src.main:main.py:97 Fetched 5 landmarks in \t: 0.004 seconds\nINFO src.main:main.py:122 Total computation time\t: 0.028 seconds\nINFO src.main:main.py:127 Generated a trip of 22 minutes with 4 landmarks in 0.032 seconds.\nINFO httpx:_client.py:1025 HTTP Request: POST http://testserver/trip/new &quot;HTTP/1.1 200 OK&quot;\n\n"}], "src/tests/test_main.py::test_bellecour": [{"extras": [], "result": "Passed", "testId": "src/tests/test_main.py::test_bellecour", "resultsTableRow": ["<td class=\"col-result\">Passed</td>", "<td class=\"col-testId\">src/tests/test_main.py::test_bellecour</td>", "<td>start (0 | 0) - 5 - H\u00f4tel de l'Europe (191 | 5) - 4 - Palais archi\u00e9piscopal (191 | 5) - 1 - Cath\u00e9drale Saint-Jean (305 | 5) - 7 - \u00c9glise Saint-Georges (357 | 5) - 8 - Lugdunum Mus\u00e9e et Th\u00e9\u00e2tres Romains (210 | 5) - 3 - Temple de Cyb\u00e8le (325 | 5) - 7 - Chapelle Saint-Thomas (228 | 5) - 0 - Basilique de Fourvi\u00e8re (251 | 5) - 5 - Site historique de Lyon (364 | 5) - 3 - Mus\u00e9es Gadagne (401 | 5) - 15 - finish (0 | 0) - 0</td>", "<td>108 min</td>", "<td>120 min</td>", "<td class=\"col-duration\">00:00:07</td>", "<td class=\"col-links\"></td>"], "log": "------------------------------ Captured log call -------------------------------\nINFO src.main:main.py:65 No end coordinates provided. Using start=end.\nINFO src.main:main.py:97 Fetched 182 landmarks in \t: 0.043 seconds\nINFO src.main:main.py:122 Total computation time\t: 7.152 seconds\nINFO src.main:main.py:127 Generated a trip of 108 minutes with 12 landmarks in 7.196 seconds.\nINFO httpx:_client.py:1025 HTTP Request: POST http://testserver/trip/new &quot;HTTP/1.1 200 OK&quot;\n\n"}], "src/tests/test_main.py::test_cologne": [{"extras": [], "result": "Passed", "testId": "src/tests/test_main.py::test_cologne", "resultsTableRow": ["<td class=\"col-result\">Passed</td>", "<td class=\"col-testId\">src/tests/test_main.py::test_cologne</td>", "<td>start (0 | 0) - 4 - R\u00f6misch-Germanisches Museum (698 | 5) - 6 - Wallraf-Richartz-Museum & Foundation Corboud (490 | 5) - 5 - Gro\u00df St. Martin (512 | 5) - 11 - St. Maria Lyskirchen (512 | 5) - 4 - Deutsches Sport- und Olympiamuseum (535 | 5) - 6 - Trinitatiskirche (467 | 5) - 4 - St. Maria im Kapitol (490 | 5) - 6 - Duftmuseum im Farina-Haus (539 | 5) - 5 - Minoritenkirche (379 | 5) - 6 - AntoniterCityKirche (423 | 5) - 4 - St. C\u00e4cilien (423 | 5) - 6 - Oper der Stadt K\u00f6ln (465 | 5) - 6 - Kreissparkasse K\u00f6ln (539 | 5) - 2 - St. Aposteln (639 | 5) - 13 - St. Gereon (820 | 5) - 9 - St. Maria in der Kupfergasse (401 | 5) - 6 - Museum f\u00fcr Angewandte Kunst (514 | 5) - 5 - K\u00f6lner Dom (1141 | 5) - 3 - Excelsior Hotel Ernst (614 | 5) - 2 - St.Andreas (489 | 5) - 3 - St. Mari\u00e4 Himmelfahrt (401 | 5) - 2 - finish (0 | 0) - 0</td>", "<td>223 min</td>", "<td>240 min</td>", "<td class=\"col-duration\">00:00:02</td>", "<td class=\"col-links\"></td>"], "log": "------------------------------ Captured log call -------------------------------\nINFO src.main:main.py:65 No end coordinates provided. Using start=end.\nINFO src.main:main.py:97 Fetched 244 landmarks in \t: 0.064 seconds\nINFO src.main:main.py:122 Total computation time\t: 1.948 seconds\nINFO src.main:main.py:127 Generated a trip of 223 minutes with 23 landmarks in 2.012 seconds.\nINFO httpx:_client.py:1025 HTTP Request: POST http://testserver/trip/new &quot;HTTP/1.1 200 OK&quot;\n\n"}], "src/tests/test_main.py::test_strasbourg": [{"extras": [], "result": "Passed", "testId": "src/tests/test_main.py::test_strasbourg", "resultsTableRow": ["<td class=\"col-result\">Passed</td>", "<td class=\"col-testId\">src/tests/test_main.py::test_strasbourg</td>", "<td>start (0 | 0) - 7 - Aubette (305 | 30) - 3 - \u00c9glise protestante Saint-Pierre-le-Jeune (305 | 5) - 9 - Palais du Rhin (466 | 5) - 11 - Cath\u00e9drale Notre-Dame (564 | 5) - 8 - \u00c9glise Saint-Nicolas (266 | 5) - 6 - Circuit \u00ab Petite France \u00bb (364 | 5) - 7 - Tour des Fran\u00e7ais (174 | 5) - 2 - Barrage Vauban (344 | 5) - 7 - \u00c9glise protestante Sainte-Aur\u00e9lie (228 | 5) - 11 - \u00c9glise Catholique Saint-Jean-Baptiste (247 | 5) - 1 - finish (0 | 0) - 0</td>", "<td>147 min</td>", "<td>180 min</td>", "<td class=\"col-duration\">00:00:07</td>", "<td class=\"col-links\"></td>"], "log": "------------------------------ Captured log call -------------------------------\nINFO src.main:main.py:65 No end coordinates provided. Using start=end.\nINFO src.main:main.py:97 Fetched 118 landmarks in \t: 0.034 seconds\nINFO src.main:main.py:122 Total computation time\t: 7.084 seconds\nINFO src.main:main.py:127 Generated a trip of 147 minutes with 12 landmarks in 7.118 seconds.\nINFO httpx:_client.py:1025 HTTP Request: POST http://testserver/trip/new &quot;HTTP/1.1 200 OK&quot;\n\n"}], "src/tests/test_main.py::test_zurich": [{"extras": [], "result": "Failed", "testId": "src/tests/test_main.py::test_zurich", "resultsTableRow": ["<td class=\"col-result\">Failed</td>", "<td class=\"col-testId\">src/tests/test_main.py::test_zurich</td>", "<td>start (0 | 0) - 3 - Schweizerisches Landesmuseum (336 | 5) - 13 - Synagoge ICZ L\u00f6wenstrasse (207 | 5) - 6 - Augustinerkirche (210 | 5) - 5 - Fraum\u00fcnster (467 | 5) - 3 - Helmhaus (314 | 5) - 1 - Grossm\u00fcnster (425 | 5) - 5 - Kunsthaus (357 | 5) - 8 - Villa Hohenb\u00fchl (157 | 5) - 7 - Neuapostolische Kirche Z\u00fcrich-Hottingen (191 | 5) - 2 - Kulturama (190 | 5) - 28 - finish (0 | 0) - 0</td>", "<td>131 min</td>", "<td>180 min</td>", "<td class=\"col-duration\">00:00:08</td>", "<td class=\"col-links\"></td>"], "log": "client = &lt;starlette.testclient.TestClient object at 0x7433768d1520&gt;, request = &lt;FixtureRequest for &lt;Function test_zurich&gt;&gt;\n\n def test_zurich(client, request) : # pylint: disable=redefined-outer-name\n &quot;&quot;&quot;\n Test n\u00b02 : Custom test in Lyon centre to ensure proper decision making in crowded area.\n \n Args:\n client:\n request:\n &quot;&quot;&quot;\n start_time = time.time() # Start timer\n duration_minutes = 180\n \n response = client.post(\n &quot;/trip/new&quot;,\n json={\n &quot;preferences&quot;: {&quot;sightseeing&quot;: {&quot;type&quot;: &quot;sightseeing&quot;, &quot;score&quot;: 5},\n &quot;nature&quot;: {&quot;type&quot;: &quot;nature&quot;, &quot;score&quot;: 5},\n &quot;shopping&quot;: {&quot;type&quot;: &quot;shopping&quot;, &quot;score&quot;: 5},\n &quot;max_time_minute&quot;: duration_minutes,\n &quot;detour_tolerance_minute&quot;: 0},\n &quot;start&quot;: [47.377884227, 8.5395114066]\n }\n )\n result = response.json()\n landmarks = load_trip_landmarks(client, result[&#x27;first_landmark_uuid&#x27;])\n \n # Get computation time\n comp_time = time.time() - start_time\n \n # Add details to report\n log_trip_details(request, landmarks, result[&#x27;total_time&#x27;], duration_minutes)\n \n # for elem in landmarks :\n # print(elem)\n \n # checks :\n assert response.status_code == 200 # check for successful planning\n assert comp_time &lt; 30, f&quot;Computation time exceeded 30 seconds: {comp_time:.2f} seconds&quot;\n&gt; assert duration_minutes*0.8 &lt; result[&#x27;total_time&#x27;], f&quot;Trip too short: {result[&#x27;total_time&#x27;]} instead of {duration_minutes}&quot;\nE AssertionError: Trip too short: 131 instead of 180\nE assert (180 * 0.8) &lt; 131\n\nsrc/tests/test_main.py:221: AssertionError\n\n------------------------------ Captured log call -------------------------------\nINFO src.main:main.py:65 No end coordinates provided. Using start=end.\nINFO src.main:main.py:97 Fetched 133 landmarks in \t: 0.029 seconds\nINFO src.main:main.py:122 Total computation time\t: 8.261 seconds\nINFO src.main:main.py:127 Generated a trip of 131 minutes with 12 landmarks in 8.29 seconds.\nINFO httpx:_client.py:1025 HTTP Request: POST http://testserver/trip/new &quot;HTTP/1.1 200 OK&quot;\n\n"}], "src/tests/test_main.py::test_paris": [{"extras": [], "result": "Passed", "testId": "src/tests/test_main.py::test_paris", "resultsTableRow": ["<td class=\"col-result\">Passed</td>", "<td class=\"col-testId\">src/tests/test_main.py::test_paris</td>", "<td>start (0 | 0) - 21 - \u00c9glise Saint-Eug\u00e8ne Sainte-C\u00e9cile (674 | 5) - 21 - \u00c9glise Saint-Leu - Saint-Gilles (423 | 5) - 6 - Centre Georges Pompidou (865 | 5) - 3 - \u00c9glise Saint-Merri (466 | 5) - 13 - Square Jean XXIII (367 | 5) - 6 - \u00c9glise Saint-Nicolas du Chardonnet (512 | 5) - 7 - Cath\u00e9drale Notre-Dame de Paris (1138 | 5) - 10 - Tour Saint-Jacques (614 | 5) - 7 - Sainte-Chapelle (1138 | 5) - 1 - Palais de Justice de Paris (467 | 5) - 9 - \u00c9glise Saint-Germain l'Auxerrois (512 | 5) - 8 - Pyramide du Louvre (490 | 5) - 3 - Tunnel des Tuileries (445 | 5) - 10 - Mus\u00e9e d'Orsay (890 | 5) - 7 - Jardin des Tuileries (661 | 5) - 18 - Op\u00e9ra Garnier (466 | 5) - 13 - \u00c9glise Saint-Roch (490 | 5) - 8 - Palais du Louvre (690 | 5) - 1 - Mus\u00e9e du Louvre (698 | 5) - 5 - Temple de l'Oratoire du Louvre (651 | 5) - 4 - Bourse de Commerce \u2014 Pinault Collection (627 | 5) - 5 - finish (0 | 0) - 0</td>", "<td>291 min</td>", "<td>300 min</td>", "<td class=\"col-duration\">00:00:03</td>", "<td class=\"col-links\"></td>"], "log": "------------------------------ Captured log call -------------------------------\nINFO src.main:main.py:65 No end coordinates provided. Using start=end.\nINFO src.main:main.py:97 Fetched 363 landmarks in \t: 0.075 seconds\nINFO src.main:main.py:122 Total computation time\t: 3.158 seconds\nINFO src.main:main.py:127 Generated a trip of 291 minutes with 23 landmarks in 3.234 seconds.\nINFO httpx:_client.py:1025 HTTP Request: POST http://testserver/trip/new &quot;HTTP/1.1 200 OK&quot;\n\n"}], "src/tests/test_main.py::test_new_york": [{"extras": [], "result": "Failed", "testId": "src/tests/test_main.py::test_new_york", "resultsTableRow": ["<td class=\"col-result\">Failed</td>", "<td class=\"col-testId\">src/tests/test_main.py::test_new_york</td>", "<td>start (0 | 0) - 6 - St. George's Church (344 | 5) - 5 - Saint Mark's in-the-Bowery (490 | 5) - 12 - Union Square Park (482 | 5) - 8 - Calvary Church (357 | 5) - 6 - Flatiron Building (604 | 5) - 3 - Madison Square Park (482 | 5) - 4 - Cathedral of St. Sava (401 | 5) - 26 - Stonewall Inn State Historic Site (357 | 5) - 3 - St. Joseph's Church (364 | 5) - 16 - New York City Fire Museum (357 | 5) - 6 - Duarte Square (512 | 5) - 1 - Albert Capsouto Park (339 | 5) - 4 - Tribeca Park (386 | 5) - 10 - Collect Pond Park (412 | 5) - 3 - Thomas Paine Park (334 | 5) - 3 - Columbus Park (482 | 5) - 2 - Church of the Transfiguration (325 | 5) - 4 - Mariners Temple (336 | 5) - 12 - Capitale (627 | 5) - 8 - New Museum (314 | 5) - 4 - Saint Patrick's Old Cathedral (379 | 5) - 7 - finish (0 | 0) - 0</td>", "<td>258 min</td>", "<td>600 min</td>", "<td class=\"col-duration\">00:00:03</td>", "<td class=\"col-links\"></td>"], "log": "client = &lt;starlette.testclient.TestClient object at 0x7433768d1520&gt;\nrequest = &lt;FixtureRequest for &lt;Function test_new_york&gt;&gt;\n\n def test_new_york(client, request) : # pylint: disable=redefined-outer-name\n &quot;&quot;&quot;\n Test n\u00b02 : Custom test in New York (les Halles) centre to ensure proper decision making in crowded area.\n \n Args:\n client:\n request:\n &quot;&quot;&quot;\n start_time = time.time() # Start timer\n duration_minutes = 600\n \n response = client.post(\n &quot;/trip/new&quot;,\n json={\n &quot;preferences&quot;: {&quot;sightseeing&quot;: {&quot;type&quot;: &quot;sightseeing&quot;, &quot;score&quot;: 5},\n &quot;nature&quot;: {&quot;type&quot;: &quot;nature&quot;, &quot;score&quot;: 5},\n &quot;shopping&quot;: {&quot;type&quot;: &quot;shopping&quot;, &quot;score&quot;: 5},\n &quot;max_time_minute&quot;: duration_minutes,\n &quot;detour_tolerance_minute&quot;: 0},\n &quot;start&quot;: [40.72592726802, -73.9920434795]\n }\n )\n result = response.json()\n landmarks = load_trip_landmarks(client, result[&#x27;first_landmark_uuid&#x27;])\n \n # Get computation time\n comp_time = time.time() - start_time\n \n # Add details to report\n log_trip_details(request, landmarks, result[&#x27;total_time&#x27;], duration_minutes)\n \n # for elem in landmarks :\n # print(elem)\n \n # checks :\n assert response.status_code == 200 # check for successful planning\n assert comp_time &lt; 30, f&quot;Computation time exceeded 30 seconds: {comp_time:.2f} seconds&quot;\n&gt; assert duration_minutes*0.8 &lt; result[&#x27;total_time&#x27;], f&quot;Trip too short: {result[&#x27;total_time&#x27;]} instead of {duration_minutes}&quot;\nE AssertionError: Trip too short: 258 instead of 600\nE assert (600 * 0.8) &lt; 258\n\nsrc/tests/test_main.py:303: AssertionError\n\n------------------------------ Captured log call -------------------------------\nINFO src.main:main.py:65 No end coordinates provided. Using start=end.\nINFO src.main:main.py:97 Fetched 211 landmarks in \t: 0.034 seconds\nINFO src.main:main.py:122 Total computation time\t: 2.466 seconds\nINFO src.main:main.py:127 Generated a trip of 258 minutes with 23 landmarks in 2.5 seconds.\nINFO httpx:_client.py:1025 HTTP Request: POST http://testserver/trip/new &quot;HTTP/1.1 200 OK&quot;\n\n"}], "src/tests/test_main.py::test_shopping": [{"extras": [], "result": "Passed", "testId": "src/tests/test_main.py::test_shopping", "resultsTableRow": ["<td class=\"col-result\">Passed</td>", "<td class=\"col-testId\">src/tests/test_main.py::test_shopping</td>", "<td>start (0 | 0) - 5 - Grand H\u00f4tel-Dieu (423 | 30) - 8 - Shopping Area (538 | 40) - 4 - Grand Bazar (93 | 30) - 20 - Halles de Lyon Paul Bocuse (210 | 30) - 8 - Westfield La Part-Dieu (423 | 30) - 32 - finish (0 | 0) - 0</td>", "<td>237 min</td>", "<td>240 min</td>", "<td class=\"col-duration\">422 ms</td>", "<td class=\"col-links\"></td>"], "log": "----------------------------- Captured stdout call -----------------------------\nLandmark(start): [start @(45.7576485, 4.8330241), score=0, time_to_next=5]\nLandmark(shopping): [Grand H\u00f4tel-Dieu @(45.7586955, 4.8364597), score=423, time_to_next=8]\nLandmark(shopping): [Shopping Area @(np.float64(45.76223053940519), np.float64(4.833794685873603)), score=538, time_to_next=4]\nLandmark(shopping): [Grand Bazar @(45.7632141, 4.8361975), score=93, time_to_next=20]\nLandmark(shopping): [Halles de Lyon Paul Bocuse @(45.7628282, 4.8505601), score=210, time_to_next=8]\nLandmark(shopping): [Westfield La Part-Dieu @(45.761331, 4.855676), score=423, time_to_next=32]\nLandmark(finish): [finish @(45.7576485, 4.8330241), score=0]\n\n------------------------------ Captured log call -------------------------------\nINFO src.main:main.py:65 No end coordinates provided. Using start=end.\nINFO src.main:main.py:97 Fetched 7 landmarks in \t: 0.01 seconds\nINFO src.main:main.py:122 Total computation time\t: 0.407 seconds\nINFO src.main:main.py:127 Generated a trip of 237 minutes with 7 landmarks in 0.416 seconds.\nINFO httpx:_client.py:1025 HTTP Request: POST http://testserver/trip/new &quot;HTTP/1.1 200 OK&quot;\n\n"}]}, "renderCollapsed": ["passed"], "initialSort": "result", "title": "Backend Testing Report"}"></div> + <div id="data-container" data-jsonblob="{"environment": {"Python": "3.12.3", "Platform": "Linux-6.8.0-51-generic-x86_64-with-glibc2.39", "Packages": {"pytest": "8.3.4", "pluggy": "1.5.0"}, "Plugins": {"html": "4.1.1", "anyio": "4.8.0", "metadata": "3.1.1"}}, "tests": {"src/tests/test_toilets.py::test_invalid_input[location0-None-422]": [{"extras": [], "result": "Passed", "testId": "src/tests/test_toilets.py::test_invalid_input[location0-None-422]", "resultsTableRow": ["<td class=\"col-result\">Passed</td>", "<td class=\"col-testId\">src/tests/test_toilets.py::test_invalid_input[location0-None-422]</td>", "<td>N/A</td>", "<td>N/A</td>", "<td>N/A</td>", "<td class=\"col-duration\">71 ms</td>", "<td class=\"col-links\"></td>"], "log": "------------------------------ Captured log call -------------------------------\nINFO httpx:_client.py:1025 HTTP Request: POST http://testserver/toilets/new?location=%7B%7D&amp;radius= &quot;HTTP/1.1 422 Unprocessable Entity&quot;\n\n"}], "src/tests/test_toilets.py::test_invalid_input[location1-None-422]": [{"extras": [], "result": "Passed", "testId": "src/tests/test_toilets.py::test_invalid_input[location1-None-422]", "resultsTableRow": ["<td class=\"col-result\">Passed</td>", "<td class=\"col-testId\">src/tests/test_toilets.py::test_invalid_input[location1-None-422]</td>", "<td>N/A</td>", "<td>N/A</td>", "<td>N/A</td>", "<td class=\"col-duration\">3 ms</td>", "<td class=\"col-links\"></td>"], "log": "------------------------------ Captured log call -------------------------------\nINFO httpx:_client.py:1025 HTTP Request: POST http://testserver/toilets/new?location=443&amp;radius= &quot;HTTP/1.1 422 Unprocessable Entity&quot;\n\n"}], "src/tests/test_toilets.py::test_invalid_input[location2-None-422]": [{"extras": [], "result": "Passed", "testId": "src/tests/test_toilets.py::test_invalid_input[location2-None-422]", "resultsTableRow": ["<td class=\"col-result\">Passed</td>", "<td class=\"col-testId\">src/tests/test_toilets.py::test_invalid_input[location2-None-422]</td>", "<td>N/A</td>", "<td>N/A</td>", "<td>N/A</td>", "<td class=\"col-duration\">3 ms</td>", "<td class=\"col-links\"></td>"], "log": "------------------------------ Captured log call -------------------------------\nINFO httpx:_client.py:1025 HTTP Request: POST http://testserver/toilets/new?location=443&amp;location=433&amp;radius= &quot;HTTP/1.1 422 Unprocessable Entity&quot;\n\n"}], "src/tests/test_toilets.py::test_no_toilets[location0-200]": [{"extras": [], "result": "Passed", "testId": "src/tests/test_toilets.py::test_no_toilets[location0-200]", "resultsTableRow": ["<td class=\"col-result\">Passed</td>", "<td class=\"col-testId\">src/tests/test_toilets.py::test_no_toilets[location0-200]</td>", "<td>N/A</td>", "<td>N/A</td>", "<td>N/A</td>", "<td class=\"col-duration\">3 ms</td>", "<td class=\"col-links\"></td>"], "log": "------------------------------ Captured log call -------------------------------\nINFO httpx:_client.py:1025 HTTP Request: POST http://testserver/toilets/new?location=48.227&amp;location=7.437 &quot;HTTP/1.1 200 OK&quot;\n\n"}], "src/tests/test_toilets.py::test_no_toilets[location1-200]": [{"extras": [], "result": "Passed", "testId": "src/tests/test_toilets.py::test_no_toilets[location1-200]", "resultsTableRow": ["<td class=\"col-result\">Passed</td>", "<td class=\"col-testId\">src/tests/test_toilets.py::test_no_toilets[location1-200]</td>", "<td>N/A</td>", "<td>N/A</td>", "<td>N/A</td>", "<td class=\"col-duration\">3 ms</td>", "<td class=\"col-links\"></td>"], "log": "------------------------------ Captured log call -------------------------------\nINFO httpx:_client.py:1025 HTTP Request: POST http://testserver/toilets/new?location=10.2012&amp;location=10.123 &quot;HTTP/1.1 200 OK&quot;\n\n"}], "src/tests/test_toilets.py::test_no_toilets[location2-200]": [{"extras": [], "result": "Passed", "testId": "src/tests/test_toilets.py::test_no_toilets[location2-200]", "resultsTableRow": ["<td class=\"col-result\">Passed</td>", "<td class=\"col-testId\">src/tests/test_toilets.py::test_no_toilets[location2-200]</td>", "<td>N/A</td>", "<td>N/A</td>", "<td>N/A</td>", "<td class=\"col-duration\">3 ms</td>", "<td class=\"col-links\"></td>"], "log": "------------------------------ Captured log call -------------------------------\nINFO httpx:_client.py:1025 HTTP Request: POST http://testserver/toilets/new?location=63.989&amp;location=-19.677 &quot;HTTP/1.1 200 OK&quot;\n\n"}], "src/tests/test_toilets.py::test_toilets[location0-200]": [{"extras": [], "result": "Passed", "testId": "src/tests/test_toilets.py::test_toilets[location0-200]", "resultsTableRow": ["<td class=\"col-result\">Passed</td>", "<td class=\"col-testId\">src/tests/test_toilets.py::test_toilets[location0-200]</td>", "<td>N/A</td>", "<td>N/A</td>", "<td>N/A</td>", "<td class=\"col-duration\">4 ms</td>", "<td class=\"col-links\"></td>"], "log": "------------------------------ Captured log call -------------------------------\nINFO httpx:_client.py:1025 HTTP Request: POST http://testserver/toilets/new?location=45.7576485&amp;location=4.8330241&amp;radius=600 &quot;HTTP/1.1 200 OK&quot;\n\n"}], "src/tests/test_toilets.py::test_toilets[location1-200]": [{"extras": [], "result": "Passed", "testId": "src/tests/test_toilets.py::test_toilets[location1-200]", "resultsTableRow": ["<td class=\"col-result\">Passed</td>", "<td class=\"col-testId\">src/tests/test_toilets.py::test_toilets[location1-200]</td>", "<td>N/A</td>", "<td>N/A</td>", "<td>N/A</td>", "<td class=\"col-duration\">4 ms</td>", "<td class=\"col-links\"></td>"], "log": "------------------------------ Captured log call -------------------------------\nINFO httpx:_client.py:1025 HTTP Request: POST http://testserver/toilets/new?location=-6.913795&amp;location=107.60278&amp;radius=600 &quot;HTTP/1.1 200 OK&quot;\n\n"}], "src/tests/test_toilets.py::test_toilets[location2-200]": [{"extras": [], "result": "Passed", "testId": "src/tests/test_toilets.py::test_toilets[location2-200]", "resultsTableRow": ["<td class=\"col-result\">Passed</td>", "<td class=\"col-testId\">src/tests/test_toilets.py::test_toilets[location2-200]</td>", "<td>N/A</td>", "<td>N/A</td>", "<td>N/A</td>", "<td class=\"col-duration\">4 ms</td>", "<td class=\"col-links\"></td>"], "log": "------------------------------ Captured log call -------------------------------\nINFO httpx:_client.py:1025 HTTP Request: POST http://testserver/toilets/new?location=-22.97014&amp;location=-43.18181&amp;radius=600 &quot;HTTP/1.1 200 OK&quot;\n\n"}]}, "renderCollapsed": ["passed"], "initialSort": "result", "title": "Backend Testing Report"}"></div> <script> (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){ const { getCollapsedCategory, setCollapsedIds } = require('./storage.js') diff --git a/backend/src/utils/toilets_manager.py b/backend/src/utils/toilets_manager.py index 5cc3b2b..11f3d52 100644 --- a/backend/src/utils/toilets_manager.py +++ b/backend/src/utils/toilets_manager.py @@ -40,7 +40,7 @@ class ToiletsManager: self.radius = radius self.location = location - CachingStrategy.use('XML', cacheDir=OSM_CACHE_DIR) + CachingStrategy.use('XML', cache_dir=OSM_CACHE_DIR) def generate_toilet_list(self) -> list[Toilets] : @@ -52,14 +52,14 @@ class ToiletsManager: list[Toilets]: A list of `Toilets` objects containing detailed information about the toilets found around the given coordinates. """ - bbox = tuple((f"around:{self.radius}", str(self.location[0]), str(self.location[1]))) + bbox = tuple((self.radius, self.location[0], self.location[1])) osm_types = ['node', 'way', 'relation'] toilets_list = [] query = build_query( area = bbox, element_types = osm_types, - selector = ['"amenity"="toilets"'], + selector = '"amenity"="toilets"', out = 'ids center tags' ) self.logger.debug(f"Query: {query}") @@ -118,17 +118,17 @@ class ToiletsManager: # Extract tags as a dictionary tags = {tag.get('k'): tag.get('v') for tag in elem.findall('tag')} - if 'wheelchair' in tags().keys() and tags['wheelchair'] == 'yes': + if 'wheelchair' in tags.keys() and tags['wheelchair'] == 'yes': toilets.wheelchair = True - if 'changing_table' in tags().keys() and tags['changing_table'] == 'yes': + if 'changing_table' in tags.keys() and tags['changing_table'] == 'yes': toilets.changing_table = True - if 'fee' in tags().keys() and tags['fee'] == 'yes': + if 'fee' in tags.keys() and tags['fee'] == 'yes': toilets.fee = True - if 'opening_hours' in tags().keys() : - toilets.opening_hours = elem.tag('opening_hours') + if 'opening_hours' in tags.keys() : + toilets.opening_hours = tags['opening_hours'] toilets_list.append(toilets)