Fix different exception raised in test

This commit is contained in:
NIC619
2019-09-17 21:44:48 +08:00
parent f253152858
commit 7243eb9766
2 changed files with 5 additions and 5 deletions

View File

@ -2,8 +2,8 @@ import asyncio
import pytest
from libp2p.network.exceptions import SwarmException
from libp2p.peer.peerinfo import info_from_p2p_addr
from libp2p.protocol_muxer.exceptions import MultiselectClientError
from tests.utils import set_up_nodes_by_transport_opt
PROTOCOL_ID = "/chat/1.0.0"
@ -84,7 +84,7 @@ async def no_common_protocol(host_a, host_b):
host_a.set_stream_handler(PROTOCOL_ID, stream_handler)
# try to creates a new new with a procotol not known by the other host
with pytest.raises(MultiselectClientError):
with pytest.raises(SwarmException):
await host_b.new_stream(host_a.get_id(), ["/fakeproto/0.0.1"])