mirror of
https://github.com/jlu5/SupyPlugins.git
synced 2025-04-27 13:31:10 -05:00
PkgInfo: catch the correct TimeoutError in tests
This commit is contained in:
parent
4f476e0f32
commit
44a5a8c7dd
@ -41,7 +41,7 @@ class PkgInfoTestCase(PluginTestCase):
|
|||||||
' .*?')
|
' .*?')
|
||||||
self.assertError('pkg afdsfsadf asfasfasf')
|
self.assertError('pkg afdsfsadf asfasfasf')
|
||||||
self.assertRegexp('pkg sid afsadfasfsa', 'no such package', re.I)
|
self.assertRegexp('pkg sid afsadfasfsa', 'no such package', re.I)
|
||||||
except TimeoutError:
|
except test.TimeoutError:
|
||||||
raise unittest.SkipTest("Connection timed out.")
|
raise unittest.SkipTest("Connection timed out.")
|
||||||
|
|
||||||
def testVlistCommandBasics(self):
|
def testVlistCommandBasics(self):
|
||||||
@ -58,7 +58,7 @@ class PkgInfoTestCase(PluginTestCase):
|
|||||||
except AssertionError as e:
|
except AssertionError as e:
|
||||||
if "HTTP Error 50" in str(e): # It's not our fault; the API is down.
|
if "HTTP Error 50" in str(e): # It's not our fault; the API is down.
|
||||||
raise unittest.SkipTest("HTTP error 50x; the API's probably down again")
|
raise unittest.SkipTest("HTTP error 50x; the API's probably down again")
|
||||||
except TimeoutError:
|
except test.TimeoutError:
|
||||||
raise unittest.SkipTest("Connection timed out.")
|
raise unittest.SkipTest("Connection timed out.")
|
||||||
|
|
||||||
def testArchaur(self):
|
def testArchaur(self):
|
||||||
@ -68,19 +68,19 @@ class PkgInfoTestCase(PluginTestCase):
|
|||||||
except AssertionError as e:
|
except AssertionError as e:
|
||||||
if "HTTP Error 50" in str(e): # It's not our fault; the API is down.
|
if "HTTP Error 50" in str(e): # It's not our fault; the API is down.
|
||||||
raise unittest.SkipTest("HTTP error 50x; the API's probably down again")
|
raise unittest.SkipTest("HTTP error 50x; the API's probably down again")
|
||||||
except TimeoutError:
|
except test.TimeoutError:
|
||||||
raise unittest.SkipTest("Connection timed out.")
|
raise unittest.SkipTest("Connection timed out.")
|
||||||
|
|
||||||
def testMintPkg(self):
|
def testMintPkg(self):
|
||||||
try:
|
try:
|
||||||
self.assertNotError('mintpkg qiana cinnamon')
|
self.assertNotError('mintpkg qiana cinnamon')
|
||||||
except TimeoutError:
|
except test.TimeoutError:
|
||||||
raise unittest.SkipTest("Connection timed out.")
|
raise unittest.SkipTest("Connection timed out.")
|
||||||
|
|
||||||
def testPkgsearch(self):
|
def testPkgsearch(self):
|
||||||
try:
|
try:
|
||||||
self.assertNotError('pkgsearch debian python')
|
self.assertNotError('pkgsearch debian python')
|
||||||
except TimeoutError:
|
except test.TimeoutError:
|
||||||
raise unittest.SkipTest("Connection timed out.")
|
raise unittest.SkipTest("Connection timed out.")
|
||||||
|
|
||||||
# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
|
# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user