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'