Skip to content
Permalink
Browse files

[travis] Disable non-local file download tests

(cherry picked from commit 8d8f38d)
  • Loading branch information
m-kuhn authored and jef-n committed Nov 9, 2017
1 parent f371d9d commit 2210fd140c8baf43105abc24756ab99372680d0c
Showing with 4 additions and 0 deletions.
  1. +4 −0 tests/src/python/test_qgsfiledownloader.py
@@ -57,6 +57,7 @@ def _make_download(self, url, destination, cancel=False):

loop.exec_()

@unittest.skipIf(os.environ.get('TRAVIS', '') == 'true', 'Test with http://www.qgis.org unstable. Needs local server.')
def test_validDownload(self):
"""Tests a valid download"""
destination = tempfile.mktemp()
@@ -81,6 +82,7 @@ def test_inValidDownload(self):
self.assertEqual(self.error_args[1], [u'Download failed: Host www.doesnotexistofthatimsure.qgis not found'])
self.assertFalse(os.path.isfile(destination))

@unittest.skipIf(os.environ.get('TRAVIS', '') == 'true', 'Test with http://www.github.com unstable. Needs local server.')
def test_dowloadCanceled(self):
"""Tests user canceled download"""
destination = tempfile.mktemp()
@@ -101,6 +103,7 @@ def test_InvalidUrl(self):
self.assertFalse(os.path.isfile(destination))
self.assertEqual(self.error_args[1], [u"Download failed: Protocol \"xyz\" is unknown"])

@unittest.skipIf(os.environ.get('TRAVIS', '') == 'true', 'Test with http://www.github.com unstable. Needs local server.')
def test_InvalidFile(self):
self._make_download('https://github.com/qgis/QGIS/archive/master.zip', "")
self.assertTrue(self.exited_was_called)
@@ -132,6 +135,7 @@ def ssl_compare(self, name, url, error):
result = ';'.join(result)
self.assertEqual(result, error, msg + "expected:\n%s\nactual:\n%s\n" % (error, result))

@unittest.skipIf(os.environ.get('TRAVIS', '') == 'true', 'Test with badssl.com unstable. Needs local server.')
def test_sslExpired(self):
self.ssl_compare("expired", "https://expired.badssl.com/", "SSL Errors: ;The certificate has expired")
self.ssl_compare("self-signed", "https://self-signed.badssl.com/", "SSL Errors: ;The certificate has expired;The certificate is self-signed, and untrusted")

0 comments on commit 2210fd1

Please sign in to comment.
You can’t perform that action at this time.