File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed
eventsourcingdb_client_python/handlers Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -13,17 +13,17 @@ async def ping(client: AbstractBaseClient) -> None:
1313
1414 if response .status_code != HTTPStatus .OK :
1515 raise ServerError (f'Received unexpected response: { response_body } ' )
16-
16+
1717 # Check old format (plain "OK")
1818 if response_body == OK_RESPONSE :
1919 return
20-
21- # Check new format (JSON {"status":"ok"})
20+
2221 try :
2322 response_json = json .loads (response_body )
24- if isinstance (response_json , dict ) and response_json .get ('status' ) == STATUS_OK :
25- return
2623 except json .JSONDecodeError :
2724 pass
28-
25+ else :
26+ if isinstance (response_json , dict ) and response_json .get ('status' ) == STATUS_OK :
27+ return
28+
2929 raise ServerError (f'Received unexpected response: { response_body } ' )
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ async def ping_app() -> RetryResult[None]:
4848 async with session :
4949 try :
5050 response = await session .get (
51- f'http://localhost:{ local_http_server .port } /__python_test__/api/v1/ping' , timeout = aiohttp .ClientTimeout (total = 1 )
51+ f'http://localhost:{ local_http_server .port } /__python_test__/api/v1/ping' , timeout = aiohttp .ClientTimeout (total = 1 ) # noqa: E501
5252 )
5353 except aiohttp .ClientError as error :
5454 return Retry (cause = error )
You can’t perform that action at this time.
0 commit comments