class MutableHTTPHeadersTestsMixIn(GetValuesTestsMixIn, ABC): (source)
Known subclasses: klein.test.test_headers.MutableHTTPHeadersTests
, klein.test.test_headers_compat.HTTPHeadersWrappingHeadersTests
Tests for IMutableHTTPHeaders
implementations.
Method | assert |
Undocumented |
Method | get |
Look up the values for the given header name from the given raw headers. |
Method | headers |
Given a RawHeaders , return an IMutableHTTPHeaders . |
Method | test_add |
IMutableHTTPHeaders.addValue adds the given bytes value for the given bytes header name. |
Method | test_add |
IMutableHTTPHeaders.addValue raises TypeError when the given header name is bytes and the given value is str . |
Method | test_add |
IMutableHTTPHeaders.addValue raises TypeError when the given header name is of an unknown type. |
Method | test_add |
IMutableHTTPHeaders.addValue adds the given str value for the given str header name. |
Method | test_add |
IMutableHTTPHeaders.addValue raises TypeError when the given header name is str and the given value is bytes . |
Method | test |
Class implements IMutableHTTPHeaders . |
Method | test_raw |
IMutableHTTPHeaders.rawHeaders equals the raw headers passed at init time as a tuple. |
Method | test_remove |
IMutableHTTPHeaders.remove removes all values for the given bytes header name. |
Method | test_remove |
IMutableHTTPHeaders.remove raises TypeError when the given header name is of an unknown type. |
Method | test_remove |
IMutableHTTPHeaders.remove removes all values for the given str header name. |
Inherited from GetValuesTestsMixIn
:
Method | header |
Test hook for the normalization of header text values, which is a behavior Twisted has changed after version 18.9.0. |
Method | test_get |
getValues returns an iterable of bytes values for the given bytes header name. |
Method | test_get |
getValues raises TypeError when the given header name is of an unknown type. |
Method | test_get |
getValues returns an iterable of str values for the given str header name. |
Method | test_get |
getValues returns an iterable of str values for the given str header name. |
Look up the values for the given header name from the given raw headers.
This is called by the other tests in this mix-in class to allow test cases that use it to specify how to perform this look-up in the implementation being tested.
Parameters | |
rawRawHeaders | Undocumented |
name:AnyStr | Undocumented |
Returns | |
Iterable[ | Undocumented |
klein.test.test_headers.MutableHTTPHeadersTests
, klein.test.test_headers_compat.HTTPHeadersWrappingHeadersTests
Given a RawHeaders
, return an IMutableHTTPHeaders
.
Parameters | |
rawRawHeaders | Undocumented |
Returns | |
IMutableHTTPHeaders | Undocumented |
IMutableHTTPHeaders.addValue
raises TypeError
when the given header name is bytes
and the given value is str
.
IMutableHTTPHeaders.addValue
raises TypeError
when the given header name is str
and the given value is bytes
.