Skip to content

Commit

Permalink
[travis] Disable non-local file download tests
Browse files Browse the repository at this point in the history
(cherry picked from commit 8d8f38d)
  • Loading branch information
m-kuhn authored and jef-n committed Aug 28, 2018
1 parent f371d9d commit 2210fd1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/src/python/test_qgsfiledownloader.py
Expand Up @@ -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()
Expand All @@ -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()
Expand All @@ -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)
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit 2210fd1

Please sign in to comment.