class documentation

Tests for IMutableHTTPHeaders implementations.

Method assertRawHeadersEqual Undocumented
Method getValues Look up the values for the given header name from the given raw headers.
Method headers Given a RawHeaders, return an IMutableHTTPHeaders.
Method test_addValueBytesName IMutableHTTPHeaders.addValue adds the given bytes value for the given bytes header name.
Method test_addValueBytesNameTextValue IMutableHTTPHeaders.addValue raises TypeError when the given header name is bytes and the given value is str.
Method test_addValueInvalidNameType IMutableHTTPHeaders.addValue raises TypeError when the given header name is of an unknown type.
Method test_addValueTextName IMutableHTTPHeaders.addValue adds the given str value for the given str header name.
Method test_addValueTextNameBytesValue IMutableHTTPHeaders.addValue raises TypeError when the given header name is str and the given value is bytes.
Method test_interface Class implements IMutableHTTPHeaders.
Method test_rawHeaders IMutableHTTPHeaders.rawHeaders equals the raw headers passed at init time as a tuple.
Method test_removeBytesName IMutableHTTPHeaders.remove removes all values for the given bytes header name.
Method test_removeInvalidNameType IMutableHTTPHeaders.remove raises TypeError when the given header name is of an unknown type.
Method test_removeTextName IMutableHTTPHeaders.remove removes all values for the given str header name.

Inherited from GetValuesTestsMixIn:

Method headerNormalize Test hook for the normalization of header text values, which is a behavior Twisted has changed after version 18.9.0.
Method test_getBytesName getValues returns an iterable of bytes values for the given bytes header name.
Method test_getInvalidNameType getValues raises TypeError when the given header name is of an unknown type.
Method test_getTextName getValues returns an iterable of str values for the given str header name.
Method test_getTextNameBinaryValues getValues returns an iterable of str values for the given str header name.
def assertRawHeadersEqual(self, rawHeaders1, rawHeaders2): (source)

Undocumented

Parameters
rawHeaders1:RawHeadersUndocumented
rawHeaders2:RawHeadersUndocumented
def getValues(self, rawHeaders, name): (source)

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
rawHeaders:RawHeadersUndocumented
name:AnyStrUndocumented
Returns
Iterable[AnyStr]Undocumented
@abstractmethod
def headers(self, rawHeaders): (source)

Given a RawHeaders, return an IMutableHTTPHeaders.

Parameters
rawHeaders:RawHeadersUndocumented
Returns
IMutableHTTPHeadersUndocumented
def test_addValueBytesName(self): (source)

IMutableHTTPHeaders.addValue adds the given bytes value for the given bytes header name.

def test_addValueBytesNameTextValue(self): (source)

IMutableHTTPHeaders.addValue raises TypeError when the given header name is bytes and the given value is str.

def test_addValueInvalidNameType(self): (source)

IMutableHTTPHeaders.addValue raises TypeError when the given header name is of an unknown type.

def test_addValueTextName(self): (source)

IMutableHTTPHeaders.addValue adds the given str value for the given str header name.

def test_addValueTextNameBytesValue(self): (source)

IMutableHTTPHeaders.addValue raises TypeError when the given header name is str and the given value is bytes.

def test_interface(self): (source)

Class implements IMutableHTTPHeaders.

def test_rawHeaders(self): (source)

IMutableHTTPHeaders.rawHeaders equals the raw headers passed at init time as a tuple.

def test_removeBytesName(self): (source)

IMutableHTTPHeaders.remove removes all values for the given bytes header name.

def test_removeInvalidNameType(self): (source)

IMutableHTTPHeaders.remove raises TypeError when the given header name is of an unknown type.

def test_removeTextName(self): (source)

IMutableHTTPHeaders.remove removes all values for the given str header name.