Skip to content

Commit 119833b

Browse files
committed
Ensure tests always use the latest UUID (#42).
1 parent b2da689 commit 119833b

1 file changed

Lines changed: 18 additions & 5 deletions

File tree

tests/utility.py

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,28 @@
11
import requests
2+
from tools.portal_maps import ENDPOINTS, latest_maps
23

3-
END_POINT = 'https://mapcore-demo.org/devel/flatmap/v4/competency/query'
4+
END_POINT = ENDPOINTS['development']
5+
CQ_END_POINT = f'{END_POINT}/competency/query'
46
HEADERS = {'Content-Type': 'application/json'}
57

6-
MALE_UUID = '2b76d336-5c56-55e3-ab1e-795d6c63f9c1'
7-
FEMALE_UUID = '91359a0f-9e32-5309-b365-145d9956817d'
8-
RAT_UUID = 'fb6d0345-cb70-5c7e-893c-d744a6313c95'
8+
# latest flatmap UUIDs for testing obtained dynamically
9+
maps = latest_maps(END_POINT)
10+
MALE_UUID = (
11+
maps.get(('NCBITaxon:9606', 'PATO:0000384'), {}).get('uuid')
12+
or "2b76d336-5c56-55e3-ab1e-795d6c63f9c1"
13+
)
14+
FEMALE_UUID = (
15+
maps.get(('NCBITaxon:9606', 'PATO:0000383'), {}).get('uuid')
16+
or "91359a0f-9e32-5309-b365-145d9956817d"
17+
)
18+
RAT_UUID = (
19+
maps.get(('NCBITaxon:10114', None), {}).get('uuid')
20+
or "fb6d0345-cb70-5c7e-893c-d744a6313c95"
21+
)
922
SCKAN_VERSION = 'sckan-2024-09-21'
1023

1124
def cq_request(query: dict):
12-
response = requests.post(END_POINT, json=query, headers=HEADERS)
25+
response = requests.post(CQ_END_POINT, json=query, headers=HEADERS)
1326
return response
1427

1528
def assert_valid_query_response(

0 commit comments

Comments
 (0)