|
1 | 1 | import requests |
| 2 | +from tools.portal_maps import ENDPOINTS, latest_maps |
2 | 3 |
|
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' |
4 | 6 | HEADERS = {'Content-Type': 'application/json'} |
5 | 7 |
|
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 | +) |
9 | 22 | SCKAN_VERSION = 'sckan-2024-09-21' |
10 | 23 |
|
11 | 24 | 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) |
13 | 26 | return response |
14 | 27 |
|
15 | 28 | def assert_valid_query_response( |
|
0 commit comments