1async def test_kv(service_client):
2 response = await service_client.post(
3 '/kv', json={
'key': 1,
'value':
'one'},
5 assert response.status == 200
6 assert response.json()
is None
7 assert 'application/json' in response.headers[
'Content-Type']
9 response = await service_client.get(
'/kv', json={
'key': 1})
10 assert response.status == 200
11 assert response.json() == {
'key': 1,
'value':
'one'}
12 assert 'application/json' in response.headers[
'Content-Type']
14 response = await service_client.post(
15 '/kv', json={
'key': 1,
'value':
'again_1'},
17 assert response.status == 200
19 response = await service_client.get(
'/kv', json={
'key': 1})
20 assert response.status == 200
21 assert response.json() == {
'key': 1,
'value':
'again_1'}
22 assert 'application/json' in response.headers[
'Content-Type']