phe-sto / enthic

French societies accountability extraction and treatment by PapIT
https://api.enthic.fr/
Do What The F*ck You Want To Public License
8 stars 1 forks source link

Compute annual statistics test fail #34

Open phe-sto opened 3 years ago

phe-sto commented 3 years ago
 FAILED [ 38%]
AssertionError: WRONG HTTP RETURN CODE 500 INSTEAD OF 200
500 != 200
Expected :
200
Actual :
500
host = '127.0.0.1:5000', first_letters = 'aa'
@pytest.mark.parametrize("first_letters", LETTERS_COUPLE_LIST)
def test_compute_annual_statistics(host, first_letters):
"""
Test the /compute/ endpoint. Should return a JSON and RC 200.

:param host: Fixture of the API host.
:param first_letters: Filter to compute only on companies whose denomination begin with these letters.
"""
response = get("http://" + host + "/compute/" + first_letters)
>       assert response.status_code == 200, "WRONG HTTP RETURN CODE %s INSTEAD OF 200" % response.status_code
E AssertionError: WRONG HTTP RETURN CODE 500 INSTEAD OF 200
E assert 500 == 200
test_app.py:438: AssertionError

See complete test report attached Test Results — pytest in test_app.py.pdf

.

leonarf commented 3 years ago

These tests works with my local database, maybe because there is the table "annual_statistics" in it? Can you run only these tests and add the server output to the issue? pytest test_app.py -k test_compute_annual_statistics I have some local changes to reduce the duration for these tests that I'll add to my PR #39.