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
de31170f
Commit
de31170f
authored
9 years ago
by
inso
Browse files
Options
Downloads
Patches
Plain Diff
Opening async dialog in test
parent
190230d7
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/cutecoin/gui/process_cfg_community.py
+0
-1
0 additions, 1 deletion
src/cutecoin/gui/process_cfg_community.py
src/cutecoin/tests/process_cfg_community/test_add_community.py
+7
-4
7 additions, 4 deletions
...utecoin/tests/process_cfg_community/test_add_community.py
with
7 additions
and
5 deletions
src/cutecoin/gui/process_cfg_community.py
+
0
−
1
View file @
de31170f
...
...
@@ -270,7 +270,6 @@ class ProcessConfigureCommunity(QDialog, Ui_CommunityConfigurationDialog):
action
.
setEnabled
(
False
)
menu
.
exec_
(
QCursor
.
pos
())
@asyncio.coroutine
def
async_exec
(
self
):
future
=
asyncio
.
Future
()
self
.
finished
.
connect
(
lambda
r
:
future
.
set_result
(
r
))
...
...
This diff is collapsed.
Click to expand it.
src/cutecoin/tests/process_cfg_community/test_add_community.py
+
7
−
4
View file @
de31170f
...
...
@@ -5,7 +5,7 @@ import asyncio
import
quamash
import
logging
import
time
from
PyQt5.QtWidgets
import
Q
MessageBox
from
PyQt5.QtWidgets
import
Q
Dialog
from
PyQt5.QtCore
import
QLocale
,
Qt
from
PyQt5.QtTest
import
QTest
from
cutecoin.tests.mocks.bma
import
new_blockchain
...
...
@@ -45,15 +45,16 @@ class ProcessAddCommunity(unittest.TestCase):
process_community
=
ProcessConfigureCommunity
(
self
.
application
,
self
.
account
,
None
,
self
.
password_asker
)
@asyncio.coroutine
def
open_dialog
():
def
open_dialog
(
process_community
):
result
=
yield
from
process_community
.
async_exec
()
self
.
assertEqual
(
result
,
QDialog
.
Accepted
)
@asyncio.coroutine
def
exec_test
():
mock
=
new_blockchain
.
get_mock
()
logging
.
debug
(
mock
.
pretend_url
)
asyncio
.
async
(
open_dialog
())
yield
from
asyncio
.
sleep
(
1
)
self
.
network_manager
.
set_mock_path
(
mock
.
pretend_url
)
QTest
.
mouseClick
(
process_community
.
lineedit_server
,
Qt
.
LeftButton
)
...
...
@@ -82,8 +83,10 @@ class ProcessAddCommunity(unittest.TestCase):
self
.
assertEqual
(
process_community
.
stacked_pages
.
currentWidget
(),
process_community
.
page_add_nodes
)
QTest
.
mouseClick
(
process_community
.
button_next
,
Qt
.
LeftButton
)
self
.
lp
.
run_until_complete
(
asyncio
.
wait_for
(
exec_test
(),
timeout
=
10
))
asyncio
.
async
(
exec_test
())
self
.
lp
.
run_until_complete
(
open_dialog
(
process_community
))
if
__name__
==
'
__main__
'
:
logging
.
basicConfig
(
stream
=
sys
.
stderr
)
...
...
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