Skip to content

Commit

Permalink
chore(pre-commit.ci): auto fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed Jan 13, 2025
1 parent b29ed34 commit 20bc990
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 21 deletions.
2 changes: 1 addition & 1 deletion examples/dbus-next-send.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def exit_error(message):

if len(interface_member) < 2:
exit_error(
f'Expecting an interface and member separated by a dot: {vars(args)["interface.member"]}'
f"Expecting an interface and member separated by a dot: {vars(args)['interface.member']}"
)

destination = args.dest
Expand Down
16 changes: 6 additions & 10 deletions tests/test_marshaller.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,9 @@ def test_unmarshalling_with_table(unmarshall_table):
"flags",
"serial",
]:
assert getattr(unmarshaller.message, attr) == getattr(
message, attr
), f"attr doesnt match: {attr}"
assert getattr(unmarshaller.message, attr) == getattr(message, attr), (
f"attr doesnt match: {attr}"
)


def test_unmarshall_can_resume():
Expand Down Expand Up @@ -308,7 +308,7 @@ def test_unmarshall_bluez_interfaces_added_message():
"RSSI": -50,
"ServiceData": {
"0000fe95-0000-1000-8000-00805f9b34fb": bytearray(
b"0X\xd6\x03" b"\x026&`" b"4-X\x08"
b"0X\xd6\x03\x026&`4-X\x08"
)
},
"ServicesResolved": False,
Expand Down Expand Up @@ -417,14 +417,10 @@ def test_unmarshall_bluez_properties_changed_with_service_data():
"RSSI": -63,
"ServiceData": {
"0000fdcd-0000-1000-8000-00805f9b34fb": bytearray(
b"\x08\x12\x1f\xda"
b"`4-X"
b"\x02\x01U\x0f"
b"\x01\xcd\t\x04"
b"\x05\x00\x00\x00"
b"\x08\x12\x1f\xda`4-X\x02\x01U\x0f\x01\xcd\t\x04\x05\x00\x00\x00"
),
"0000fe95-0000-1000-8000-00805f9b34fb": bytearray(
b"0X\x83\n" b"\x02\x1f\xda`" b"4-X\x08"
b"0X\x83\n\x02\x1f\xda`4-X\x08"
),
},
},
Expand Down
2 changes: 1 addition & 1 deletion tests/test_tcp_address.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ async def test_tcp_connection_with_forwarding(event_loop):
addr_zero_options = addr_info[0][1]

if "abstract" in addr_zero_options:
path = f'\0{addr_zero_options["abstract"]}'
path = f"\0{addr_zero_options['abstract']}"
else:
path = addr_zero_options["path"]

Expand Down
18 changes: 9 additions & 9 deletions tests/test_validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@ def test_interface_name_validator():
]

for name in valid_names:
assert is_interface_name_valid(
name
), f'interface name should be valid: "{name}"'
assert is_interface_name_valid(name), (
f'interface name should be valid: "{name}"'
)
for name in invalid_names:
assert not is_interface_name_valid(
name
), f'interface name should be invalid: "{name}"'
assert not is_interface_name_valid(name), (
f'interface name should be invalid: "{name}"'
)


def test_member_name_validator():
Expand All @@ -82,6 +82,6 @@ def test_member_name_validator():
for member in valid_members:
assert is_member_name_valid(member), f'member name should be valid: "{member}"'
for member in invalid_members:
assert not is_member_name_valid(
member
), f'member name should be invalid: "{member}"'
assert not is_member_name_valid(member), (
f'member name should be invalid: "{member}"'
)

0 comments on commit 20bc990

Please sign in to comment.