Compare commits

...

3 Commits

Author SHA1 Message Date
Stefan Agner
f62a5a9f52 Fix type annotations 2025-11-19 15:32:06 +01:00
Stefan Agner
b335563441 Update unit tests for dbus-fast 3.1.2 changes 2025-11-17 19:12:21 +01:00
dependabot[bot]
849bef4481 Bump dbus-fast from 2.45.1 to 3.1.2
Bumps [dbus-fast](https://github.com/bluetooth-devices/dbus-fast) from 2.45.1 to 3.1.2.
- [Release notes](https://github.com/bluetooth-devices/dbus-fast/releases)
- [Changelog](https://github.com/Bluetooth-Devices/dbus-fast/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bluetooth-devices/dbus-fast/compare/v2.45.1...v3.1.2)

---
updated-dependencies:
- dependency-name: dbus-fast
  dependency-version: 3.1.2
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-17 06:01:24 +00:00
7 changed files with 98 additions and 98 deletions

View File

@@ -28,5 +28,5 @@ securetar==2025.2.1
sentry-sdk==2.44.0
setuptools==80.9.0
voluptuous==0.15.2
dbus-fast==2.45.1
dbus-fast==3.1.2
zlib-fast==0.2.1

View File

@@ -75,7 +75,7 @@ class Resolved(DBusInterfaceProxy):
@dbus_property
def current_dns_server(
self,
) -> list[tuple[int, DNSAddressFamily, bytes]] | None:
) -> tuple[int, DNSAddressFamily, bytes] | None:
"""Return current DNS server."""
return self.properties[DBUS_ATTR_CURRENT_DNS_SERVER]
@@ -83,7 +83,7 @@ class Resolved(DBusInterfaceProxy):
@dbus_property
def current_dns_server_ex(
self,
) -> list[tuple[int, DNSAddressFamily, bytes, int, str]] | None:
) -> tuple[int, DNSAddressFamily, bytes, int, str] | None:
"""Return current DNS server including port and server name."""
return self.properties[DBUS_ATTR_CURRENT_DNS_SERVER_EX]

View File

@@ -41,51 +41,51 @@ async def test_dbus_resolved_info(
assert resolved.dns_over_tls == DNSOverTLSEnabled.NO
assert len(resolved.dns) == 2
assert resolved.dns[0] == [0, 2, inet_aton("127.0.0.1")]
assert resolved.dns[1] == [0, 10, inet_pton(AF_INET6, "::1")]
assert resolved.dns[0] == (0, 2, inet_aton("127.0.0.1"))
assert resolved.dns[1] == (0, 10, inet_pton(AF_INET6, "::1"))
assert len(resolved.dns_ex) == 2
assert resolved.dns_ex[0] == [0, 2, inet_aton("127.0.0.1"), 0, ""]
assert resolved.dns_ex[1] == [0, 10, inet_pton(AF_INET6, "::1"), 0, ""]
assert resolved.dns_ex[0] == (0, 2, inet_aton("127.0.0.1"), 0, "")
assert resolved.dns_ex[1] == (0, 10, inet_pton(AF_INET6, "::1"), 0, "")
assert len(resolved.fallback_dns) == 2
assert resolved.fallback_dns[0] == [0, 2, inet_aton("1.1.1.1")]
assert resolved.fallback_dns[1] == [
assert resolved.fallback_dns[0] == (0, 2, inet_aton("1.1.1.1"))
assert resolved.fallback_dns[1] == (
0,
10,
inet_pton(AF_INET6, "2606:4700:4700::1111"),
]
)
assert len(resolved.fallback_dns_ex) == 2
assert resolved.fallback_dns_ex[0] == [
assert resolved.fallback_dns_ex[0] == (
0,
2,
inet_aton("1.1.1.1"),
0,
"cloudflare-dns.com",
]
assert resolved.fallback_dns_ex[1] == [
)
assert resolved.fallback_dns_ex[1] == (
0,
10,
inet_pton(AF_INET6, "2606:4700:4700::1111"),
0,
"cloudflare-dns.com",
]
)
assert resolved.current_dns_server == [0, 2, inet_aton("127.0.0.1")]
assert resolved.current_dns_server_ex == [
assert resolved.current_dns_server == (0, 2, inet_aton("127.0.0.1"))
assert resolved.current_dns_server_ex == (
0,
2,
inet_aton("127.0.0.1"),
0,
"",
]
)
assert len(resolved.domains) == 1
assert resolved.domains[0] == [0, "local.hass.io", False]
assert resolved.domains[0] == (0, "local.hass.io", False)
assert resolved.transaction_statistics == [0, 100000]
assert resolved.cache_statistics == [10, 50000, 10000]
assert resolved.transaction_statistics == (0, 100000)
assert resolved.cache_statistics == (10, 50000, 10000)
assert resolved.dnssec == DNSSECValidation.NO
assert resolved.dnssec_statistics == [0, 0, 0, 0]
assert resolved.dnssec_statistics == (0, 0, 0, 0)
assert resolved.dnssec_supported is False
assert resolved.dnssec_negative_trust_anchors == [
"168.192.in-addr.arpa",

View File

@@ -185,10 +185,10 @@ async def test_start_transient_unit(
"tmp-test.mount",
"fail",
[
["Description", Variant("s", "Test")],
["What", Variant("s", "//homeassistant/config")],
["Type", Variant("s", "cifs")],
["Options", Variant("s", "username=homeassistant,password=password")],
("Description", Variant("s", "Test")),
("What", Variant("s", "//homeassistant/config")),
("Type", Variant("s", "cifs")),
("Options", Variant("s", "username=homeassistant,password=password")),
],
[],
)

View File

@@ -45,8 +45,8 @@ class Resolved(DBusServiceMock):
def DNS(self) -> "a(iiay)":
"""Get DNS."""
return [
[0, 2, bytes([127, 0, 0, 1])],
[
(0, 2, bytes([127, 0, 0, 1])),
(
0,
10,
bytes(
@@ -69,15 +69,15 @@ class Resolved(DBusServiceMock):
0x1,
]
),
],
),
]
@dbus_property(access=PropertyAccess.READ)
def DNSEx(self) -> "a(iiayqs)":
"""Get DNSEx."""
return [
[0, 2, bytes([127, 0, 0, 1]), 0, ""],
[
(0, 2, bytes([127, 0, 0, 1]), 0, ""),
(
0,
10,
bytes(
@@ -102,15 +102,15 @@ class Resolved(DBusServiceMock):
),
0,
"",
],
),
]
@dbus_property(access=PropertyAccess.READ)
def FallbackDNS(self) -> "a(iiay)":
"""Get FallbackDNS."""
return [
[0, 2, bytes([1, 1, 1, 1])],
[
(0, 2, bytes([1, 1, 1, 1])),
(
0,
10,
bytes(
@@ -133,15 +133,15 @@ class Resolved(DBusServiceMock):
0x11,
]
),
],
),
]
@dbus_property(access=PropertyAccess.READ)
def FallbackDNSEx(self) -> "a(iiayqs)":
"""Get FallbackDNSEx."""
return [
[0, 2, bytes([1, 1, 1, 1]), 0, "cloudflare-dns.com"],
[
(0, 2, bytes([1, 1, 1, 1]), 0, "cloudflare-dns.com"),
(
0,
10,
bytes(
@@ -166,33 +166,33 @@ class Resolved(DBusServiceMock):
),
0,
"cloudflare-dns.com",
],
),
]
@dbus_property(access=PropertyAccess.READ)
def CurrentDNSServer(self) -> "(iiay)":
"""Get CurrentDNSServer."""
return [0, 2, bytes([127, 0, 0, 1])]
return (0, 2, bytes([127, 0, 0, 1]))
@dbus_property(access=PropertyAccess.READ)
def CurrentDNSServerEx(self) -> "(iiayqs)":
"""Get CurrentDNSServerEx."""
return [0, 2, bytes([127, 0, 0, 1]), 0, ""]
return (0, 2, bytes([127, 0, 0, 1]), 0, "")
@dbus_property(access=PropertyAccess.READ)
def Domains(self) -> "a(isb)":
"""Get Domains."""
return [[0, "local.hass.io", False]]
return [(0, "local.hass.io", False)]
@dbus_property(access=PropertyAccess.READ)
def TransactionStatistics(self) -> "(tt)":
"""Get TransactionStatistics."""
return [0, 100000]
return (0, 100000)
@dbus_property(access=PropertyAccess.READ)
def CacheStatistics(self) -> "(ttt)":
"""Get CacheStatistics."""
return [10, 50000, 10000]
return (10, 50000, 10000)
@dbus_property(access=PropertyAccess.READ)
def DNSSEC(self) -> "s":
@@ -202,7 +202,7 @@ class Resolved(DBusServiceMock):
@dbus_property(access=PropertyAccess.READ)
def DNSSECStatistics(self) -> "(tttt)":
"""Get DNSSECStatistics."""
return [0, 0, 0, 0]
return (0, 0, 0, 0)
@dbus_property(access=PropertyAccess.READ)
def DNSSECSupported(self) -> "b":

View File

@@ -119,10 +119,10 @@ async def test_load(
"mnt-data-supervisor-mounts-backup_test.mount",
"fail",
[
["Options", Variant("s", "noserverino,guest")],
["Type", Variant("s", "cifs")],
["Description", Variant("s", "Supervisor cifs mount: backup_test")],
["What", Variant("s", "//backup.local/backups")],
("Options", Variant("s", "noserverino,guest")),
("Type", Variant("s", "cifs")),
("Description", Variant("s", "Supervisor cifs mount: backup_test")),
("What", Variant("s", "//backup.local/backups")),
],
[],
),
@@ -130,10 +130,10 @@ async def test_load(
"mnt-data-supervisor-mounts-media_test.mount",
"fail",
[
["Options", Variant("s", "soft,timeo=200")],
["Type", Variant("s", "nfs")],
["Description", Variant("s", "Supervisor nfs mount: media_test")],
["What", Variant("s", "media.local:/media")],
("Options", Variant("s", "soft,timeo=200")),
("Type", Variant("s", "nfs")),
("Description", Variant("s", "Supervisor nfs mount: media_test")),
("What", Variant("s", "media.local:/media")),
],
[],
),
@@ -141,12 +141,12 @@ async def test_load(
"mnt-data-supervisor-media-media_test.mount",
"fail",
[
["Options", Variant("s", "bind")],
[
("Options", Variant("s", "bind")),
(
"Description",
Variant("s", "Supervisor bind mount: bind_media_test"),
],
["What", Variant("s", "/mnt/data/supervisor/mounts/media_test")],
),
("What", Variant("s", "/mnt/data/supervisor/mounts/media_test")),
],
[],
),
@@ -198,10 +198,10 @@ async def test_load_share_mount(
"mnt-data-supervisor-mounts-share_test.mount",
"fail",
[
["Options", Variant("s", "soft,timeo=200")],
["Type", Variant("s", "nfs")],
["Description", Variant("s", "Supervisor nfs mount: share_test")],
["What", Variant("s", "share.local:/share")],
("Options", Variant("s", "soft,timeo=200")),
("Type", Variant("s", "nfs")),
("Description", Variant("s", "Supervisor nfs mount: share_test")),
("What", Variant("s", "share.local:/share")),
],
[],
),
@@ -209,9 +209,9 @@ async def test_load_share_mount(
"mnt-data-supervisor-share-share_test.mount",
"fail",
[
["Options", Variant("s", "bind")],
["Description", Variant("s", "Supervisor bind mount: bind_share_test")],
["What", Variant("s", "/mnt/data/supervisor/mounts/share_test")],
("Options", Variant("s", "bind")),
("Description", Variant("s", "Supervisor bind mount: bind_share_test")),
("What", Variant("s", "/mnt/data/supervisor/mounts/share_test")),
],
[],
),
@@ -318,12 +318,12 @@ async def test_mount_failed_during_load(
"mnt-data-supervisor-media-media_test.mount",
"fail",
[
["Options", Variant("s", "ro,bind")],
[
("Options", Variant("s", "ro,bind")),
(
"Description",
Variant("s", "Supervisor bind mount: emergency_media_test"),
],
["What", Variant("s", "/mnt/data/supervisor/emergency/media_test")],
),
("What", Variant("s", "/mnt/data/supervisor/emergency/media_test")),
],
[],
)
@@ -634,10 +634,10 @@ async def test_reload_mounts_attempts_initial_mount(
"mnt-data-supervisor-mounts-media_test.mount",
"fail",
[
["Options", Variant("s", "soft,timeo=200")],
["Type", Variant("s", "nfs")],
["Description", Variant("s", "Supervisor nfs mount: media_test")],
["What", Variant("s", "media.local:/media")],
("Options", Variant("s", "soft,timeo=200")),
("Type", Variant("s", "nfs")),
("Description", Variant("s", "Supervisor nfs mount: media_test")),
("What", Variant("s", "media.local:/media")),
],
[],
),
@@ -645,9 +645,9 @@ async def test_reload_mounts_attempts_initial_mount(
"mnt-data-supervisor-media-media_test.mount",
"fail",
[
["Options", Variant("s", "bind")],
["Description", Variant("s", "Supervisor bind mount: bind_media_test")],
["What", Variant("s", "/mnt/data/supervisor/mounts/media_test")],
("Options", Variant("s", "bind")),
("Description", Variant("s", "Supervisor bind mount: bind_media_test")),
("What", Variant("s", "/mnt/data/supervisor/mounts/media_test")),
],
[],
),

View File

@@ -105,7 +105,7 @@ async def test_cifs_mount(
"mnt-data-supervisor-mounts-test.mount",
"fail",
[
[
(
"Options",
Variant(
"s",
@@ -117,10 +117,10 @@ async def test_cifs_mount(
]
),
),
],
["Type", Variant("s", "cifs")],
["Description", Variant("s", "Supervisor cifs mount: test")],
["What", Variant("s", "//test.local/camera")],
),
("Type", Variant("s", "cifs")),
("Description", Variant("s", "Supervisor cifs mount: test")),
("What", Variant("s", "//test.local/camera")),
],
[],
)
@@ -177,10 +177,10 @@ async def test_cifs_mount_read_only(
"mnt-data-supervisor-mounts-test.mount",
"fail",
[
["Options", Variant("s", "ro,noserverino,guest")],
["Type", Variant("s", "cifs")],
["Description", Variant("s", "Supervisor cifs mount: test")],
["What", Variant("s", "//test.local/camera")],
("Options", Variant("s", "ro,noserverino,guest")),
("Type", Variant("s", "cifs")),
("Description", Variant("s", "Supervisor cifs mount: test")),
("What", Variant("s", "//test.local/camera")),
],
[],
)
@@ -237,10 +237,10 @@ async def test_nfs_mount(
"mnt-data-supervisor-mounts-test.mount",
"fail",
[
["Options", Variant("s", "port=1234,soft,timeo=200")],
["Type", Variant("s", "nfs")],
["Description", Variant("s", "Supervisor nfs mount: test")],
["What", Variant("s", "test.local:/media/camera")],
("Options", Variant("s", "port=1234,soft,timeo=200")),
("Type", Variant("s", "nfs")),
("Description", Variant("s", "Supervisor nfs mount: test")),
("What", Variant("s", "test.local:/media/camera")),
],
[],
)
@@ -283,10 +283,10 @@ async def test_nfs_mount_read_only(
"mnt-data-supervisor-mounts-test.mount",
"fail",
[
["Options", Variant("s", "ro,port=1234,soft,timeo=200")],
["Type", Variant("s", "nfs")],
["Description", Variant("s", "Supervisor nfs mount: test")],
["What", Variant("s", "test.local:/media/camera")],
("Options", Variant("s", "ro,port=1234,soft,timeo=200")),
("Type", Variant("s", "nfs")),
("Description", Variant("s", "Supervisor nfs mount: test")),
("What", Variant("s", "test.local:/media/camera")),
],
[],
)
@@ -331,10 +331,10 @@ async def test_load(
"mnt-data-supervisor-mounts-test.mount",
"fail",
[
["Options", Variant("s", "noserverino,guest")],
["Type", Variant("s", "cifs")],
["Description", Variant("s", "Supervisor cifs mount: test")],
["What", Variant("s", "//test.local/share")],
("Options", Variant("s", "noserverino,guest")),
("Type", Variant("s", "cifs")),
("Description", Variant("s", "Supervisor cifs mount: test")),
("What", Variant("s", "//test.local/share")),
],
[],
)
@@ -736,10 +736,10 @@ async def test_mount_fails_if_down(
"mnt-data-supervisor-mounts-test.mount",
"fail",
[
["Options", Variant("s", "port=1234,soft,timeo=200")],
["Type", Variant("s", "nfs")],
["Description", Variant("s", "Supervisor nfs mount: test")],
["What", Variant("s", "test.local:/media/camera")],
("Options", Variant("s", "port=1234,soft,timeo=200")),
("Type", Variant("s", "nfs")),
("Description", Variant("s", "Supervisor nfs mount: test")),
("What", Variant("s", "test.local:/media/camera")),
],
[],
)