Skip to content

Commit

Permalink
feat(tests): add a test to ensure GET /raw endpoint reads NaN values
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinBelthle committed Aug 31, 2023
1 parent f3023c8 commit 2e78b63
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import shutil
from urllib.parse import urlencode

import numpy as np
import pytest
from antarest.core.utils.fastapi_sqlalchemy import db
from antarest.study.model import RawStudy, Study
Expand Down Expand Up @@ -112,3 +113,11 @@ def test_get_study(
)
res.raise_for_status()
assert res.json() == ["DE", "ES", "FR", "IT"]

# asserts that the GET /raw endpoint is able to read matrix containing NaN values
res = client.get(
f"/v1/studies/{study_id}/raw?path=output/20201014-1427eco/economy/mc-all/areas/de/id-monthly",
headers=headers,
)
assert res.status_code == 200
assert np.isnan(res.json()["data"][0]).any()

0 comments on commit 2e78b63

Please sign in to comment.