twisted.internet.test.test_resolver.FakeAddrInfoGetter(object) class documentationtwisted.internet.test.test_resolver
(View In Hierarchy)
Test object implementing getaddrinfo.
| Method | __init__ | Create a FakeAddrInfoGetter. |
| Method | getaddrinfo | Mock for socket.getaddrinfo. |
| Method | addResultForHost | Add a result for a given hostname. When this hostname is resolved, the
result will be a list
of all results addResultForHost has been called with using
that hostname so far. |
Mock for socket.getaddrinfo.
| Parameters | host | see socket.getaddrinfo |
| port | see socket.getaddrinfo | |
| family | see socket.getaddrinfo | |
| socktype | see socket.getaddrinfo | |
| proto | see socket.getaddrinfo | |
| flags | see socket.getaddrinfo | |
| Returns | socket.getaddrinfo | |
Add a result for a given hostname. When this hostname is resolved, the
result will be a list
of all results addResultForHost has been called with using
that hostname so far.
| Parameters | host | The hostname to give this result for. This will be the next result from FakeAddrInfoGetter.getaddrinfo
when passed this host. |
| sockaddr | The resulting socket address; should be a 2-tuple for IPv4 or a 4-tuple for IPv6. | |
| family | An AF_* constant that will be returned from
getaddrinfo. | |
| socktype | A SOCK_* constant that will be returned from
getaddrinfo. | |
| proto | An IPPROTO_* constant that will be returned from
getaddrinfo. | |
| canonname | A canonical name that will be returned from getaddrinfo. (type: native str) |