testtools.content.StackLinesContent(Content)
class documentationtesttools.content
(View In Hierarchy)
Content object for stack lines.
This adapts a list of "preprocessed" stack lines into a 'Content' object. The stack lines are most likely produced from traceback.extract_stack or traceback.extract_tb.
text/x-traceback;language=python is used for the mime type, in order to provide room for other languages to format their tracebacks differently.
Method | __init__ | Create a StackLinesContent for stack_lines. |
Method | _stack_lines_to_unicode | Converts a list of pre-processed stack lines into a unicode string. |
Inherited from Content:
Instance Variable | content_type | The content type of this Content. |
Method | __eq__ | Undocumented |
Method | as_text | Return all of the content as text. |
Method | iter_bytes | Iterate over bytestrings of the serialised content. |
Method | iter_text | Iterate over the text of the serialised content. |
Method | __repr__ | Undocumented |
Method | _iter_text | Worker for iter_text - does the decoding. |
Parameters | stack_lines | A list of preprocessed stack lines, probably obtained by calling traceback.extract_stack or traceback.extract_tb. |
prefix_content | If specified, a unicode string to prepend to the text content. | |
postfix_content | If specified, a unicode string to append to the text content. |