fix hashability of dilation objects
This commit is contained in:
parent
e4264971d7
commit
0c9d2c927a
|
@ -455,7 +455,7 @@ class _Record(object):
|
|||
self._framer.send_frame(frame)
|
||||
|
||||
|
||||
@attrs(hash=True)
|
||||
@attrs(cmp=False)
|
||||
class DilatedConnectionProtocol(Protocol, object):
|
||||
"""I manage an L2 connection.
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ NOISEPROTO = b"Noise_NNpsk0_25519_ChaChaPoly_BLAKE2s"
|
|||
def build_noise():
|
||||
return NoiseConnection.from_name(NOISEPROTO)
|
||||
|
||||
@attrs(hash=True)
|
||||
@attrs(cmp=False)
|
||||
@implementer(IDilationConnector)
|
||||
class Connector(object):
|
||||
"""I manage a single generation of connection.
|
||||
|
|
|
@ -87,7 +87,7 @@ def make_side():
|
|||
# * if follower calls w.dilate() but not leader, follower waits forever
|
||||
# in "want", leader waits forever in "wanted"
|
||||
|
||||
@attrs(hash=True)
|
||||
@attrs(cmp=False)
|
||||
@implementer(IDilationManager)
|
||||
class Manager(object):
|
||||
_S = attrib(validator=provides(ISend), repr=False)
|
||||
|
|
|
@ -29,6 +29,10 @@ def make_con(role, use_relay=False):
|
|||
|
||||
|
||||
class Connection(unittest.TestCase):
|
||||
def test_hashable(self):
|
||||
c, n, connector, t, eq = make_con(LEADER)
|
||||
hash(c)
|
||||
|
||||
def test_bad_prologue(self):
|
||||
c, n, connector, t, eq = make_con(LEADER)
|
||||
c.makeConnection(t)
|
||||
|
|
Loading…
Reference in New Issue
Block a user