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