forked from openlp/openlp
Tests added
This commit is contained in:
parent
e4ba5cb72a
commit
ede6adeb48
@ -104,4 +104,4 @@ __all__ = ['SplashScreen', 'AboutForm', 'SettingsForm', 'MainDisplay', 'SlideCon
|
|||||||
'ThemeManager', 'MediaDockManager', 'ServiceItemEditForm', 'FirstTimeForm', 'FirstTimeLanguageForm', 'ThemeForm',
|
'ThemeManager', 'MediaDockManager', 'ServiceItemEditForm', 'FirstTimeForm', 'FirstTimeLanguageForm', 'ThemeForm',
|
||||||
'ThemeLayoutForm', 'FileRenameForm', 'StartTimeForm', 'MainDisplay', 'Display', 'ServiceNoteForm',
|
'ThemeLayoutForm', 'FileRenameForm', 'StartTimeForm', 'MainDisplay', 'Display', 'ServiceNoteForm',
|
||||||
'SlideController', 'DisplayController', 'GeneralTab', 'ThemesTab', 'AdvancedTab', 'PluginForm',
|
'SlideController', 'DisplayController', 'GeneralTab', 'ThemesTab', 'AdvancedTab', 'PluginForm',
|
||||||
'FormattingTagForm', 'ShortcutListForm']
|
'FormattingTagForm', 'ShortcutListForm', 'FormattingTagController']
|
||||||
|
@ -5,21 +5,24 @@ from unittest import TestCase
|
|||||||
|
|
||||||
from mock import MagicMock, patch
|
from mock import MagicMock, patch
|
||||||
|
|
||||||
from openlp.core.ui.formattingtagform import FormattingTagForm
|
from openlp.core.ui import FormattingTagController
|
||||||
|
|
||||||
class TestFormattingTagForm(TestCase):
|
|
||||||
|
|
||||||
def strip_test(self):
|
class TestFormattingTagController(TestCase):
|
||||||
|
|
||||||
|
def setUp(self):
|
||||||
|
self.services = FormattingTagController()
|
||||||
|
|
||||||
|
def test_strip(self):
|
||||||
"""
|
"""
|
||||||
Test that the _strip strips the correct chars
|
Test that the _strip strips the correct chars
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# GIVEN: An instance of the Formatting Tag Form and a string containing a tag
|
# GIVEN: An instance of the Formatting Tag Form and a string containing a tag
|
||||||
form = FormattingTagForm()
|
|
||||||
tag = u'{tag}'
|
tag = u'{tag}'
|
||||||
|
|
||||||
# WHEN: Calling _strip
|
# WHEN: Calling _strip
|
||||||
result = form._strip(tag)
|
result = self.services._strip(tag)
|
||||||
|
|
||||||
# THEN: The tag should be returned with the wrappers removed.
|
# THEN: The tag should be returned with the wrappers removed.
|
||||||
self.assertEqual(result, u'tag', u'FormattingTagForm._strip should return u\'tag\' when called with u\'{tag}\'')
|
self.assertEqual(result, u'tag', u'FormattingTagForm._strip should return u\'tag\' when called with u\'{tag}\'')
|
@ -32,7 +32,7 @@ class TestFormattingTagForm(TestCase):
|
|||||||
self.qdialog_patcher.stop()
|
self.qdialog_patcher.stop()
|
||||||
self.ui_formatting_tag_dialog_patcher.stop()
|
self.ui_formatting_tag_dialog_patcher.stop()
|
||||||
|
|
||||||
def on_text_edited_test(self):
|
def test_on_text_edited(self):
|
||||||
"""
|
"""
|
||||||
Test that the appropriate actions are preformed when on_text_edited is called
|
Test that the appropriate actions are preformed when on_text_edited is called
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user