class documentation
class ProcurementTests(SynchronousTestCase): (source)
Tests for klein.SessionProcurer
.
Method | test |
When Requirer.require is used with Authorization and the session knows how to supply that authorization, it is passed to the object. |
Method | test_authorization |
When Requirer.require is used with an Authorization and the session does not know how to supply that authorization, the callable is not invoked. |
Method | test_cookies |
If cookies can't be set, then procureSession raises NoSuchSession . |
Method | test_procured |
If you start writing stuff to the response before procuring the session, when cookies need to be set, you will get a comprehensible error. |
Method | test_procurement |
Once a session is negotiated, it should be the identical object to avoid duplicate work - unless we are using forceInsecure to retrieve the insecure session from a secure request, in which case the result should not be cached. |
Method | test_unknown |
Unknown session IDs in cookies will result in a new session being created. |
Method | test_unknown |
Unknown session IDs in cookies for POST requests will result in a NoSuchSession error. |
Method | test_unknown |
Unknown session IDs in auth headers will be immediately rejected with NoSuchSession . |
When Requirer.require
is used with Authorization
and the session knows how to supply that authorization, it is passed to the object.
When Requirer.require
is used with an Authorization
and the session does not know how to supply that authorization, the callable is not invoked.
If you start writing stuff to the response before procuring the session, when cookies need to be set, you will get a comprehensible error.
Once a session is negotiated, it should be the identical object to avoid duplicate work - unless we are using forceInsecure to retrieve the insecure session from a secure request, in which case the result should not be cached.