diff --git a/src/cutecoin/gui/process_cfg_community.py b/src/cutecoin/gui/process_cfg_community.py index 73e8415fcc630207a298be4c820bad1f2b92b767..55481d5b581a94453a39957595bed86ef196375d 100644 --- a/src/cutecoin/gui/process_cfg_community.py +++ b/src/cutecoin/gui/process_cfg_community.py @@ -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)) diff --git a/src/cutecoin/tests/process_cfg_community/test_add_community.py b/src/cutecoin/tests/process_cfg_community/test_add_community.py index 1e7d74dbd7de708a01951c2c86959dd540ee005a..0a14ac2ca0a873d68287ee0284f2fcaa88934dd8 100644 --- a/src/cutecoin/tests/process_cfg_community/test_add_community.py +++ b/src/cutecoin/tests/process_cfg_community/test_add_community.py @@ -5,7 +5,7 @@ import asyncio import quamash import logging import time -from PyQt5.QtWidgets import QMessageBox +from PyQt5.QtWidgets import QDialog 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 )