11from __future__ import annotations
22
3- from unittest .mock import ANY
4-
53from dandischema .conf import get_instance_config
6- from django .conf import settings
7-
8- from dandiapi .api .views .info import get_schema_url
9-
10- from .fuzzy import Re
114
125
136def test_rest_info_instance_config_include_none (api_client ):
@@ -21,28 +14,3 @@ def test_rest_info_instance_config_include_none(api_client):
2114 resp .json ()['instance_config' ].keys ()
2215 == get_instance_config ().model_dump (mode = 'json' , exclude_none = False ).keys ()
2316 )
24-
25-
26- def test_rest_info (api_client ):
27- resp = api_client .get ('/api/info/' )
28- assert resp .status_code == 200
29-
30- # Get the expected schema URL
31- schema_url = get_schema_url ()
32-
33- resp_json = resp .json ()
34-
35- assert resp_json == {
36- 'instance_config' : ANY ,
37- 'schema_version' : settings .DANDI_SCHEMA_VERSION ,
38- 'schema_url' : schema_url ,
39- # Matches setuptools_scm's versioning scheme "no-guess-dev"
40- 'version' : Re (r'\d+\.\d+\.\d+(\.post1\.dev\d+\+g[0-9a-f]{7,}(\.d\d{8})?)?' ),
41- 'cli-minimal-version' : '0.60.0' ,
42- 'cli-bad-versions' : [],
43- 'services' : {
44- 'api' : {'url' : f'{ settings .DANDI_API_URL } /api' },
45- 'webui' : {'url' : settings .DANDI_WEB_APP_URL },
46- 'jupyterhub' : {'url' : settings .DANDI_JUPYTERHUB_URL },
47- },
48- }
0 commit comments