From ee7fb49e49ce3d28194a14f5813fbad7b6744b83 Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Fri, 31 Oct 2014 22:12:06 +0200 Subject: [PATCH] Fix some linting issues --- openlp/core/common/__init__.py | 4 +++- tests/functional/openlp_core_common/test_common.py | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/openlp/core/common/__init__.py b/openlp/core/common/__init__.py index 8929a54de..9f200fea9 100644 --- a/openlp/core/common/__init__.py +++ b/openlp/core/common/__init__.py @@ -232,14 +232,16 @@ def qmd5_hash(salt, data): log.debug('qmd5_hash() returning "%s"' % hash_value) return decode(hash_value.data(), 'ascii') + def clean_button_text(button_text): """ Clean the & and other characters out of button text - + :param button_text: The text to clean """ return button_text.replace('&', '').replace('< ', '').replace(' >', '') + from .openlpmixin import OpenLPMixin from .registry import Registry from .registrymixin import RegistryMixin diff --git a/tests/functional/openlp_core_common/test_common.py b/tests/functional/openlp_core_common/test_common.py index 7398b885e..34231c976 100644 --- a/tests/functional/openlp_core_common/test_common.py +++ b/tests/functional/openlp_core_common/test_common.py @@ -196,9 +196,10 @@ class TestCommonFunctions(TestCase): # GIVEN: Button text input_text = '&Next >' expected_text = 'Next' - + # WHEN: The button caption is sent through the clean_button_text function actual_text = clean_button_text(input_text) - + # THEN: The text should have been cleaned self.assertEqual(expected_text, actual_text, 'The text should be clean') +