Exemple #1
0
 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()
Exemple #2
0
 def __init__(self, stream, indentation=SourceFile.FOUR_SPACES, **kwargs):
     SourceFile.__init__(self,
                         stream=stream,
                         indentation=indentation,
                         **kwargs)
Exemple #3
0
 def __init__(self, stream, indentation=SourceFile.FOUR_SPACES, **kwargs):
     SourceFile.__init__(self, stream=stream, indentation=indentation,
                         **kwargs)