class documentation

class StubbingTests(TestCase): (source)

View In Hierarchy

Tests for :class:`StubTreq`.

Method test_cookies_not_sent_to_different_domains Cookies manually specified as part of a dictionary are not relayed through redirects to different domains.
Method test_cookies_sent_for_same_domain Cookies manually specified as part of a dictionary are relayed through redirects to the same domain.
Method test_cookies_sent_with_explicit_port Cookies will be sent for URLs that specify a non-default port for their scheme.
Method test_files_are_rejected StubTreq does not handle files yet - it should reject requests which attempt to pass files.
Method test_handles_failing_asynchronous_requests Handle a resource returning NOT_DONE_YET and then canceling the request.
Method test_handles_invalid_schemes Invalid URLs errback with a :obj:`SchemeNotSupported` failure, and does so even after a successful request.
Method test_handles_successful_asynchronous_requests Handle a resource returning NOT_DONE_YET and then later finishing the response.
Method test_handles_successful_asynchronous_requests_with_response_data Handle a resource returning NOT_DONE_YET and then sending some data in the response.
Method test_handles_successful_asynchronous_requests_with_streaming Handle a resource returning NOT_DONE_YET and then streaming data back gradually over time.
Method test_passing_in_strange_data_is_rejected StubTreq rejects data that isn't list/dictionary/tuple/bytes/unicode.
Method test_providing_resource_to_stub_treq The resource provided to StubTreq responds to every request no matter what the URI or parameters or data.
Method test_session_persistence_between_requests Calling request.getSession() in the wrapped resource will return a session with the same ID, until the sessions are cleaned; in other words, cookies are propagated between requests when the result of C{response...
Method test_stubtreq_provides_all_functions_in_treq_all Every single function and attribute exposed by :obj:`treq.__all__` is provided by :obj:`StubTreq`.
def test_cookies_not_sent_to_different_domains(self): (source)

Cookies manually specified as part of a dictionary are not relayed through redirects to different domains. (This is really more of a test for scoping of cookies within treq itself, rather than just for testing.)

def test_cookies_sent_for_same_domain(self): (source)

Cookies manually specified as part of a dictionary are relayed through redirects to the same domain. (This is really more of a test for scoping of cookies within treq itself, rather than just for testing.)

def test_cookies_sent_with_explicit_port(self): (source)

Cookies will be sent for URLs that specify a non-default port for their scheme. (This is really more of a test for scoping of cookies within treq itself, rather than just for testing.)

def test_files_are_rejected(self): (source)

StubTreq does not handle files yet - it should reject requests which attempt to pass files.

def test_handles_failing_asynchronous_requests(self): (source)

Handle a resource returning NOT_DONE_YET and then canceling the request.

def test_handles_invalid_schemes(self): (source)

Invalid URLs errback with a :obj:`SchemeNotSupported` failure, and does so even after a successful request.

def test_handles_successful_asynchronous_requests(self): (source)

Handle a resource returning NOT_DONE_YET and then later finishing the response.

def test_handles_successful_asynchronous_requests_with_response_data(self): (source)

Handle a resource returning NOT_DONE_YET and then sending some data in the response.

def test_handles_successful_asynchronous_requests_with_streaming(self): (source)

Handle a resource returning NOT_DONE_YET and then streaming data back gradually over time.

def test_passing_in_strange_data_is_rejected(self): (source)

StubTreq rejects data that isn't list/dictionary/tuple/bytes/unicode.

def test_providing_resource_to_stub_treq(self): (source)

The resource provided to StubTreq responds to every request no matter what the URI or parameters or data.

def test_session_persistence_between_requests(self): (source)

Calling request.getSession() in the wrapped resource will return a session with the same ID, until the sessions are cleaned; in other words, cookies are propagated between requests when the result of C{response.cookies()} is passed to the next request.

def test_stubtreq_provides_all_functions_in_treq_all(self): (source)

Every single function and attribute exposed by :obj:`treq.__all__` is provided by :obj:`StubTreq`.