Fix tests failure due to lack of peer id

Fix it through doing plaintext handshake.
This commit is contained in:
mhchia 2019-08-17 22:11:08 +08:00
parent bb7d37fd4f
commit de8d356955
No known key found for this signature in database
GPG Key ID: 389EFBEA1362589A

View File

@ -30,6 +30,10 @@ class SimpleSecurityTransport(BaseSecureTransport):
)
session = InsecureSession(self, conn, ID(b""))
# TODO: Calls handshake to make them know the peer id each other, otherwise tests fail.
# However, it seems pretty weird that `SimpleSecurityTransport` sends peer id through
# `Insecure`.
await session.run_handshake()
# NOTE: this is abusing the abstraction we have here
# but this code may be deprecated soon and this exists
# mainly to satisfy a test that will go along w/ it
@ -56,6 +60,10 @@ class SimpleSecurityTransport(BaseSecureTransport):
)
session = InsecureSession(self, conn, peer_id)
# TODO: Calls handshake to make them know the peer id each other, otherwise tests fail.
# However, it seems pretty weird that `SimpleSecurityTransport` sends peer id through
# `Insecure`.
await session.run_handshake()
# NOTE: this is abusing the abstraction we have here
# but this code may be deprecated soon and this exists
# mainly to satisfy a test that will go along w/ it