Remove old test db file in case of schema changes

This commit is contained in:
Ken Roberts 2014-10-21 08:12:43 -07:00
parent 3def1baf9d
commit ed4605be61

View File

@ -29,6 +29,8 @@
""" """
Interface tests to test the themeManager class and related methods. Interface tests to test the themeManager class and related methods.
""" """
import os
from unittest import TestCase from unittest import TestCase
from openlp.core.common import Registry, Settings from openlp.core.common import Registry, Settings
@ -41,7 +43,11 @@ from openlp.core.lib.projector.db import Projector, ProjectorDB
from tests.resources.projector.data import TEST1_DATA, TEST2_DATA, TEST3_DATA from tests.resources.projector.data import TEST1_DATA, TEST2_DATA, TEST3_DATA
tmpfile = '/tmp/openlp-test-projectormanager.sql' tmpfile = '/tmp/openlp-test-projectormanager.sql'
try:
# In case of changed schema, remove old test file
os.remove(tmpfile)
except FileNotFoundError:
pass
class TestProjectorManager(TestCase, TestMixin): class TestProjectorManager(TestCase, TestMixin):
""" """
@ -93,7 +99,7 @@ class TestProjectorManager(TestCase, TestMixin):
self.assertEqual(1, self.projector_manager.load_projectors.call_count, self.assertEqual(1, self.projector_manager.load_projectors.call_count,
'Initialization should have called load_projectors()') 'Initialization should have called load_projectors()')
# THEN: Verify wizard page is initialized # THEN: Verify edit page is initialized
self.assertEqual(type(self.projector_manager.projector_form), ProjectorEditForm, self.assertEqual(type(self.projector_manager.projector_form), ProjectorEditForm,
'Initialization should have created a Projector Edit Form') 'Initialization should have created a Projector Edit Form')
self.assertIs(self.projector_manager.projectordb, self.assertIs(self.projector_manager.projectordb,