1
+ import pytest
2
+
1
3
from optimade .models import PartialDataResponse
4
+ from optimade .server .config import CONFIG
2
5
3
6
from ..utils import NoJsonEndpointTests
4
7
5
8
9
+ @pytest .mark .skipif (
10
+ CONFIG .database_backend .value not in ("mongomock" , "mongodb" ),
11
+ reason = "At the moment partial data is only supported for the MongoDB backend" ,
12
+ )
6
13
class TestPartialDataEndpoint (NoJsonEndpointTests ):
7
14
"""Tests for /partial_data/<entry_id>"""
8
15
@@ -12,6 +19,10 @@ class TestPartialDataEndpoint(NoJsonEndpointTests):
12
19
response_cls = PartialDataResponse
13
20
14
21
22
+ @pytest .mark .skipif (
23
+ CONFIG .database_backend .value not in ("mongomock" , "mongodb" ),
24
+ reason = "At the moment partial data is only supported for the MongoDB backend" ,
25
+ )
15
26
def test_property_ranges_link (get_good_response , client ):
16
27
test_id = "mpf_551"
17
28
params = "response_fields=cartesian_site_positions&property_ranges=dim_sites:2:74:1,dim_cartesian_dimensions:1:3:1&response_format=json"
@@ -21,9 +32,12 @@ def test_property_ranges_link(get_good_response, client):
21
32
) # todo expand test to check content better.
22
33
23
34
35
+ @pytest .mark .skipif (
36
+ CONFIG .database_backend .value not in ("mongomock" , "mongodb" ),
37
+ reason = "At the moment partial data is only supported for the MongoDB backend" ,
38
+ )
24
39
def test_wrong_id_partial_data (check_error_response , client ):
25
- """If a non-supported versioned base URL is passed, `553 Version Not Supported` should be returned
26
-
40
+ """
27
41
A specific JSON response should also occur.
28
42
"""
29
43
test_id = "mpf_486"
0 commit comments