Go to the latest version of this document.

# ``twisted`.`internet`.`testing`.`_FakePort``

class documentation

`class _FakePort: (source)`

Constructor: `_FakePort(hostAddress)`

Implements interfaces: `twisted.internet.interfaces.IListeningPort`

View In Hierarchy

A fake `IListeningPort` to be used in tests.

Method | `__init__` | No summary
Method | `getHost` | Fake `IListeningPort.getHost` that returns our `IAddress`.
Method | `startListening` | Fake `IListeningPort.startListening` that doesn't do anything.
Method | `stopListening` | Fake `IListeningPort.stopListening` that doesn't do anything.
Instance Variable | `_hostAddress` | The `IAddress` this `IListeningPort` is pretending to be listening on.

def __init__(self, hostAddress): (source)

Parameters
hostAddress | An `IAddress` this `IListeningPort` should pretend to be listening on.

def getHost(self): (source)
from `twisted.internet.interfaces.IListeningPort`

Fake `IListeningPort.getHost` that returns our `IAddress`.

def startListening(self): (source)
from `twisted.internet.interfaces.IListeningPort`

Fake `IListeningPort.startListening` that doesn't do anything.

def stopListening(self): (source)
from `twisted.internet.interfaces.IListeningPort`

Fake `IListeningPort.stopListening` that doesn't do anything.

_hostAddress = (source)

The `IAddress` this `IListeningPort` is pretending to be listening on.