userver: samples/config_service/tests/test_config.py
Loading...
Searching...
No Matches
samples/config_service/tests/test_config.py
1# /// [Functional test]
2async def test_config(service_client):
3 response = await service_client.post('/configs/values', json={})
4 assert response.status == 200
5 reply = response.json()
6 assert reply['configs']['USERVER_LOG_REQUEST_HEADERS'] is True
7 assert 'application/json' in response.headers['Content-Type']
8
9
10async def test_config_specific_ids(service_client):
11 response = await service_client.post(
12 '/configs/values',
13 json={
14 'updated_since': '2021-06-29T14:15:31.173239295+0000',
15 'ids': ['USERVER_TASK_PROCESSOR_QOS'],
16 },
17 )
18 assert response.status == 200
19 reply = response.json()
20 assert len(reply['configs']) == 1
21 assert reply['configs']['USERVER_TASK_PROCESSOR_QOS']
22 assert 'application/json' in response.headers['Content-Type']
23 # /// [Functional test]