Python: Add http.client.HTTPResponse model

This commit is contained in:
Taus
2023-09-25 15:49:03 +00:00
committed by Rasmus Wriedt Larsen
parent 1d4b4ee740
commit 750f14f859
2 changed files with 9 additions and 1 deletions

View File

@@ -2428,8 +2428,10 @@ module StdlibPrivate {
*/
module HttpResponse {
/** Gets a reference to the `http.client.HttpResponse` class. */
private API::Node classRef() {
API::Node classRef() {
result = API::moduleImport("http").getMember("client").getMember("HTTPResponse")
or
result = ModelOutput::getATypeNode("http.client.HTTPResponse~Subclass").getASubclass*()
}
/**

View File

@@ -221,6 +221,12 @@ class RequestsResponse extends FindSubclassesSpec {
override API::Node getAlreadyModeledClass() { result = Requests::Response::classRef() }
}
class HttpClientHttpResponse extends FindSubclassesSpec {
HttpClientHttpResponse() { this = "http.client.HTTPResponse~Subclass" }
override API::Node getAlreadyModeledClass() { result = StdlibPrivate::HttpResponse::classRef() }
}
bindingset[fullyQualified]
predicate fullyQualifiedToYamlFormat(string fullyQualified, string type2, string path) {
exists(int firstDot | firstDot = fullyQualified.indexOf(".", 0, 0) |