Skip to content

Commit

Permalink
Skip partial_data tests for elastic search for which it has not been …
Browse files Browse the repository at this point in the history
…implemented yet.
  • Loading branch information
JPBergsma committed Oct 19, 2023
1 parent e04387f commit bf29459
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions tests/server/routers/test_partial_data.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
import pytest

from optimade.models import PartialDataResponse
from optimade.server.config import CONFIG

from ..utils import NoJsonEndpointTests


@pytest.mark.skipif(
CONFIG.database_backend.value not in ("mongomock", "mongodb"),
reason="At the moment partial data is only supported for the MongoDB backend",
)
class TestPartialDataEndpoint(NoJsonEndpointTests):
"""Tests for /partial_data/<entry_id>"""

Expand All @@ -12,6 +19,10 @@ class TestPartialDataEndpoint(NoJsonEndpointTests):
response_cls = PartialDataResponse


@pytest.mark.skipif(
CONFIG.database_backend.value not in ("mongomock", "mongodb"),
reason="At the moment partial data is only supported for the MongoDB backend",
)
def test_property_ranges_link(get_good_response, client):
test_id = "mpf_551"
params = "response_fields=cartesian_site_positions&property_ranges=dim_sites:2:74:1,dim_cartesian_dimensions:1:3:1&response_format=json"
Expand All @@ -21,9 +32,12 @@ def test_property_ranges_link(get_good_response, client):
) # todo expand test to check content better.


@pytest.mark.skipif(
CONFIG.database_backend.value not in ("mongomock", "mongodb"),
reason="At the moment partial data is only supported for the MongoDB backend",
)
def test_wrong_id_partial_data(check_error_response, client):
"""If a non-supported versioned base URL is passed, `553 Version Not Supported` should be returned
"""
A specific JSON response should also occur.
"""
test_id = "mpf_486"
Expand Down

0 comments on commit bf29459

Please sign in to comment.