Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 4 additions & 16 deletions tests/services/test_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,7 @@ def test_integration_with_listener(self):
"ash-2.local.",
addresses=[socket.inet_aton("10.0.1.2")],
)
zeroconf_registrar.register_service(info)
# Ensure we do not clear the cache until after the last broadcast is processed
time.sleep(0.2)
_clear_cache(zeroconf_registrar)
zeroconf_registrar.registry.add(info)
try:
service_types = ZeroconfServiceTypes.find(interfaces=['127.0.0.1'], timeout=0.5)
assert type_ in service_types
Expand Down Expand Up @@ -70,10 +67,7 @@ def test_integration_with_listener_v6_records(self):
"ash-2.local.",
addresses=[socket.inet_pton(socket.AF_INET6, addr)],
)
zeroconf_registrar.register_service(info)
# Ensure we do not clear the cache until after the last broadcast is processed
time.sleep(0.2)
_clear_cache(zeroconf_registrar)
zeroconf_registrar.registry.add(info)
try:
service_types = ZeroconfServiceTypes.find(interfaces=['127.0.0.1'], timeout=0.5)
assert type_ in service_types
Expand Down Expand Up @@ -104,10 +98,7 @@ def test_integration_with_listener_ipv6(self):
"ash-2.local.",
addresses=[socket.inet_aton("10.0.1.2")],
)
zeroconf_registrar.register_service(info)
# Ensure we do not clear the cache until after the last broadcast is processed
time.sleep(0.2)
_clear_cache(zeroconf_registrar)
zeroconf_registrar.registry.add(info)
try:
service_types = ZeroconfServiceTypes.find(ip_version=r.IPVersion.V6Only, timeout=0.5)
assert type_ in service_types
Expand Down Expand Up @@ -138,10 +129,7 @@ def test_integration_with_subtype_and_listener(self):
"ash-2.local.",
addresses=[socket.inet_aton("10.0.1.2")],
)
zeroconf_registrar.register_service(info)
# Ensure we do not clear the cache until after the last broadcast is processed
time.sleep(0.2)
_clear_cache(zeroconf_registrar)
zeroconf_registrar.registry.add(info)
try:
service_types = ZeroconfServiceTypes.find(interfaces=['127.0.0.1'], timeout=0.5)
assert discovery_type in service_types
Expand Down