@@ -76,7 +76,13 @@ class TestDevSubscription(BicepsSubscription):
7676 expires = 60
7777 notify_ref = 'a ref string'
7878
79- def __init__ (self , filter_ : list [str ], soap_client_pool : SoapClientPool , msg_factory : MessageFactory ):
79+ def __init__ (
80+ self ,
81+ filter_ : list [str ],
82+ soap_client_pool : SoapClientPool ,
83+ msg_factory : MessageFactory ,
84+ test_nbr_reports : int = 1 ,
85+ ):
8086 notify_ref_node = etree .Element (ns_hlp .WSE .tag ('References' ))
8187 ident_node = etree .SubElement (notify_ref_node , ns_hlp .WSE .tag ('Identifier' ))
8288 ident_node .text = self .notify_ref
@@ -100,6 +106,8 @@ def __init__(self, filter_: list[str], soap_client_pool: SoapClientPool, msg_fac
100106 log_prefix = 'test' ,
101107 )
102108 self .reports = []
109+ self ._test_nbr_reports = test_nbr_reports
110+ self .reports_event = threading .Event ()
103111
104112 def send_notification_report (self , body_node : LxmlElement , action : str ):
105113 """Send notification to subscriber."""
@@ -110,6 +118,8 @@ def send_notification_report(self, body_node: LxmlElement, action: str):
110118 )
111119 message = self ._mk_notification_message (info_block , body_node )
112120 self .reports .append (message )
121+ if len (self .reports ) >= self ._test_nbr_reports :
122+ self .reports_event .set ()
113123
114124 async def async_send_notification_report (self , body_node : LxmlElement , action : str ):
115125 """Send notification to subscriber."""
@@ -120,6 +130,8 @@ async def async_send_notification_report(self, body_node: LxmlElement, action: s
120130 )
121131 message = self ._mk_notification_message (info_block , body_node )
122132 self .reports .append (message )
133+ if len (self .reports ) >= self ._test_nbr_reports :
134+ self .reports_event .set ()
123135
124136 async def async_send_notification_end_message (
125137 self ,
@@ -135,7 +147,7 @@ async def async_send_notification_end_message(
135147class SomeDevice (SdcProvider ):
136148 """A device used for unit tests. Some values are predefined."""
137149
138- def __init__ ( # noqa: PLR0913
150+ def __init__ ( # noqa: PLR0913, PLR0917
139151 self ,
140152 wsdiscovery : WsDiscoveryProtocol ,
141153 mdib_xml_data : bytes ,
@@ -189,7 +201,7 @@ def __init__( # noqa: PLR0913
189201 )
190202
191203 @classmethod
192- def from_mdib_file ( # noqa: PLR0913
204+ def from_mdib_file ( # noqa: PLR0913, PLR0917
193205 cls ,
194206 wsdiscovery : WsDiscoveryProtocol ,
195207 epr : str | uuid .UUID | None ,
0 commit comments