Skip to content
Snippets Groups Projects
Commit 7eb9ea7c authored by inso's avatar inso
Browse files

Fix bug #349

parent 08756cdf
No related branches found
No related tags found
No related merge requests found
...@@ -522,5 +522,5 @@ class Application(QObject): ...@@ -522,5 +522,5 @@ class Application(QObject):
logging.debug("Current version : {0}".format(__version__)) logging.debug("Current version : {0}".format(__version__))
self.available_version = version self.available_version = version
self.version_requested.emit() self.version_requested.emit()
except aiohttp.errors.ClientError as e: except (aiohttp.errors.ClientError, aiohttp.errors.TimeoutError) as e:
logging.debug("Could not connect to github : {0}".format(str(e))) logging.debug("Could not connect to github : {0}".format(str(e)))
import aiohttp
import sys
import unittest
import asyncio
from asynctest.mock import Mock, CoroutineMock, patch
from PyQt5.QtCore import QLocale
from sakia.tests import QuamashTest
from sakia.core import Application
class TestApplication(unittest.TestCase, QuamashTest):
def setUp(self):
self.setUpQuamash()
QLocale.setDefault(QLocale("en_GB"))
def tearDown(self):
self.tearDownQuamash()
@patch('sakia.core.registry.IdentitiesRegistry')
@patch('aiohttp.get', CoroutineMock(side_effect=lambda *args, **kwargs: exec('raise aiohttp.errors.TimeoutError()')))
def test_get_last_version_timeout(self, identities_registry):
app = Application(self.qapplication, self.lp, identities_registry)
async def exec_test():
app.get_last_version()
asyncio.sleep(5)
self.lp.run_until_complete(exec_test())
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment