Tests added

This commit is contained in:
Tim Bentley 2013-09-01 07:16:27 +01:00
parent e4ba5cb72a
commit ede6adeb48
3 changed files with 10 additions and 7 deletions

View File

@ -104,4 +104,4 @@ __all__ = ['SplashScreen', 'AboutForm', 'SettingsForm', 'MainDisplay', 'SlideCon
'ThemeManager', 'MediaDockManager', 'ServiceItemEditForm', 'FirstTimeForm', 'FirstTimeLanguageForm', 'ThemeForm',
'ThemeLayoutForm', 'FileRenameForm', 'StartTimeForm', 'MainDisplay', 'Display', 'ServiceNoteForm',
'SlideController', 'DisplayController', 'GeneralTab', 'ThemesTab', 'AdvancedTab', 'PluginForm',
'FormattingTagForm', 'ShortcutListForm']
'FormattingTagForm', 'ShortcutListForm', 'FormattingTagController']

View File

@ -5,21 +5,24 @@ from unittest import TestCase
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
"""
# GIVEN: An instance of the Formatting Tag Form and a string containing a tag
form = FormattingTagForm()
tag = u'{tag}'
# WHEN: Calling _strip
result = form._strip(tag)
result = self.services._strip(tag)
# 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}\'')

View File

@ -32,7 +32,7 @@ class TestFormattingTagForm(TestCase):
self.qdialog_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
"""