zeroconf 0.151.0__tar.gz → 0.151.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {zeroconf-0.151.0 → zeroconf-0.151.2}/CHANGELOG.md +18 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/PKG-INFO +1 -1
- {zeroconf-0.151.0 → zeroconf-0.151.2}/pyproject.toml +5 -5
- {zeroconf-0.151.0 → zeroconf-0.151.2}/setup.py +1 -1
- {zeroconf-0.151.0 → zeroconf-0.151.2}/src/zeroconf/__init__.py +1 -1
- {zeroconf-0.151.0 → zeroconf-0.151.2}/src/zeroconf/_listener.pxd +1 -8
- {zeroconf-0.151.0 → zeroconf-0.151.2}/src/zeroconf/_services/info.py +2 -2
- {zeroconf-0.151.0 → zeroconf-0.151.2}/src/zeroconf/_utils/ipaddress.py +1 -1
- {zeroconf-0.151.0 → zeroconf-0.151.2}/tests/services/test_info.py +27 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/COPYING +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/README.rst +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/build_ext.py +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/docs/Makefile +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/docs/_ext/zeroconfautodocfix.py +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/docs/api.rst +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/docs/conf.py +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/docs/index.rst +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/src/zeroconf/_cache.pxd +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/src/zeroconf/_cache.py +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/src/zeroconf/_core.py +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/src/zeroconf/_dns.pxd +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/src/zeroconf/_dns.py +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/src/zeroconf/_engine.py +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/src/zeroconf/_exceptions.py +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/src/zeroconf/_handlers/__init__.py +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/src/zeroconf/_handlers/answers.pxd +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/src/zeroconf/_handlers/answers.py +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/src/zeroconf/_handlers/multicast_outgoing_queue.pxd +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/src/zeroconf/_handlers/multicast_outgoing_queue.py +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/src/zeroconf/_handlers/query_handler.pxd +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/src/zeroconf/_handlers/query_handler.py +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/src/zeroconf/_handlers/record_manager.pxd +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/src/zeroconf/_handlers/record_manager.py +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/src/zeroconf/_history.pxd +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/src/zeroconf/_history.py +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/src/zeroconf/_listener.py +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/src/zeroconf/_logger.py +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/src/zeroconf/_protocol/__init__.py +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/src/zeroconf/_protocol/incoming.pxd +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/src/zeroconf/_protocol/incoming.py +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/src/zeroconf/_protocol/outgoing.pxd +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/src/zeroconf/_protocol/outgoing.py +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/src/zeroconf/_record_update.pxd +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/src/zeroconf/_record_update.py +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/src/zeroconf/_services/__init__.pxd +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/src/zeroconf/_services/__init__.py +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/src/zeroconf/_services/browser.pxd +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/src/zeroconf/_services/browser.py +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/src/zeroconf/_services/info.pxd +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/src/zeroconf/_services/registry.pxd +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/src/zeroconf/_services/registry.py +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/src/zeroconf/_services/types.py +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/src/zeroconf/_transport.py +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/src/zeroconf/_updates.pxd +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/src/zeroconf/_updates.py +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/src/zeroconf/_utils/__init__.py +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/src/zeroconf/_utils/asyncio.py +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/src/zeroconf/_utils/ipaddress.pxd +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/src/zeroconf/_utils/name.py +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/src/zeroconf/_utils/net.py +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/src/zeroconf/_utils/time.pxd +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/src/zeroconf/_utils/time.py +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/src/zeroconf/asyncio.py +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/src/zeroconf/const.py +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/src/zeroconf/py.typed +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/tests/__init__.py +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/tests/benchmarks/__init__.py +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/tests/benchmarks/helpers.py +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/tests/benchmarks/test_cache.py +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/tests/benchmarks/test_cache_bound.py +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/tests/benchmarks/test_cache_mark_expire.py +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/tests/benchmarks/test_incoming.py +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/tests/benchmarks/test_ipaddress.py +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/tests/benchmarks/test_listener_dedup.py +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/tests/benchmarks/test_mark_seen.py +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/tests/benchmarks/test_outgoing.py +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/tests/benchmarks/test_registry.py +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/tests/benchmarks/test_send.py +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/tests/benchmarks/test_txt_properties.py +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/tests/conftest.py +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/tests/services/__init__.py +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/tests/services/test_browser.py +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/tests/services/test_registry.py +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/tests/services/test_types.py +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/tests/test_asyncio.py +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/tests/test_cache.py +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/tests/test_circular_imports.py +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/tests/test_core.py +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/tests/test_dns.py +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/tests/test_engine.py +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/tests/test_exceptions.py +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/tests/test_fuzz_incoming.py +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/tests/test_handlers.py +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/tests/test_history.py +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/tests/test_init.py +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/tests/test_interface_update.py +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/tests/test_listener.py +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/tests/test_logger.py +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/tests/test_protocol.py +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/tests/test_services.py +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/tests/test_updates.py +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/tests/utils/__init__.py +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/tests/utils/test_asyncio.py +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/tests/utils/test_ipaddress.py +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/tests/utils/test_name.py +0 -0
- {zeroconf-0.151.0 → zeroconf-0.151.2}/tests/utils/test_net.py +0 -0
|
@@ -2,6 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
<!-- version list -->
|
|
4
4
|
|
|
5
|
+
## v0.151.2 (2026-08-29)
|
|
6
|
+
|
|
7
|
+
### Bug Fixes
|
|
8
|
+
|
|
9
|
+
- Restore sdist contents and listener typing after the reverts
|
|
10
|
+
([#1839](https://github.com/python-zeroconf/python-zeroconf/pull/1839),
|
|
11
|
+
[`6b2a040`](https://github.com/python-zeroconf/python-zeroconf/commit/6b2a04080df823b4ef9f4bcb07e058df7af3c242))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## v0.151.1 (2026-08-28)
|
|
15
|
+
|
|
16
|
+
### Bug Fixes
|
|
17
|
+
|
|
18
|
+
- Accept str addresses in ServiceInfo.addresses under cython
|
|
19
|
+
([#1836](https://github.com/python-zeroconf/python-zeroconf/pull/1836),
|
|
20
|
+
[`c0b2d50`](https://github.com/python-zeroconf/python-zeroconf/commit/c0b2d5018b2946eee89ca584c377fa00870b32b6))
|
|
21
|
+
|
|
22
|
+
|
|
5
23
|
## v0.151.0 (2026-08-28)
|
|
6
24
|
|
|
7
25
|
### Features
|
|
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "zeroconf"
|
|
7
|
-
version = "0.151.
|
|
7
|
+
version = "0.151.2"
|
|
8
8
|
license = "LGPL-2.1-or-later"
|
|
9
9
|
description = "A pure python implementation of multicast DNS service discovery"
|
|
10
10
|
readme = "README.rst"
|
|
@@ -38,10 +38,10 @@ packages = [
|
|
|
38
38
|
{ include = "zeroconf", from = "src" },
|
|
39
39
|
]
|
|
40
40
|
include = [
|
|
41
|
-
{
|
|
42
|
-
{
|
|
43
|
-
{
|
|
44
|
-
{
|
|
41
|
+
{ format = "sdist", path = "COPYING" },
|
|
42
|
+
{ format = "sdist", path = "CHANGELOG.md" },
|
|
43
|
+
{ format = "sdist", path = "docs" },
|
|
44
|
+
{ format = "sdist", path = "tests" },
|
|
45
45
|
]
|
|
46
46
|
# Make sure we don't package temporary C files generated by the build process
|
|
47
47
|
exclude = [ "**/*.c" ]
|
|
@@ -19,7 +19,7 @@ install_requires = \
|
|
|
19
19
|
|
|
20
20
|
setup_kwargs = {
|
|
21
21
|
'name': 'zeroconf',
|
|
22
|
-
'version': '0.151.
|
|
22
|
+
'version': '0.151.2',
|
|
23
23
|
'description': 'A pure python implementation of multicast DNS service discovery',
|
|
24
24
|
'long_description': 'python-zeroconf\n===============\n\n.. image:: https://github.com/python-zeroconf/python-zeroconf/workflows/CI/badge.svg\n :target: https://github.com/python-zeroconf/python-zeroconf?query=workflow%3ACI+branch%3Amaster\n\n.. image:: https://img.shields.io/pypi/v/zeroconf.svg\n :target: https://pypi.python.org/pypi/zeroconf\n\n.. image:: https://codecov.io/gh/python-zeroconf/python-zeroconf/branch/master/graph/badge.svg\n :target: https://codecov.io/gh/python-zeroconf/python-zeroconf\n\n.. image:: https://img.shields.io/endpoint?url=https://codspeed.io/badge.json\n :target: https://codspeed.io/python-zeroconf/python-zeroconf\n :alt: Codspeed.io status for python-zeroconf\n\n.. image:: https://readthedocs.org/projects/python-zeroconf/badge/?version=latest\n :target: https://python-zeroconf.readthedocs.io/en/latest/?badge=latest\n :alt: Documentation Status\n\n`Documentation <https://python-zeroconf.readthedocs.io/en/latest/>`_.\n\nThis is fork of pyzeroconf, Multicast DNS Service Discovery for Python,\noriginally by Paul Scott-Murphy (https://github.com/paulsm/pyzeroconf),\nmodified by William McBrine (https://github.com/wmcbrine/pyzeroconf).\n\nThe original William McBrine\'s fork note::\n\n This fork is used in all of my TiVo-related projects: HME for Python\n (and therefore HME/VLC), Network Remote, Remote Proxy, and pyTivo.\n Before this, I was tracking the changes for zeroconf.py in three\n separate repos. I figured I should have an authoritative source.\n\n Although I make changes based on my experience with TiVos, I expect that\n they\'re generally applicable. This version also includes patches found\n on the now-defunct (?) Launchpad repo of pyzeroconf, and elsewhere\n around the net -- not always well-documented, sorry.\n\nCompatible with:\n\n* Bonjour\n* Avahi\n\nCompared to some other Zeroconf/Bonjour/Avahi Python packages, python-zeroconf:\n\n* isn\'t tied to Bonjour or Avahi\n* doesn\'t use D-Bus\n* doesn\'t force you to use particular event loop or Twisted (asyncio is used under the hood but not required)\n* is pip-installable\n* has PyPI distribution\n* has an optional cython extension for performance (pure python is supported as well)\n\nPython compatibility\n--------------------\n\n* CPython 3.10+\n* PyPy 3.10+\n\nVersioning\n----------\n\nThis project uses semantic versioning.\n\nStatus\n------\n\nThis project is actively maintained.\n\nTraffic Reduction\n-----------------\n\nBefore version 0.32, most traffic reduction techniques described in https://datatracker.ietf.org/doc/html/rfc6762#section-7\nwhere not implemented which could lead to excessive network traffic. It is highly recommended that version 0.32 or later\nis used if this is a concern.\n\nIPv6 support\n------------\n\nIPv6 support is relatively new and currently limited, specifically:\n\n* `InterfaceChoice.All` is an alias for `InterfaceChoice.Default` on non-POSIX\n systems.\n* Dual-stack IPv6 sockets are used, which may not be supported everywhere (some\n BSD variants do not have them).\n* Listening on localhost (`::1`) does not work. Help with understanding why is\n appreciated.\n\nHow to get python-zeroconf?\n===========================\n\n* PyPI page https://pypi.org/project/zeroconf/\n* GitHub project https://github.com/python-zeroconf/python-zeroconf\n\nThe easiest way to install python-zeroconf is using pip::\n\n pip install zeroconf\n\n\n\nHow do I use it?\n================\n\nHere\'s an example of browsing for a service:\n\n.. code-block:: python\n\n from zeroconf import ServiceBrowser, ServiceListener, Zeroconf\n\n\n class MyListener(ServiceListener):\n\n def update_service(self, zc: Zeroconf, type_: str, name: str) -> None:\n print(f"Service {name} updated")\n\n def remove_service(self, zc: Zeroconf, type_: str, name: str) -> None:\n print(f"Service {name} removed")\n\n def add_service(self, zc: Zeroconf, type_: str, name: str) -> None:\n info = zc.get_service_info(type_, name)\n print(f"Service {name} added, service info: {info}")\n\n\n zeroconf = Zeroconf()\n listener = MyListener()\n browser = ServiceBrowser(zeroconf, "_http._tcp.local.", listener)\n try:\n input("Press enter to exit...\\n\\n")\n finally:\n zeroconf.close()\n\n.. note::\n\n Discovery and service registration use *all* available network interfaces by default.\n If you want to customize that you need to specify ``interfaces`` argument when\n constructing ``Zeroconf`` object (see the code for details).\n\nIf you don\'t know the name of the service you need to browse for, try:\n\n.. code-block:: python\n\n from zeroconf import ZeroconfServiceTypes\n print(\'\\n\'.join(ZeroconfServiceTypes.find()))\n\nSee examples directory for more.\n\nChangelog\n=========\n\n`Changelog <CHANGELOG.md>`_\n\nLicense\n=======\n\nGNU Lesser General Public License v2.1 or later (LGPL-2.1-or-later).\n\nThe full text of LGPL 2.1 is included in the `COPYING <COPYING>`_ file.\nYou may, at your option, use this library under the terms of any later\nversion of the LGPL published by the Free Software Foundation. The\ncanonical SPDX identifier for this project is ``LGPL-2.1-or-later``, as\ndeclared in ``pyproject.toml``.\n',
|
|
25
25
|
'author': 'Paul Scott-Murphy',
|
|
@@ -88,7 +88,7 @@ from ._utils.time import ( # noqa # import needed for backwards compat
|
|
|
88
88
|
|
|
89
89
|
__author__ = "Paul Scott-Murphy, William McBrine"
|
|
90
90
|
__maintainer__ = "Jakub Stasiak <jakub@stasiak.at>"
|
|
91
|
-
__version__ = "0.151.
|
|
91
|
+
__version__ = "0.151.2"
|
|
92
92
|
__license__ = "LGPL"
|
|
93
93
|
|
|
94
94
|
|
|
@@ -60,11 +60,4 @@ cdef class AsyncListener:
|
|
|
60
60
|
tuple v6_flow_scope
|
|
61
61
|
)
|
|
62
62
|
|
|
63
|
-
cpdef _respond_query(
|
|
64
|
-
self,
|
|
65
|
-
DNSIncoming msg,
|
|
66
|
-
object addr,
|
|
67
|
-
object port,
|
|
68
|
-
object transport,
|
|
69
|
-
tuple v6_flow_scope
|
|
70
|
-
)
|
|
63
|
+
cpdef _respond_query(self, DNSIncoming msg, object addr, object port, object transport, tuple v6_flow_scope)
|
|
@@ -219,7 +219,7 @@ class ServiceInfo(RecordUpdateListener):
|
|
|
219
219
|
host_ttl: int = _DNS_HOST_TTL,
|
|
220
220
|
other_ttl: int = _DNS_OTHER_TTL,
|
|
221
221
|
*,
|
|
222
|
-
addresses:
|
|
222
|
+
addresses: Sequence[bytes | str] | None = None,
|
|
223
223
|
parsed_addresses: list[str] | None = None,
|
|
224
224
|
interface_index: int | None = None,
|
|
225
225
|
) -> None:
|
|
@@ -292,7 +292,7 @@ class ServiceInfo(RecordUpdateListener):
|
|
|
292
292
|
return self.addresses_by_version(IPVersion.V4Only)
|
|
293
293
|
|
|
294
294
|
@addresses.setter
|
|
295
|
-
def addresses(self, value:
|
|
295
|
+
def addresses(self, value: Sequence[bytes | str]) -> None:
|
|
296
296
|
"""Replace the addresses list.
|
|
297
297
|
|
|
298
298
|
This replaces all currently stored addresses, both IPv4 and IPv6.
|
|
@@ -137,7 +137,7 @@ def get_ip_address_object_from_record(
|
|
|
137
137
|
|
|
138
138
|
|
|
139
139
|
def ip_bytes_and_scope_to_address(
|
|
140
|
-
address: bytes_, scope: int_
|
|
140
|
+
address: bytes_ | str, scope: int_
|
|
141
141
|
) -> ZeroconfIPv4Address | ZeroconfIPv6Address | None:
|
|
142
142
|
"""Convert the bytes and scope to an IP address object."""
|
|
143
143
|
base_address = cached_ip_addresses_wrapper(address)
|
|
@@ -3071,3 +3071,30 @@ def test_denied_flag_is_ignored_when_address_is_held(zc_loopback: r.Zeroconf) ->
|
|
|
3071
3071
|
assert info.addresses == [socket.inet_aton("127.0.0.1")]
|
|
3072
3072
|
# the held A record keeps the request querying instead of fast failing
|
|
3073
3073
|
assert info._is_denied is False
|
|
3074
|
+
|
|
3075
|
+
|
|
3076
|
+
@pytest.mark.parametrize(
|
|
3077
|
+
"addresses",
|
|
3078
|
+
[
|
|
3079
|
+
["10.0.1.2", "2001:db8::1"],
|
|
3080
|
+
[socket.inet_aton("10.0.1.2"), socket.inet_pton(socket.AF_INET6, "2001:db8::1")],
|
|
3081
|
+
["10.0.1.2", socket.inet_pton(socket.AF_INET6, "2001:db8::1")],
|
|
3082
|
+
],
|
|
3083
|
+
)
|
|
3084
|
+
def test_addresses_setter_accepts_str_and_bytes(addresses):
|
|
3085
|
+
"""The addresses setter accepts str and bytes addresses."""
|
|
3086
|
+
type_ = "_http._tcp.local."
|
|
3087
|
+
info = ServiceInfo(type_, f"xxxyyy.{type_}", 80, server="ash-2.local.")
|
|
3088
|
+
info.addresses = addresses
|
|
3089
|
+
assert info.parsed_addresses() == ["10.0.1.2", "2001:db8::1"]
|
|
3090
|
+
|
|
3091
|
+
info = ServiceInfo(type_, f"xxxyyy.{type_}", 80, server="ash-2.local.", addresses=addresses)
|
|
3092
|
+
assert info.parsed_addresses() == ["10.0.1.2", "2001:db8::1"]
|
|
3093
|
+
|
|
3094
|
+
|
|
3095
|
+
def test_addresses_setter_rejects_invalid_address():
|
|
3096
|
+
"""The addresses setter raises TypeError for invalid addresses."""
|
|
3097
|
+
type_ = "_http._tcp.local."
|
|
3098
|
+
info = ServiceInfo(type_, f"xxxyyy.{type_}", 80, server="ash-2.local.")
|
|
3099
|
+
with pytest.raises(TypeError, match="Addresses must either be"):
|
|
3100
|
+
info.addresses = ["not an address"]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|