def execute(self, editor): editor.setPlainText(self.test_file_content, '', '') with open('file_structure', 'w') as f: folding.print_tree(editor, file=f, print_blocks=True) with open('file_structure', 'r') as f: results_content = f.read() assert results_content == self.expected_results_content
def execute(self, free_format=False): editor = CobolCodeEdit(free_format=free_format) editor.setPlainText(self.test_file_content, '', '') with open('file_structure', 'w') as f: folding.print_tree(editor, file=f, print_blocks=True) with open('file_structure', 'r') as f: results_content = f.read() assert results_content == self.expected_results_content editor.clear()
def execute(self, editor): editor.setPlainText(self.file_content, '', '') self.perform_actions(editor) with open('file_structure', 'w') as f: folding.print_tree(editor, file=f, print_blocks=True) # Compare results with open('file_structure', 'r') as f: results_content = f.read() assert results_content == self.expected_results_file_content