@@ -57,6 +57,7 @@ def _make_download(self, url, destination, cancel=False):
57
57
58
58
loop .exec_ ()
59
59
60
+ @unittest .skipIf (os .environ .get ('TRAVIS' , '' ) == 'true' , 'Test with http://www.qgis.org unstable. Needs local server.' )
60
61
def test_validDownload (self ):
61
62
"""Tests a valid download"""
62
63
destination = tempfile .mktemp ()
@@ -81,6 +82,7 @@ def test_inValidDownload(self):
81
82
self .assertEqual (self .error_args [1 ], [u'Download failed: Host www.doesnotexistofthatimsure.qgis not found' ])
82
83
self .assertFalse (os .path .isfile (destination ))
83
84
85
+ @unittest .skipIf (os .environ .get ('TRAVIS' , '' ) == 'true' , 'Test with http://www.github.com unstable. Needs local server.' )
84
86
def test_dowloadCanceled (self ):
85
87
"""Tests user canceled download"""
86
88
destination = tempfile .mktemp ()
@@ -101,6 +103,7 @@ def test_InvalidUrl(self):
101
103
self .assertFalse (os .path .isfile (destination ))
102
104
self .assertEqual (self .error_args [1 ], [u"Download failed: Protocol \" xyz\" is unknown" ])
103
105
106
+ @unittest .skipIf (os .environ .get ('TRAVIS' , '' ) == 'true' , 'Test with http://www.github.com unstable. Needs local server.' )
104
107
def test_InvalidFile (self ):
105
108
self ._make_download ('https://github.com/qgis/QGIS/archive/master.zip' , "" )
106
109
self .assertTrue (self .exited_was_called )
@@ -132,6 +135,7 @@ def ssl_compare(self, name, url, error):
132
135
result = ';' .join (result )
133
136
self .assertTrue (result .startswith (error ), msg + "expected:\n %s\n actual:\n %s\n " % (result , error ))
134
137
138
+ @unittest .skipIf (os .environ .get ('TRAVIS' , '' ) == 'true' , 'Test with badssl.com unstable. Needs local server.' )
135
139
def test_sslExpired (self ):
136
140
self .ssl_compare ("expired" , "https://expired.badssl.com/" , "SSL Errors: ;The certificate has expired" )
137
141
self .ssl_compare ("self-signed" , "https://self-signed.badssl.com/" , "SSL Errors: ;The certificate is self-signed, and untrusted" )
0 commit comments