~thelinuxguy/openlp/bible-improvements

« back to all changes in this revision

Viewing changes to tests/interfaces/openlp_core/common/test_utils.py

  • Committer: Phill Ridout
  • Author(s): Phill
  • Date: 2017-12-24 09:57:44 UTC
  • mfrom: (2794.2.15 moar_test_clean_ups)
  • Revision ID: phill.ridout@gmail.com-20171224095744-obpddogyghy1z0m6
Move song test resources

lp:~phill-ridout/openlp/moar_test_cleanups (revision 2809)
https://ci.openlp.io/job/Branch-01-Pull/2390/                          [WAITING]
[RUNNING]
[SUCCESS]
https://ci.openlp.io/job/Branch-02a-Linux-Tests/2291/                  [WAITING]
[RUNNING]
[SUCCESS]
https://ci.openlp.io/job/Branch-02b-macOS-Tests/86/                    [WAITING]
[SUCCESS]
https://ci.openlp.io/job/Branch-03a-Build-Source/11/                   [WAITING]
[SUCCESS]
https://ci.openlp.io/job/Bra...

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
from unittest import TestCase
26
26
 
27
27
from openlp.core.common import is_not_image_file
28
 
from openlp.core.common.path import Path
29
 
from tests.utils.constants import TEST_RESOURCES_PATH
 
28
 
 
29
from tests.utils.constants import RESOURCE_PATH
30
30
from tests.helpers.testmixin import TestMixin
31
31
 
32
32
 
59
59
        Test the method handles an image file
60
60
        """
61
61
        # Given and empty string
62
 
        file_name = Path(TEST_RESOURCES_PATH, 'church.jpg')
 
62
        file_path = RESOURCE_PATH / 'church.jpg'
63
63
 
64
64
        # WHEN testing for it
65
 
        result = is_not_image_file(file_name)
 
65
        result = is_not_image_file(file_path)
66
66
 
67
67
        # THEN the result is false
68
68
        assert result is False, 'The file is present so the test should return False'
72
72
        Test the method handles a non image file
73
73
        """
74
74
        # Given and empty string
75
 
        file_name = Path(TEST_RESOURCES_PATH, 'serviceitem_custom_1.osj')
 
75
        file_path = RESOURCE_PATH / 'serviceitem_custom_1.osj'
76
76
 
77
77
        # WHEN testing for it
78
 
        result = is_not_image_file(file_name)
 
78
        result = is_not_image_file(file_path)
79
79
 
80
80
        # THEN the result is false
81
81
        assert result is True, 'The file is not an image file so the test should return True'