mirror of
https://github.com/github/codeql.git
synced 2026-05-05 05:35:13 +02:00
Python: Add tests of requests
Also adjusts test slightly. Writing `clientRequestDisablesCertValidation=False` to mean that certificate validation was disabled by the `False` expression is just confusing, as it easily reads as _certificate validate was NOT disabled_ :| The new one ties to each request that is being made, which seems like the right setup.
This commit is contained in:
@@ -480,7 +480,7 @@ class HttpClientRequestTest extends InlineExpectationsTest {
|
||||
HttpClientRequestTest() { this = "HttpClientRequestTest" }
|
||||
|
||||
override string getARelevantTag() {
|
||||
result in ["clientRequestUrl", "clientRequestDisablesCertValidation"]
|
||||
result in ["clientRequestUrl", "clientRequestCertValidationDisabled"]
|
||||
}
|
||||
|
||||
override predicate hasActualResult(Location location, string element, string tag, string value) {
|
||||
@@ -494,12 +494,12 @@ class HttpClientRequestTest extends InlineExpectationsTest {
|
||||
)
|
||||
or
|
||||
exists(location.getFile().getRelativePath()) and
|
||||
exists(HTTP::Client::Request req, DataFlow::Node disablingNode |
|
||||
req.disablesCertificateValidation(disablingNode, _) and
|
||||
location = disablingNode.getLocation() and
|
||||
element = disablingNode.toString() and
|
||||
value = prettyNodeForInlineTest(disablingNode) and
|
||||
tag = "clientRequestDisablesCertValidation"
|
||||
exists(HTTP::Client::Request req |
|
||||
req.disablesCertificateValidation(_, _) and
|
||||
location = req.getLocation() and
|
||||
element = req.toString() and
|
||||
value = "" and
|
||||
tag = "clientRequestCertValidationDisabled"
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user