Skip to content

Commit

Permalink
test mocks: Add some missing bits to the mock peer.
Browse files Browse the repository at this point in the history
  • Loading branch information
sjlongland committed May 7, 2024
1 parent 12769e8 commit a93f869
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/mocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ def __init__(self, station, address):
self._negotiated = False
self._protocol = AX25Version.UNKNOWN

self._modulo128 = False
self._init_connection_modulo = None

# Our fake weakref
def _station(self):
return self._station_ref
Expand All @@ -136,6 +139,14 @@ def address(self):
self.address_read = True
return self._address

def _init_connection(self, extended):
if extended is True:
self._init_connection_modulo = 128
elif extended is False:
self._init_connection_modulo = 8
else:
raise ValueError("Invalid extended value %r" % extended)

def _negotiate(self, callback):
self._negotiate_calls.append(callback)

Expand Down

0 comments on commit a93f869

Please sign in to comment.