@@ -29,6 +29,9 @@ def rpc(self, pv, op):
2929 def onFirstConnect (self , pv ):
3030 self .calls .append (("onFirstConnect" , pv ))
3131
32+ def onLastDisconnect (self , pv ):
33+ self .calls .append (("onLastDisconnect" , pv ))
34+
3235 def close (self , pv ):
3336 self .calls .append (("close" , pv ))
3437
@@ -136,18 +139,18 @@ def test_onFirstConnect_deprecated(self):
136139 self .comp .onFirstConnect (self .pv )
137140 self .assertEqual (self .h1 .calls [0 ], ("onFirstConnect" , self .pv ))
138141
139- def test_on_last_connect_calls_all (self ):
140- self .comp .on_last_connect (self .pv )
141- self .assertEqual (self .h1 .calls [0 ], ("onFirstConnect " , self .pv ))
142- self .assertEqual (self .h2 .calls [0 ], ("onFirstConnect " , self .pv ))
142+ def test_on_last_disconnect_calls_all (self ):
143+ self .comp .on_last_disconnect (self .pv )
144+ self .assertEqual (self .h1 .calls [0 ], ("onLastDisconnect " , self .pv ))
145+ self .assertEqual (self .h2 .calls [0 ], ("onLastDisconnect " , self .pv ))
143146
144- def test_on_last_connect_no_handlers (self ):
147+ def test_on_last_disconnect_no_handlers (self ):
145148 comp = CompositeHandler ()
146- comp .on_last_connect (self .pv ) # Should not raise
149+ comp .on_last_disconnect (self .pv ) # Should not raise
147150
148151 def test_onLastDisconnect_deprecated (self ):
149152 self .comp .onLastDisconnect (self .pv )
150- self .assertEqual (self .h1 .calls [0 ], ("onFirstConnect " , self .pv ))
153+ self .assertEqual (self .h1 .calls [0 ], ("onLastDisconnect " , self .pv ))
151154
152155 def test_close_calls_all (self ):
153156 self .comp .close (self .pv )
0 commit comments