Opt-out of linting on the special cases we have, given new ignore rules
This commit is contained in:
parent
03b1304fe7
commit
cb301fcc51
|
@ -53,9 +53,10 @@ async def run(port, destination, localhost):
|
|||
print(
|
||||
f"Run 'python ./examples/chat/chat.py"
|
||||
+ localhost_opt
|
||||
+ f" -p {int(port) + 1} -d /ip4/{ip}/tcp/{port}/p2p/{host.get_id().pretty()}' on another console.\n"
|
||||
+ f" -p {int(port) + 1} -d /ip4/{ip}/tcp/{port}/p2p/{host.get_id().pretty()}'"
|
||||
+ " on another console."
|
||||
)
|
||||
print("\nWaiting for incoming connection\n\n")
|
||||
print("Waiting for incoming connection...")
|
||||
|
||||
else: # its the client
|
||||
maddr = multiaddr.Multiaddr(destination)
|
||||
|
|
|
@ -143,7 +143,7 @@ class Pubsub:
|
|||
|
||||
# NOTE: Check if `rpc_incoming.control` is set through `HasField`.
|
||||
# This is necessary because `control` is an optional field in pb2.
|
||||
# Ref: https://developers.google.com/protocol-buffers/docs/reference/python-generated#singular-fields-proto2
|
||||
# Ref: https://developers.google.com/protocol-buffers/docs/reference/python-generated#singular-fields-proto2 # noqa: E501
|
||||
if rpc_incoming.HasField("control"):
|
||||
# Pass rpc to router so router could perform custom logic
|
||||
await self.router.handle_rpc(rpc_incoming, peer_id)
|
||||
|
|
|
@ -8,6 +8,7 @@ from libp2p.peer.peerdata import PeerData
|
|||
from libp2p.peer.peerinfo import InvalidAddrError, PeerInfo, info_from_p2p_addr
|
||||
|
||||
ALPHABETS = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"
|
||||
VALID_MULTI_ADDR_STR = "/ip4/127.0.0.1/tcp/8000/p2p/3YgLAeMKSAPcGqZkAt8mREqhQXmJT8SN8VCMN4T6ih4GNX9wvK8mWJnWZ1qA2mLdCQ" # noqa: E501
|
||||
|
||||
|
||||
def test_init_():
|
||||
|
@ -47,9 +48,7 @@ def test_info_from_p2p_addr_invalid(addr):
|
|||
|
||||
|
||||
def test_info_from_p2p_addr_valid():
|
||||
m_addr = multiaddr.Multiaddr(
|
||||
"/ip4/127.0.0.1/tcp/8000/p2p/3YgLAeMKSAPcGqZkAt8mREqhQXmJT8SN8VCMN4T6ih4GNX9wvK8mWJnWZ1qA2mLdCQ"
|
||||
)
|
||||
m_addr = multiaddr.Multiaddr(VALID_MULTI_ADDR_STR)
|
||||
info = info_from_p2p_addr(m_addr)
|
||||
assert (
|
||||
info.peer_id.pretty()
|
||||
|
|
Loading…
Reference in New Issue
Block a user