From 000b06ffe659afe65b7b81da640e173d79841935 Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Fri, 7 Dec 2012 22:52:55 +0200 Subject: [PATCH] Moved the _get_frozen_path() test to the proper test case. --- .../openlp_core_utils/test_applocation.py | 16 ---------------- .../functional/openlp_core_utils/test_utils.py | 18 +++++++++++++++++- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/tests/functional/openlp_core_utils/test_applocation.py b/tests/functional/openlp_core_utils/test_applocation.py index f558c93f0..999fe3d29 100644 --- a/tests/functional/openlp_core_utils/test_applocation.py +++ b/tests/functional/openlp_core_utils/test_applocation.py @@ -11,22 +11,6 @@ class TestAppLocation(TestCase): """ A test suite to test out various methods around the AppLocation class. """ - def get_frozen_path_test(self): - """ - Test the _get_frozen_path() function - """ - with patch(u'openlp.core.utils.sys') as mocked_sys: - # GIVEN: The sys module "without" a "frozen" attribute - mocked_sys.frozen = None - # WHEN: We call _get_frozen_path() with two parameters - # THEN: The non-frozen parameter is returned - assert _get_frozen_path(u'frozen', u'not frozen') == u'not frozen', u'Should return "not frozen"' - # GIVEN: The sys module *with* a "frozen" attribute - mocked_sys.frozen = 1 - # WHEN: We call _get_frozen_path() with two parameters - # THEN: The frozen parameter is returned - assert _get_frozen_path(u'frozen', u'not frozen') == u'frozen', u'Should return "frozen"' - def get_data_path_test(self): """ Test the AppLocation.get_data_path() method diff --git a/tests/functional/openlp_core_utils/test_utils.py b/tests/functional/openlp_core_utils/test_utils.py index dd5c44e90..148380cbe 100644 --- a/tests/functional/openlp_core_utils/test_utils.py +++ b/tests/functional/openlp_core_utils/test_utils.py @@ -5,7 +5,7 @@ from unittest import TestCase from mock import patch -from openlp.core.utils import get_filesystem_encoding +from openlp.core.utils import get_filesystem_encoding, _get_frozen_path class TestUtils(TestCase): """ @@ -17,3 +17,19 @@ class TestUtils(TestCase): """ assert False, u'This test needs to be written' + def get_frozen_path_test(self): + """ + Test the _get_frozen_path() function + """ + with patch(u'openlp.core.utils.sys') as mocked_sys: + # GIVEN: The sys module "without" a "frozen" attribute + mocked_sys.frozen = None + # WHEN: We call _get_frozen_path() with two parameters + # THEN: The non-frozen parameter is returned + assert _get_frozen_path(u'frozen', u'not frozen') == u'not frozen', u'Should return "not frozen"' + # GIVEN: The sys module *with* a "frozen" attribute + mocked_sys.frozen = 1 + # WHEN: We call _get_frozen_path() with two parameters + # THEN: The frozen parameter is returned + assert _get_frozen_path(u'frozen', u'not frozen') == u'frozen', u'Should return "frozen"' +