def test_get_primary_sheets(self):
        self._remove_patched_function("_workbook_element")
        _obj = Mock()
        _obj.getSheetByIndex.return_value = "sheet1"
        self._workbook_element = self._init_patch_with_name(
            '_workbook_element',
            'xmind.core.workbook.WorkbookElement',
            return_value=_obj)

        _workbook_document = WorkbookDocument()

        self.assertEqual(_workbook_document.getPrimarySheet(), "sheet1")
        _obj.getSheetByIndex.assert_called_once_with(0)
        self._append_child.assert_called_once_with(_obj)
        self._assert_init_methods(_workbook_document)
Exemplo n.º 2
0
 def get_indent_out_file(self, workbook: WorkbookDocument):
     out_file = self.indent_output
     if not out_file:
         out_file = workbook.getPrimarySheet().getRootTopic().getTitle(
         ) + '.md'
     return out_file