Skip to content

Commit 991d5cc

Browse files
committed
Python: Fix test of HttpResponse.getBody()
1 parent 64a7206 commit 991d5cc

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

python/ql/test/experimental/meta/ConceptsTest.qll

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -292,10 +292,11 @@ module HttpServerHttpResponseTest implements TestSig {
292292
exists(DedicatedResponseTest d | d.isDedicatedFile(file))
293293
) and
294294
(
295-
exists(Http::Server::HttpResponse response |
296-
location = response.getLocation() and
297-
element = response.toString() and
298-
value = prettyNodeForInlineTest(response.getBody()) and
295+
exists(Http::Server::HttpResponse response, DataFlow::Node body |
296+
body = response.getBody() and
297+
location = body.getLocation() and
298+
element = body.toString() and
299+
value = prettyNodeForInlineTest(body) and
299300
tag = "responseBody"
300301
)
301302
or
Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,2 @@
11
failures
22
testFailures
3-
| response_test.py:82:12:82:31 | ControlFlowNode for Attribute() | Unexpected result: responseBody=b"bar" |
4-
| response_test.py:82:12:82:31 | ControlFlowNode for Attribute() | Unexpected result: responseBody=b"baz" |
5-
| response_test.py:82:12:82:31 | ControlFlowNode for Attribute() | Unexpected result: responseBody=b"foo" |

python/ql/test/library-tests/frameworks/aiohttp/response_test.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,9 @@ async def streaming_response(request): # $ requestHandler
8282
resp = web.StreamResponse() # $ HttpResponse mimetype=application/octet-stream
8383
await resp.prepare(request)
8484

85-
await resp.write(b"foo") # $ MISSING: responseBody=b"foo"
86-
await resp.write(data=b"bar") # $ MISSING: responseBody=b"bar"
87-
await resp.write_eof(b"baz") # $ MISSING: responseBody=b"bar"
85+
await resp.write(b"foo") # $ responseBody=b"foo"
86+
await resp.write(data=b"bar") # $ responseBody=b"bar"
87+
await resp.write_eof(b"baz") # $ responseBody=b"baz"
8888

8989
return resp
9090

0 commit comments

Comments
 (0)