From ede6adeb48c8be7ecaaffae80142060688cbc035 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sun, 1 Sep 2013 07:16:27 +0100 Subject: [PATCH] Tests added --- openlp/core/ui/__init__.py | 2 +- .../openlp_core_ui/tests.formattingcontroller.py | 13 ++++++++----- .../openlp_core_ui/tests_fromattingstagsform.py | 2 +- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/openlp/core/ui/__init__.py b/openlp/core/ui/__init__.py index 49e59e4c1..4fa7539e4 100644 --- a/openlp/core/ui/__init__.py +++ b/openlp/core/ui/__init__.py @@ -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'] diff --git a/tests/functional/openlp_core_ui/tests.formattingcontroller.py b/tests/functional/openlp_core_ui/tests.formattingcontroller.py index 6f78a6ffa..7959e82b5 100644 --- a/tests/functional/openlp_core_ui/tests.formattingcontroller.py +++ b/tests/functional/openlp_core_ui/tests.formattingcontroller.py @@ -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}\'') \ No newline at end of file diff --git a/tests/functional/openlp_core_ui/tests_fromattingstagsform.py b/tests/functional/openlp_core_ui/tests_fromattingstagsform.py index 4e5a109cc..2b31c0a62 100644 --- a/tests/functional/openlp_core_ui/tests_fromattingstagsform.py +++ b/tests/functional/openlp_core_ui/tests_fromattingstagsform.py @@ -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 """