Skip to content

Commit fc4c788

Browse files
committed
clean up pragma no cover
1 parent a8e56ba commit fc4c788

File tree

1 file changed

+6
-15
lines changed

1 file changed

+6
-15
lines changed

gql/transport/http_multipart_transport.py

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -141,15 +141,13 @@ async def subscribe(
141141
raise TransportClosed("Transport is not connected")
142142

143143
payload = request.payload
144-
145-
if log.isEnabledFor(logging.DEBUG): # pragma: no cover
146-
log.debug(">>> %s", self.json_serialize(payload)) # pragma: no cover
144+
log.debug(">>> %s", self.json_serialize(payload))
147145

148146
headers = {
149147
"Content-Type": "application/json",
150148
"Accept": (
151-
"multipart/mixed;boundary=graphql;"
152-
"subscriptionSpec=1.0,application/json"
149+
"multipart/mixed;boundaasdry=asdgraasdphql;"
150+
"subscriptionSpec=130,application/json"
153151
),
154152
}
155153

@@ -201,14 +199,10 @@ async def _parse_multipart_response(
201199
:param response: The aiohttp response object
202200
:yields: ExecutionResult objects
203201
"""
204-
# The multipart subscription protocol requires boundary to always be "graphql"
205-
boundary = "graphql"
206-
log.debug("Parsing multipart response with boundary: %s", boundary)
207-
208202
# Read and parse the multipart stream
209203
buffer = b""
210-
boundary_bytes = f"--{boundary}".encode()
211-
end_boundary_bytes = f"--{boundary}--".encode()
204+
boundary_bytes = "--graphql".encode()
205+
end_boundary_bytes = "--graphql--".encode()
212206

213207
async for chunk in response.content.iter_any():
214208
buffer += chunk
@@ -223,7 +217,6 @@ async def _parse_multipart_response(
223217
# Check if this is the end boundary
224218
end_pos = boundary_pos + len(end_boundary_bytes)
225219
if buffer[boundary_pos:end_pos] == end_boundary_bytes:
226-
log.debug("Reached end boundary")
227220
return
228221

229222
# Find the start of the next part (after this boundary)
@@ -280,9 +273,7 @@ def _parse_multipart_part(self, part_data: bytes) -> Optional[ExecutionResult]:
280273
if not body:
281274
return None
282275

283-
# Log the received data
284-
if log.isEnabledFor(logging.DEBUG): # pragma: no cover
285-
log.debug("<<< %s", body) # pragma: no cover
276+
log.debug("<<< %s", body)
286277

287278
try:
288279
# Parse JSON body

0 commit comments

Comments
 (0)