|
11 | 11 | import zeroconf as r |
12 | 12 | from zeroconf import ServiceInfo, Zeroconf, ZeroconfServiceTypes |
13 | 13 |
|
14 | | -from .. import _clear_cache, has_working_ipv6 |
| 14 | +from .. import LOOPBACK_FIND_TIMEOUT, _clear_cache, has_working_ipv6 |
15 | 15 |
|
16 | 16 | log = logging.getLogger("zeroconf") |
17 | 17 | original_logging_level = logging.NOTSET |
@@ -47,10 +47,10 @@ def test_integration_with_listener(disable_duplicate_packet_suppression): |
47 | 47 | ) |
48 | 48 | zeroconf_registrar.registry.async_add(info) |
49 | 49 | try: |
50 | | - service_types = ZeroconfServiceTypes.find(interfaces=["127.0.0.1"], timeout=0.2) |
| 50 | + service_types = ZeroconfServiceTypes.find(interfaces=["127.0.0.1"], timeout=LOOPBACK_FIND_TIMEOUT) |
51 | 51 | assert type_ in service_types |
52 | 52 | _clear_cache(zeroconf_registrar) |
53 | | - service_types = ZeroconfServiceTypes.find(zc=zeroconf_registrar, timeout=0.2) |
| 53 | + service_types = ZeroconfServiceTypes.find(zc=zeroconf_registrar, timeout=LOOPBACK_FIND_TIMEOUT) |
54 | 54 | assert type_ in service_types |
55 | 55 |
|
56 | 56 | finally: |
@@ -79,10 +79,10 @@ def test_integration_with_listener_v6_records(disable_duplicate_packet_suppressi |
79 | 79 | ) |
80 | 80 | zeroconf_registrar.registry.async_add(info) |
81 | 81 | try: |
82 | | - service_types = ZeroconfServiceTypes.find(interfaces=["127.0.0.1"], timeout=0.2) |
| 82 | + service_types = ZeroconfServiceTypes.find(interfaces=["127.0.0.1"], timeout=LOOPBACK_FIND_TIMEOUT) |
83 | 83 | assert type_ in service_types |
84 | 84 | _clear_cache(zeroconf_registrar) |
85 | | - service_types = ZeroconfServiceTypes.find(zc=zeroconf_registrar, timeout=0.2) |
| 85 | + service_types = ZeroconfServiceTypes.find(zc=zeroconf_registrar, timeout=LOOPBACK_FIND_TIMEOUT) |
86 | 86 | assert type_ in service_types |
87 | 87 |
|
88 | 88 | finally: |
@@ -115,10 +115,12 @@ def test_integration_with_listener_ipv6(disable_duplicate_packet_suppression): |
115 | 115 | ) |
116 | 116 | zeroconf_registrar.registry.async_add(info) |
117 | 117 | try: |
118 | | - service_types = ZeroconfServiceTypes.find(ip_version=r.IPVersion.V6Only, timeout=0.2) |
| 118 | + service_types = ZeroconfServiceTypes.find( |
| 119 | + ip_version=r.IPVersion.V6Only, timeout=LOOPBACK_FIND_TIMEOUT |
| 120 | + ) |
119 | 121 | assert type_ in service_types |
120 | 122 | _clear_cache(zeroconf_registrar) |
121 | | - service_types = ZeroconfServiceTypes.find(zc=zeroconf_registrar, timeout=0.2) |
| 123 | + service_types = ZeroconfServiceTypes.find(zc=zeroconf_registrar, timeout=LOOPBACK_FIND_TIMEOUT) |
122 | 124 | assert type_ in service_types |
123 | 125 |
|
124 | 126 | finally: |
@@ -147,10 +149,10 @@ def test_integration_with_subtype_and_listener(disable_duplicate_packet_suppress |
147 | 149 | ) |
148 | 150 | zeroconf_registrar.registry.async_add(info) |
149 | 151 | try: |
150 | | - service_types = ZeroconfServiceTypes.find(interfaces=["127.0.0.1"], timeout=0.2) |
| 152 | + service_types = ZeroconfServiceTypes.find(interfaces=["127.0.0.1"], timeout=LOOPBACK_FIND_TIMEOUT) |
151 | 153 | assert discovery_type in service_types |
152 | 154 | _clear_cache(zeroconf_registrar) |
153 | | - service_types = ZeroconfServiceTypes.find(zc=zeroconf_registrar, timeout=0.2) |
| 155 | + service_types = ZeroconfServiceTypes.find(zc=zeroconf_registrar, timeout=LOOPBACK_FIND_TIMEOUT) |
154 | 156 | assert discovery_type in service_types |
155 | 157 |
|
156 | 158 | finally: |
|
0 commit comments