diff --git a/openlp/plugins/presentations/lib/impresscontroller.py b/openlp/plugins/presentations/lib/impresscontroller.py index d231acb05..1db6b9e68 100644 --- a/openlp/plugins/presentations/lib/impresscontroller.py +++ b/openlp/plugins/presentations/lib/impresscontroller.py @@ -46,6 +46,7 @@ from openlp.plugins.presentations.lib.presentationcontroller import Presentation if is_win(): from win32com.client import Dispatch import pywintypes + uno_available = False # Declare an empty exception to match the exception imported from UNO class ErrorCodeIOException(Exception): diff --git a/scripts/appveyor.yml b/scripts/appveyor.yml index 43f14e69d..3187a7b9f 100644 --- a/scripts/appveyor.yml +++ b/scripts/appveyor.yml @@ -1,5 +1,8 @@ version: OpenLP-win-ci-b{build} +image: + - Visual Studio 2017 + clone_script: - curl -L https://bazaar.launchpad.net/BRANCHPATH/tarball -o sourcecode.tar.gz - 7z e sourcecode.tar.gz @@ -11,7 +14,7 @@ environment: install: # Install dependencies from pypi - - "%PYTHON%\\python.exe -m pip install sqlalchemy alembic appdirs chardet beautifulsoup4 lxml Mako mysql-connector-python nose mock pyodbc psycopg2 pypiwin32 websockets asyncio waitress six webob requests QtAwesome PyQt5 pymediainfo" + - "%PYTHON%\\python.exe -m pip install sqlalchemy alembic appdirs chardet beautifulsoup4 lxml Mako mysql-connector-python pytest mock pyodbc psycopg2 pypiwin32 websockets asyncio waitress six webob requests QtAwesome PyQt5 pymediainfo" # Download and unpack mupdf - appveyor DownloadFile https://mupdf.com/downloads/archive/mupdf-1.14.0-windows.zip - 7z x mupdf-1.14.0-windows.zip @@ -27,7 +30,7 @@ build: off test_script: - cd openlp-branch # Run the tests - - "%PYTHON%\\python.exe -m nose -v tests" + - "%PYTHON%\\python.exe -m pytest -v tests" # Go back to the user root folder - cd.. diff --git a/tests/functional/openlp_core/api/test_deploy.py b/tests/functional/openlp_core/api/test_deploy.py index 784605034..75fc62cfb 100644 --- a/tests/functional/openlp_core/api/test_deploy.py +++ b/tests/functional/openlp_core/api/test_deploy.py @@ -15,13 +15,12 @@ # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for # # more details. # # # - - -# Temple Place, Suite 330, Boston, MA 02111-1307 USA # -############################################################################### -from tempfile import mkdtemp # You should have received a copy of the GNU General Public License along # # with this program; if not, write to the Free Software Foundation, Inc., 59 # +# Temple Place, Suite 330, Boston, MA 02111-1307 USA # +############################################################################### +import os +from tempfile import mkdtemp from unittest import TestCase from unittest.mock import MagicMock, patch @@ -57,14 +56,15 @@ class TestRemoteDeploy(TestCase): # GIVEN: A new downloaded zip file mocked_zipfile = MagicMock() MockZipFile.return_value = mocked_zipfile - root_path = Path('/tmp/remotes') + root_path_str = '{sep}tmp{sep}remotes'.format(sep=os.sep) + root_path = Path(root_path_str) # WHEN: deploy_zipfile() is called deploy_zipfile(root_path, 'site.zip') # THEN: the zip file should have been extracted to the right location - MockZipFile.assert_called_once_with('/tmp/remotes/site.zip') - mocked_zipfile.extractall.assert_called_once_with('/tmp/remotes') + MockZipFile.assert_called_once_with(root_path_str + os.sep + 'site.zip') + mocked_zipfile.extractall.assert_called_once_with(root_path_str) @patch('openlp.core.api.deploy.Registry') @patch('openlp.core.api.deploy.get_web_page') diff --git a/tests/functional/openlp_core/common/test_path.py b/tests/functional/openlp_core/common/test_path.py index 7c0a34635..8695b58f1 100644 --- a/tests/functional/openlp_core/common/test_path.py +++ b/tests/functional/openlp_core/common/test_path.py @@ -324,7 +324,7 @@ class TestPath(TestCase): obj = path.json_object(extra=1, args=2) # THEN: A JSON decodable object should have been returned. - assert obj == {'__Path__': ('/', 'base', 'path', 'to', 'fi.le')} + assert obj == {'__Path__': (os.sep, 'base', 'path', 'to', 'fi.le')} def test_path_json_object_base_path(self): """ diff --git a/tests/utils/test_bzr_tags.py b/tests/utils/test_bzr_tags.py index e6c00f707..cd057ada4 100644 --- a/tests/utils/test_bzr_tags.py +++ b/tests/utils/test_bzr_tags.py @@ -24,7 +24,7 @@ Package to test for proper bzr tags. """ import os from subprocess import PIPE, Popen -from unittest import TestCase +from unittest import TestCase, SkipTest TAGS1 = {'1.9.0', '1.9.1', '1.9.2', '1.9.3', '1.9.4', '1.9.5', '1.9.6', '1.9.7', '1.9.8', '1.9.9', '1.9.10', @@ -42,7 +42,10 @@ class TestBzrTags(TestCase): path = os.path.dirname(__file__) # WHEN getting the branches tags - bzr = Popen(('bzr', 'tags', '--directory=' + path), stdout=PIPE) + try: + bzr = Popen(('bzr', 'tags', '--directory=' + path), stdout=PIPE) + except: + raise SkipTest('bzr is not installed') std_out = bzr.communicate()[0] count = len(TAGS1) tags = [line.decode('utf-8').split()[0] for line in std_out.splitlines()]