resolution of connection classes
- remove ConnectionG3Client - remove ConnectionG3Server - remove ConnectionG3PClient - remove ConnectionG3PServer
This commit is contained in:
@@ -5,8 +5,8 @@ import asyncio
|
||||
from itertools import count
|
||||
from mock import patch
|
||||
from app.src.async_stream import StreamPtr
|
||||
from app.src.async_stream import AsyncStream, AsyncIfcImpl
|
||||
from app.src.gen3.connection_g3 import ConnectionG3Server
|
||||
from app.src.async_stream import AsyncStream, AsyncStreamServer, AsyncIfcImpl
|
||||
from app.src.gen3.connection_g3 import ConnectionG3
|
||||
from app.src.gen3.talent import Talent
|
||||
|
||||
|
||||
@@ -75,24 +75,26 @@ class FakeWriter():
|
||||
|
||||
|
||||
|
||||
def test_method_calls(patch_talent_init, patch_healthy, patch_async_close, patch_talent_close):
|
||||
def test_method_calls(patch_healthy, patch_async_close):
|
||||
AsyncIfcImpl._ids = count(5)
|
||||
spy2 = patch_talent_init
|
||||
spy3 = patch_healthy
|
||||
spy4 = patch_async_close
|
||||
spy5 = patch_talent_close
|
||||
reader = FakeReader()
|
||||
writer = FakeWriter()
|
||||
id_str = "id_string"
|
||||
addr = ('proxy.local', 10000)
|
||||
conn = ConnectionG3Server(FakeInverter(), reader, writer, addr,
|
||||
id_str=id_str)
|
||||
assert 5 == conn._ifc.get_conn_no()
|
||||
spy2.assert_called_once_with(conn, True, conn._ifc, id_str)
|
||||
inv = FakeInverter()
|
||||
ifc = AsyncStreamServer(reader, writer,
|
||||
inv.async_publ_mqtt,
|
||||
inv.async_create_remote,
|
||||
inv.remote)
|
||||
|
||||
conn = ConnectionG3(addr, ifc, server_side=True, id_str=id_str)
|
||||
assert 5 == conn.conn_no
|
||||
assert 5 == conn.ifc.get_conn_no()
|
||||
conn.healthy()
|
||||
|
||||
spy3.assert_called_once()
|
||||
|
||||
conn.close()
|
||||
spy4.assert_called_once()
|
||||
spy5.assert_called_once()
|
||||
|
||||
Reference in New Issue
Block a user