本文整理汇总了Python中ReText.window.ReTextWindow.setDefaultMarkup方法的典型用法代码示例。如果您正苦于以下问题:Python ReTextWindow.setDefaultMarkup方法的具体用法?Python ReTextWindow.setDefaultMarkup怎么用?Python ReTextWindow.setDefaultMarkup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ReText.window.ReTextWindow
的用法示例。
在下文中一共展示了ReTextWindow.setDefaultMarkup方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: TestWindow
# 需要导入模块: from ReText.window import ReTextWindow [as 别名]
# 或者: from ReText.window.ReTextWindow import setDefaultMarkup [as 别名]
#.........这里部分代码省略.........
# Make sure that the newly created tab is the active one
self.assertFalse(self.window.currentTab.fileName)
# Load the same document again
self.window.actionOpen.trigger()
processEventsUntilIdle()
# Check that we have indeed been switched back to the previous tab
self.assertTrue(self.window.currentTab is tab_with_file)
self.assertTrue(self.window.currentTab.fileName.endswith('tests/testdata/existing_file.md'))
def test_markupDependentWidgetStates_afterStartWithEmptyTabAndMarkdownAsDefaultMarkup(self):
self.window = ReTextWindow()
self.window.createNew('')
processEventsUntilIdle()
# markdown is the default markup
self.check_widgets_enabled_for_markdown(self.window)
def test_markupDependentWidgetStates_afterStartWithEmptyTabAndRestructuredtextAsDefaultMarkup(self):
self.globalSettingsMock.defaultMarkup = 'reStructuredText'
self.window = ReTextWindow()
self.window.createNew('')
processEventsUntilIdle()
self.check_widgets_enabled_for_restructuredtext(self.window)
def test_markupDependentWidgetStates_afterChangingDefaultMarkup(self):
self.window = ReTextWindow()
self.window.createNew('')
processEventsUntilIdle()
self.window.setDefaultMarkup(markups.ReStructuredTextMarkup)
self.check_widgets_enabled_for_restructuredtext(self.window)
@patch('ReText.window.QFileDialog.getOpenFileNames', return_value=([os.path.join(path_to_testdata, 'existing_file.md')], None))
def test_markupDependentWidgetStates_afterLoadingMarkdownDocument(self, getOpenFileNamesMock):
self.window = ReTextWindow()
self.window.createNew('')
self.window.actionOpen.trigger()
processEventsUntilIdle()
self.check_widgets_enabled_for_markdown(self.window)
@patch('ReText.window.QFileDialog.getOpenFileNames', return_value=([os.path.join(path_to_testdata, 'existing_file.rst')], None))
def test_markupDependentWidgetStates_afterLoadingRestructuredtextDocument(self, getOpenFileNamesMock):
self.window = ReTextWindow()
self.window.createNew('')
self.window.actionOpen.trigger()
processEventsUntilIdle()
self.check_widgets_enabled_for_restructuredtext(self.window)
@patch('ReText.window.QFileDialog.getOpenFileNames', side_effect=[ ([os.path.join(path_to_testdata, 'existing_file.md')], None),
([os.path.join(path_to_testdata, 'existing_file.rst')], None) ])
def test_markupDependentWidgetStates_afterSwitchingTab(self, getOpenFileNamesMock):
self.window = ReTextWindow()
self.window.createNew('')
self.window.actionOpen.trigger()
self.window.actionOpen.trigger()
processEventsUntilIdle()
# Just to make sure that sending two actionOpen triggers has had the desired effect
self.assertIn('.rst', self.window.windowTitle())