diff --git a/acapy_agent/transport/inbound/tests/test_http_transport.py b/acapy_agent/transport/inbound/tests/test_http_transport.py index 772ded4509..f6a76c39e2 100644 --- a/acapy_agent/transport/inbound/tests/test_http_transport.py +++ b/acapy_agent/transport/inbound/tests/test_http_transport.py @@ -17,9 +17,10 @@ class TestHttpTransport(AioHTTPTestCase): - def setUp(self): + async def asyncSetUp(self): self.message_results = [] self.port = unused_port() + self.profile = await create_test_profile() self.session = None self.transport = HttpTransport( "0.0.0.0", self.port, self.create_session, max_message_size=65535 @@ -28,7 +29,10 @@ def setUp(self): assert not self.transport.wire_format.get_recipient_keys(None) # cover method self.result_event = None self.response_message = None - super().setUp() + await super().asyncSetUp() + + def get_profile(self): + return self.profile def create_session( self, @@ -41,7 +45,7 @@ def create_session( ): if not self.session: session = InboundSession( - profile=mock.MagicMock(), + profile=self.get_profile(), can_respond=can_respond, inbound_handler=self.receive_message, session_id=None, @@ -78,7 +82,6 @@ async def test_start_x(self): with pytest.raises(test_module.InboundTransportSetupError): await self.transport.start() - @pytest.mark.skip(reason="Need to fix") async def test_send_message(self): await self.transport.start() @@ -93,7 +96,6 @@ async def test_send_message(self): await self.transport.stop() - @pytest.mark.skip(reason="Need to fix") async def test_send_receive_message(self): await self.transport.start() diff --git a/acapy_agent/transport/inbound/tests/test_ws_transport.py b/acapy_agent/transport/inbound/tests/test_ws_transport.py index bf89a8c4ba..4790199626 100644 --- a/acapy_agent/transport/inbound/tests/test_ws_transport.py +++ b/acapy_agent/transport/inbound/tests/test_ws_transport.py @@ -21,19 +21,18 @@ async def asyncSetUp(self): self.message_results = [] self.port = unused_port() self.session = None - self.root_profile = await create_test_profile() + self.profile = await create_test_profile() self.transport = WsTransport( - "0.0.0.0", - self.port, - self.create_session, - root_profile=self.root_profile, + "0.0.0.0", self.port, self.create_session, root_profile=self.profile ) self.transport.wire_format = JsonWireFormat() self.result_event = None - await super().asyncSetUp() - async def create_session( + def get_profile(self): + return self.profile + + def create_session( self, transport_type, *, @@ -44,7 +43,7 @@ async def create_session( ): if not self.session: session = InboundSession( - profile=self.root_profile, + profile=self.get_profile(), can_respond=can_respond, inbound_handler=self.receive_message, session_id=None, @@ -57,8 +56,8 @@ async def create_session( result.set_result(self.session) return result - async def get_application(self): - return await self.transport.make_application() + def get_application(self): + return self.transport.make_application() def receive_message( self, @@ -78,7 +77,6 @@ async def test_start_x(self): with pytest.raises(test_module.InboundTransportSetupError): await self.transport.start() - @pytest.mark.skip(reason="Need to fix") async def test_message_and_response(self): await self.transport.start()