AOSSIE-Org / AOSSIE-Org/EduAid

[BUG]: test_server.py crashes with JSONDecodeError due to outdated /get_answer endpoint

Offen
#451 3 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
bug
Vorherrschende Sprache
JavaScript
Sterne
171
Forks
425
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

### Bug Description

### Description:
Running the official test_server.py suite results in a JSONDecodeError during the test_get_answer() function.

Checking the Flask server logs reveals this is caused by a 404 Not Found error. The backend API endpoint in server.py was previously updated to /get_shortq_answer, but the test script was never updated to reflect this change and is still trying to hit the deprecated /get_answer route.

### Expected behavior:
The test_server.py script should point to the active /get_shortq_answer endpoint so the test suite can complete successfully without crashing.

### Proposed Solution:
I have tested the endpoint correction locally and the test suite passes 100%. I will open a Pull Request to fix this immediately.

### Logs and Screenshots

Image

File "D:\EduAid\backend\test_server.py", line 117, in
test_get_answer()
File "D:\EduAid\backend\test_server.py", line 87, in test_get_answer
response = make_post_request(endpoint, data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\EduAid\backend\test_server.py", line 109, in make_post_request
return response.json()

### Impact

Low - Minor inconvenience

### Code of Conduct

- [x] I have joined the [Discord server](https://discord.gg/hjUhu33uAn) and will post updates there
- [x] I have searched existing issues to avoid duplicates

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.