Changeset View
Changeset View
Standalone View
Standalone View
test/functional/example_test.py
Show All 30 Lines | |||||
# message is received from the node-under-test. Subclass P2PInterface and | # message is received from the node-under-test. Subclass P2PInterface and | ||||
# override the on_*() methods if you need custom behaviour. | # override the on_*() methods if you need custom behaviour. | ||||
class BaseNode(P2PInterface): | class BaseNode(P2PInterface): | ||||
def __init__(self): | def __init__(self): | ||||
"""Initialize the P2PInterface | """Initialize the P2PInterface | ||||
Used to inialize custom properties for the Node that aren't | Used to initialize custom properties for the Node that aren't | ||||
included by default in the base class. Be aware that the P2PInterface | included by default in the base class. Be aware that the P2PInterface | ||||
base class already stores a counter for each P2P message type and the | base class already stores a counter for each P2P message type and the | ||||
last received message of each type, which should be sufficient for the | last received message of each type, which should be sufficient for the | ||||
needs of most tests. | needs of most tests. | ||||
Call super().__init__() first for standard initialization and then | Call super().__init__() first for standard initialization and then | ||||
initialize custom properties.""" | initialize custom properties.""" | ||||
super().__init__() | super().__init__() | ||||
▲ Show 20 Lines • Show All 169 Lines • Show Last 20 Lines |