1async def test_log_action(service_client, pgsql, mockserver):
2 @mockserver.handler('/v1/action')
5 request.get_data() == b
'test_1'
6 ), f
'Actual data is {request.get_data()}'
7 return mockserver.make_response()
9 response = await service_client.post(
'/log?action=test_1')
10 assert response.status == 200
13 cursor = pgsql[
'0_db_schema'].cursor()
14 cursor.execute(
'SELECT action FROM events_table WHERE id=1')
15 result = cursor.fetchall()
16 assert len(result) == 1
17 assert result[0][0] ==
'test_1'