commit 9d7cf12244a0a519e7b65398e4783ab9ea64ba05
parent 952e9b87e14b93dd82b603ffdd749a1d8a48212b
Author: SomberNight <somber.night@protonmail.com>
Date: Tue, 25 Sep 2018 17:00:43 +0200
follow-up prev: fix tests
Diffstat:
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/electrum/tests/test_network.py b/electrum/tests/test_network.py
@@ -7,10 +7,17 @@ from electrum.simple_config import SimpleConfig
from electrum import blockchain
from electrum.interface import Interface
+class MockTaskGroup:
+ async def spawn(self, x): return
+
+class MockNetwork:
+ main_taskgroup = MockTaskGroup()
+ asyncio_loop = asyncio.get_event_loop()
+
class MockInterface(Interface):
def __init__(self, config):
self.config = config
- super().__init__(None, 'mock-server:50000:t', self.config.electrum_path(), None)
+ super().__init__(MockNetwork(), 'mock-server:50000:t', self.config.electrum_path(), None)
self.q = asyncio.Queue()
self.blockchain = blockchain.Blockchain(self.config, 2002, None)
self.tip = 12