def METHOD_NAME(self):
    section = self.doc_structure.add_new_section('mysection')
    subsection = section.add_new_section('mysubsection')
    self.doc_structure.writeln('1')
    section.writeln('2')
    subsection.writeln('3')
    second_section = self.doc_structure.add_new_section('mysection2')
    second_section.writeln('4')
    contents = self.doc_structure.flush_structure()
    # Ensure the contents were flushed out correctly
    self.assertEqual(contents, b'1\n2\n3\n4\n')