From 7450c019461ab27bd6ad61139e7b6c22393b2661 Mon Sep 17 00:00:00 2001
From: Inso <insomniak.fr@gmail.com>
Date: Sun, 6 Sep 2015 17:30:35 +0200
Subject: [PATCH] Change the mock instanciation location

---
 src/cutecoin/tests/certification/test_certification.py        | 4 ++--
 .../tests/process_cfg_community/test_add_community.py         | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/cutecoin/tests/certification/test_certification.py b/src/cutecoin/tests/certification/test_certification.py
index 0dd7d189..a732c738 100644
--- a/src/cutecoin/tests/certification/test_certification.py
+++ b/src/cutecoin/tests/certification/test_certification.py
@@ -62,6 +62,8 @@ class TestCertificationDialog(unittest.TestCase):
             asyncio.set_event_loop(None)
 
     def test_certification_init_community(self):
+        mock = init_new_community.get_mock()
+        logging.debug(mock.pretend_url)
         certification_dialog = CertificationDialog(self.application,
                                                    self.account,
                                                    self.password_asker)
@@ -77,8 +79,6 @@ class TestCertificationDialog(unittest.TestCase):
 
         @asyncio.coroutine
         def exec_test():
-            mock = init_new_community.get_mock()
-            logging.debug(mock.pretend_url)
             yield from asyncio.sleep(1)
             self.network_manager.set_mock_path(mock.pretend_url)
             self.assertEqual(certification_dialog.button_box.button(QDialogButtonBox.Ok).text(), "&Ok")
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 ca2c06e3..f4811752 100644
--- a/src/cutecoin/tests/process_cfg_community/test_add_community.py
+++ b/src/cutecoin/tests/process_cfg_community/test_add_community.py
@@ -42,6 +42,8 @@ class ProcessAddCommunity(unittest.TestCase):
             asyncio.set_event_loop(None)
 
     def test_add_community_empty_blockchain(self):
+        mock = new_blockchain.get_mock()
+        logging.debug(mock.pretend_url)
         process_community = ProcessConfigureCommunity(self.application,
                                                     self.account,
                                                     None, self.password_asker)
@@ -57,8 +59,6 @@ class ProcessAddCommunity(unittest.TestCase):
 
         @asyncio.coroutine
         def exec_test():
-            mock = new_blockchain.get_mock()
-            logging.debug(mock.pretend_url)
             yield from asyncio.sleep(1)
             self.network_manager.set_mock_path(mock.pretend_url)
             QTest.mouseClick(process_community.lineedit_server, Qt.LeftButton)
-- 
GitLab