Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[travis] Disable non-local file download tests #7738

Merged
merged 1 commit into from
Aug 28, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions tests/src/python/test_qgsfiledownloader.py
Original file line number Diff line number Diff line change
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