@@ -87,7 +87,7 @@ def _process_outgoing_packet(out):
8787 expected_ttl = None
8888 for _ in range (3 ):
8989 _process_outgoing_packet (zc .generate_service_query (info ))
90- zc .registry .add (info )
90+ zc .registry .async_add (info )
9191 for _ in range (3 ):
9292 _process_outgoing_packet (zc .generate_service_broadcast (info , None ))
9393 assert nbr_answers == 12 and nbr_additionals == 0 and nbr_authorities == 3
@@ -112,7 +112,7 @@ def _process_outgoing_packet(out):
112112
113113 # unregister
114114 expected_ttl = 0
115- zc .registry .remove (info )
115+ zc .registry .async_remove (info )
116116 for _ in range (3 ):
117117 _process_outgoing_packet (zc .generate_service_broadcast (info , 0 ))
118118 assert nbr_answers == 12 and nbr_additionals == 0 and nbr_authorities == 0
@@ -121,7 +121,7 @@ def _process_outgoing_packet(out):
121121 expected_ttl = None
122122 for _ in range (3 ):
123123 _process_outgoing_packet (zc .generate_service_query (info ))
124- zc .registry .add (info )
124+ zc .registry .async_add (info )
125125 # register service with custom TTL
126126 expected_ttl = const ._DNS_HOST_TTL * 2
127127 assert expected_ttl != const ._DNS_HOST_TTL
@@ -147,7 +147,7 @@ def _process_outgoing_packet(out):
147147
148148 # unregister
149149 expected_ttl = 0
150- zc .registry .remove (info )
150+ zc .registry .async_remove (info )
151151 for _ in range (3 ):
152152 _process_outgoing_packet (zc .generate_service_broadcast (info , 0 ))
153153 assert nbr_answers == 12 and nbr_additionals == 0 and nbr_authorities == 0
@@ -284,7 +284,7 @@ def test_any_query_for_ptr():
284284 server_name = "ash-2.local."
285285 ipv6_address = socket .inet_pton (socket .AF_INET6 , "2001:db8::1" )
286286 info = ServiceInfo (type_ , registration_name , 80 , 0 , 0 , desc , server_name , addresses = [ipv6_address ])
287- zc .registry .add (info )
287+ zc .registry .async_add (info )
288288
289289 _clear_cache (zc )
290290 generated = r .DNSOutgoing (const ._FLAGS_QR_QUERY )
@@ -297,7 +297,7 @@ def test_any_query_for_ptr():
297297 assert multicast_out .answers [0 ][0 ].name == type_
298298 assert multicast_out .answers [0 ][0 ].alias == registration_name
299299 # unregister
300- zc .registry .remove (info )
300+ zc .registry .async_remove (info )
301301 zc .close ()
302302
303303
@@ -311,7 +311,7 @@ def test_aaaa_query():
311311 server_name = "ash-2.local."
312312 ipv6_address = socket .inet_pton (socket .AF_INET6 , "2001:db8::1" )
313313 info = ServiceInfo (type_ , registration_name , 80 , 0 , 0 , desc , server_name , addresses = [ipv6_address ])
314- zc .registry .add (info )
314+ zc .registry .async_add (info )
315315
316316 generated = r .DNSOutgoing (const ._FLAGS_QR_QUERY )
317317 question = r .DNSQuestion (server_name , const ._TYPE_AAAA , const ._CLASS_IN )
@@ -322,7 +322,7 @@ def test_aaaa_query():
322322 )
323323 assert multicast_out .answers [0 ][0 ].address == ipv6_address
324324 # unregister
325- zc .registry .remove (info )
325+ zc .registry .async_remove (info )
326326 zc .close ()
327327
328328
@@ -342,7 +342,7 @@ def test_a_and_aaaa_record_fate_sharing():
342342 aaaa_record = info .dns_addresses (version = r .IPVersion .V6Only )[0 ]
343343 a_record = info .dns_addresses (version = r .IPVersion .V4Only )[0 ]
344344
345- zc .registry .add (info )
345+ zc .registry .async_add (info )
346346
347347 # Test AAAA query
348348 generated = r .DNSOutgoing (const ._FLAGS_QR_QUERY )
@@ -375,7 +375,7 @@ def test_a_and_aaaa_record_fate_sharing():
375375 assert len (multicast_out .answers ) == 1
376376 assert len (multicast_out .additionals ) == 1
377377 # unregister
378- zc .registry .remove (info )
378+ zc .registry .async_remove (info )
379379 zc .close ()
380380
381381
@@ -393,7 +393,7 @@ def test_unicast_response():
393393 type_ , registration_name , 80 , 0 , 0 , desc , "ash-2.local." , addresses = [socket .inet_aton ("10.0.1.2" )]
394394 )
395395 # register
396- zc .registry .add (info )
396+ zc .registry .async_add (info )
397397 _clear_cache (zc )
398398
399399 # query
@@ -420,7 +420,7 @@ def test_unicast_response():
420420 assert has_srv and has_txt and has_a
421421
422422 # unregister
423- zc .registry .remove (info )
423+ zc .registry .async_remove (info )
424424 zc .close ()
425425
426426
@@ -535,7 +535,7 @@ def test_known_answer_supression():
535535 info = ServiceInfo (
536536 type_ , registration_name , 80 , 0 , 0 , desc , server_name , addresses = [socket .inet_aton ("10.0.1.2" )]
537537 )
538- zc .registry .add (info )
538+ zc .registry .async_add (info )
539539
540540 now = current_time_millis ()
541541 _clear_cache (zc )
@@ -631,7 +631,7 @@ def test_known_answer_supression():
631631 assert not multicast_out or not multicast_out .answers
632632
633633 # unregister
634- zc .registry .remove (info )
634+ zc .registry .async_remove (info )
635635 zc .close ()
636636
637637
@@ -660,9 +660,9 @@ def test_multi_packet_known_answer_supression():
660660 info3 = ServiceInfo (
661661 type_ , registration3_name , 80 , 0 , 0 , desc , server_name3 , addresses = [socket .inet_aton ("10.0.1.2" )]
662662 )
663- zc .registry .add (info )
664- zc .registry .add (info2 )
665- zc .registry .add (info3 )
663+ zc .registry .async_add (info )
664+ zc .registry .async_add (info2 )
665+ zc .registry .async_add (info3 )
666666
667667 now = current_time_millis ()
668668 _clear_cache (zc )
@@ -683,9 +683,9 @@ def test_multi_packet_known_answer_supression():
683683 assert unicast_out is None
684684 assert multicast_out is None
685685 # unregister
686- zc .registry .remove (info )
687- zc .registry .remove (info2 )
688- zc .registry .remove (info3 )
686+ zc .registry .async_remove (info )
687+ zc .registry .async_remove (info2 )
688+ zc .registry .async_remove (info3 )
689689 zc .close ()
690690
691691
@@ -699,7 +699,7 @@ def test_known_answer_supression_service_type_enumeration_query():
699699 info = ServiceInfo (
700700 type_ , registration_name , 80 , 0 , 0 , desc , server_name , addresses = [socket .inet_aton ("10.0.1.2" )]
701701 )
702- zc .registry .add (info )
702+ zc .registry .async_add (info )
703703
704704 type_2 = "_otherknown2._tcp.local."
705705 name = "knownname"
@@ -709,7 +709,7 @@ def test_known_answer_supression_service_type_enumeration_query():
709709 info2 = ServiceInfo (
710710 type_2 , registration_name2 , 80 , 0 , 0 , desc , server_name2 , addresses = [socket .inet_aton ("10.0.1.2" )]
711711 )
712- zc .registry .add (info2 )
712+ zc .registry .async_add (info2 )
713713 now = current_time_millis ()
714714 _clear_cache (zc )
715715
@@ -755,8 +755,8 @@ def test_known_answer_supression_service_type_enumeration_query():
755755 assert not multicast_out or not multicast_out .answers
756756
757757 # unregister
758- zc .registry .remove (info )
759- zc .registry .remove (info2 )
758+ zc .registry .async_remove (info )
759+ zc .registry .async_remove (info2 )
760760 zc .close ()
761761
762762
@@ -777,7 +777,7 @@ async def test_qu_response_only_sends_additionals_if_sends_answer():
777777 info = ServiceInfo (
778778 type_ , registration_name , 80 , 0 , 0 , desc , server_name , addresses = [socket .inet_aton ("10.0.1.2" )]
779779 )
780- zc .registry .add (info )
780+ zc .registry .async_add (info )
781781
782782 type_2 = "_addtest2._tcp.local."
783783 name = "knownname"
@@ -787,7 +787,7 @@ async def test_qu_response_only_sends_additionals_if_sends_answer():
787787 info2 = ServiceInfo (
788788 type_2 , registration_name2 , 80 , 0 , 0 , desc , server_name2 , addresses = [socket .inet_aton ("10.0.1.2" )]
789789 )
790- zc .registry .add (info2 )
790+ zc .registry .async_add (info2 )
791791
792792 ptr_record = info .dns_pointer ()
793793
@@ -888,7 +888,7 @@ async def test_qu_response_only_sends_additionals_if_sends_answer():
888888 assert info2 .dns_service () in unicast_out .additionals
889889
890890 # unregister
891- zc .registry .remove (info )
891+ zc .registry .async_remove (info )
892892 await aiozc .async_close ()
893893
894894
0 commit comments