class documentation

Undocumented

Method test_bindable bindable is a decorator which allows a function decorated by @route to have a uniform signature regardless of whether it is receiving a bound object from its Klein or not.
Method test_bindInstanceIgnoresBlankProperties Klein.__get__ doesn't propagate AttributeError when searching for the bound Klein instance.
Method test_branchDoesntRequireTrailingSlash Klein.route should create a branch path which consumes all children, when the branch keyword argument is True and there is no trailing / on the path.
Method test_branchRoute Klein.route should create a branch path which consumes all children when the branch keyword argument is True.
Method test_classicalRoute Klein.route may be used a method decorator when a Klein instance is defined as a class variable.
Method test_classicalRouteWithBranch Multiple instances of a class with a Klein attribute and Klein.route'd methods can be created and their Kleins used independently.
Method test_classicalRouteWithTwoInstances Multiple instances of a class with a Klein attribute and Klein.route'd methods can be created and their Kleins used independently.
Method test_kleinNotFoundOnClass When the Klein object can't find itself on the class it still preserves identity.
Method test_mapByIdentity Routes are routed to the proper object regardless of its __hash__ implementation.
Method test_modified modified is a decorator which alters the thing that it decorates, and describes itself as such.
Method test_preserveIdentityWhenPossible Repeated accesses of the same Klein attribute on the same instance should result in an identically bound instance, when possible. "Possible" is defined by a writable instance-level attribute named __klein_bound_<the name of the Klein attribute on the class>__...
Method test_resource Klien.resource returns a KleinResource.
Method test_route Klein.route adds functions as routable endpoints.
Method test_run Klein.run configures a KleinResource and a Site listening on the specified interface and port, and logs to stdout.
Method test_runSSL Klein.run called with SSL endpoint specification.
Method test_runTCP6 Klein.run called with tcp6 endpoint description.
Method test_runWithLogFile Klein.run logs to the specified logFile.
Method test_stackedRoute Klein.route can be stacked to create multiple endpoints of a single function.
Method test_submountedRoute Klein.subroute adds functions as routable endpoints.
Method test_urlFor Klein.urlFor builds an URL for an endpoint with parameters
def test_bindable(self): (source)

bindable is a decorator which allows a function decorated by @route to have a uniform signature regardless of whether it is receiving a bound object from its Klein or not.

def test_bindInstanceIgnoresBlankProperties(self): (source)

Klein.__get__ doesn't propagate AttributeError when searching for the bound Klein instance.

def test_branchDoesntRequireTrailingSlash(self): (source)

Klein.route should create a branch path which consumes all children, when the branch keyword argument is True and there is no trailing / on the path.

def test_branchRoute(self): (source)

Klein.route should create a branch path which consumes all children when the branch keyword argument is True.

def test_classicalRoute(self): (source)

Klein.route may be used a method decorator when a Klein instance is defined as a class variable.

def test_classicalRouteWithBranch(self): (source)

Multiple instances of a class with a Klein attribute and Klein.route'd methods can be created and their Kleins used independently.

def test_classicalRouteWithTwoInstances(self): (source)

Multiple instances of a class with a Klein attribute and Klein.route'd methods can be created and their Kleins used independently.

def test_kleinNotFoundOnClass(self): (source)

When the Klein object can't find itself on the class it still preserves identity.

def test_mapByIdentity(self): (source)

Routes are routed to the proper object regardless of its __hash__ implementation.

def test_modified(self): (source)

modified is a decorator which alters the thing that it decorates, and describes itself as such.

def test_preserveIdentityWhenPossible(self): (source)

Repeated accesses of the same Klein attribute on the same instance should result in an identically bound instance, when possible. "Possible" is defined by a writable instance-level attribute named __klein_bound_<the name of the Klein attribute on the class>__, and something is maintaining a strong reference to the Klein instance.

@patch('klein._app.KleinResource')
def test_resource(self, mock_kr): (source)

Klien.resource returns a KleinResource.

def test_route(self): (source)

Klein.route adds functions as routable endpoints.

@patch('klein._app.KleinResource')
@patch('klein._app.Site')
@patch('klein._app.log')
@patch('klein._app.reactor')
def test_run(self, reactor, mock_log, mock_site, mock_kr): (source)

Klein.run configures a KleinResource and a Site listening on the specified interface and port, and logs to stdout.

@patch('klein._app.KleinResource')
@patch('klein._app.log')
@patch('klein._app.serverFromString')
@patch('klein._app.reactor')
def test_runSSL(self, reactor, mock_sfs, mock_log, mock_kr): (source)

Klein.run called with SSL endpoint specification.

@patch('klein._app.KleinResource')
@patch('klein._app.log')
@patch('klein._app.serverFromString')
@patch('klein._app.reactor')
def test_runTCP6(self, reactor, mock_sfs, mock_log, mock_kr): (source)

Klein.run called with tcp6 endpoint description.

@patch('klein._app.KleinResource')
@patch('klein._app.Site')
@patch('klein._app.log')
@patch('klein._app.reactor')
def test_runWithLogFile(self, reactor, mock_log, mock_site, mock_kr): (source)

Klein.run logs to the specified logFile.

def test_stackedRoute(self): (source)

Klein.route can be stacked to create multiple endpoints of a single function.

def test_submountedRoute(self): (source)

Klein.subroute adds functions as routable endpoints.

def test_urlFor(self): (source)

Klein.urlFor builds an URL for an endpoint with parameters