Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
sakia
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
clients
python
sakia
Commits
7eb9ea7c
Commit
7eb9ea7c
authored
9 years ago
by
inso
Browse files
Options
Downloads
Patches
Plain Diff
Fix bug
#349
parent
08756cdf
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/sakia/core/app.py
+1
-1
1 addition, 1 deletion
src/sakia/core/app.py
src/sakia/tests/unit/core/test_application.py
+28
-0
28 additions, 0 deletions
src/sakia/tests/unit/core/test_application.py
with
29 additions
and
1 deletion
src/sakia/core/app.py
+
1
−
1
View file @
7eb9ea7c
...
@@ -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
)))
This diff is collapsed.
Click to expand it.
src/sakia/tests/unit/core/test_application.py
0 → 100644
+
28
−
0
View file @
7eb9ea7c
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
())
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment