mirror of
https://github.com/github/codeql.git
synced 2026-04-25 16:55:19 +02:00
Python: Fix test of HttpResponse.getBody()
This commit is contained in:
@@ -292,10 +292,11 @@ module HttpServerHttpResponseTest implements TestSig {
|
||||
exists(DedicatedResponseTest d | d.isDedicatedFile(file))
|
||||
) and
|
||||
(
|
||||
exists(Http::Server::HttpResponse response |
|
||||
location = response.getLocation() and
|
||||
element = response.toString() and
|
||||
value = prettyNodeForInlineTest(response.getBody()) and
|
||||
exists(Http::Server::HttpResponse response, DataFlow::Node body |
|
||||
body = response.getBody() and
|
||||
location = body.getLocation() and
|
||||
element = body.toString() and
|
||||
value = prettyNodeForInlineTest(body) and
|
||||
tag = "responseBody"
|
||||
)
|
||||
or
|
||||
|
||||
@@ -1,5 +1,2 @@
|
||||
failures
|
||||
testFailures
|
||||
| response_test.py:82:12:82:31 | ControlFlowNode for Attribute() | Unexpected result: responseBody=b"bar" |
|
||||
| response_test.py:82:12:82:31 | ControlFlowNode for Attribute() | Unexpected result: responseBody=b"baz" |
|
||||
| response_test.py:82:12:82:31 | ControlFlowNode for Attribute() | Unexpected result: responseBody=b"foo" |
|
||||
|
||||
@@ -82,9 +82,9 @@ async def streaming_response(request): # $ requestHandler
|
||||
resp = web.StreamResponse() # $ HttpResponse mimetype=application/octet-stream
|
||||
await resp.prepare(request)
|
||||
|
||||
await resp.write(b"foo") # $ MISSING: responseBody=b"foo"
|
||||
await resp.write(data=b"bar") # $ MISSING: responseBody=b"bar"
|
||||
await resp.write_eof(b"baz") # $ MISSING: responseBody=b"bar"
|
||||
await resp.write(b"foo") # $ responseBody=b"foo"
|
||||
await resp.write(data=b"bar") # $ responseBody=b"bar"
|
||||
await resp.write_eof(b"baz") # $ responseBody=b"baz"
|
||||
|
||||
return resp
|
||||
|
||||
|
||||
Reference in New Issue
Block a user