def test_emit_indented(self): output_stream = StringIO() s = SourceFile(output_stream, indentation=SourceFile.TAB) hello = "hello" expected = SourceFile.TAB + hello s.emit_indented(TextCodeElement(hello)) self.assertEqual(output_stream.getvalue(), expected) output_stream.close()
def __init__(self, stream, indentation=SourceFile.FOUR_SPACES, **kwargs): SourceFile.__init__(self, stream=stream, indentation=indentation, **kwargs)