Fixed if statment logic.

Fixed test
This commit is contained in:
phill-ridout 2013-07-06 15:40:49 +01:00
parent 15153ace9c
commit d1b2cd67c9
2 changed files with 2 additions and 2 deletions

View File

@ -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:

View File

@ -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'