class documentation

class FakeAddrInfoGetter: (source)

View In Hierarchy

Test object implementing getaddrinfo.

Method __init__ Create a FakeAddrInfoGetter.
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.
Method getaddrinfo Mock for socket.getaddrinfo.
Instance Variable calls Undocumented
Instance Variable results Undocumented
def __init__(self): (source)
def addResultForHost(self, host, sockaddr, family=AF_INET, socktype=SOCK_STREAM, proto=IPPROTO_TCP, canonname=b''): (source)

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
hostThe hostname to give this result for. This will be the next result from FakeAddrInfoGetter.getaddrinfo when passed this host.
sockaddrThe resulting socket address; should be a 2-tuple for IPv4 or a 4-tuple for IPv6.
familyAn AF_* constant that will be returned from getaddrinfo.
socktypeA SOCK_* constant that will be returned from getaddrinfo.
protoAn IPPROTO_* constant that will be returned from getaddrinfo.
canonname:native strA canonical name that will be returned from getaddrinfo.
def getaddrinfo(self, host, port, family=0, socktype=0, proto=0, flags=0): (source)

Undocumented

Undocumented