From d1b2cd67c98046bb08c3f46fe0feed345e0ef9b9 Mon Sep 17 00:00:00 2001 From: phill-ridout Date: Sat, 6 Jul 2013 15:40:49 +0100 Subject: [PATCH] Fixed if statment logic. Fixed test --- openlp/plugins/songs/lib/ewimport.py | 2 +- tests/functional/openlp_plugins/songs/test_ewimport.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/openlp/plugins/songs/lib/ewimport.py b/openlp/plugins/songs/lib/ewimport.py index 2f7681b7e..b548b32e2 100644 --- a/openlp/plugins/songs/lib/ewimport.py +++ b/openlp/plugins/songs/lib/ewimport.py @@ -78,7 +78,7 @@ class EasyWorshipSongImport(SongImport): def doImport(self): # Open the DB and MB files if they exist import_source_mb = self.import_source.replace('.DB', '.MB') - if not (os.path.isfile(self.import_source) or not os.path.isfile(import_source_mb)): + if not os.path.isfile(self.import_source) or not os.path.isfile(import_source_mb): return db_size = os.path.getsize(self.import_source) if db_size < 0x800: diff --git a/tests/functional/openlp_plugins/songs/test_ewimport.py b/tests/functional/openlp_plugins/songs/test_ewimport.py index 2190a7cfd..0e6956461 100644 --- a/tests/functional/openlp_plugins/songs/test_ewimport.py +++ b/tests/functional/openlp_plugins/songs/test_ewimport.py @@ -240,7 +240,7 @@ class TestEasyWorshipSongImport(TestCase): patch(u'openlp.plugins.songs.lib.ewimport.os.path') as mocked_os_path: mocked_manager = MagicMock() importer = EasyWorshipSongImport(mocked_manager) - mocked_os_path.isfile.return_value = False + mocked_os_path.isfile.side_effect = [True, False] # WHEN: Supplied with an import source importer.import_source = u'Songs.DB'