[CI] Format code with Black

This commit is contained in:
yunohost-bot 2021-12-29 00:44:22 +00:00
parent 2f38639a2e
commit 94bf107838
4 changed files with 8 additions and 10 deletions

View file

@ -42,7 +42,9 @@ class BaseSystemDiagnoser(Diagnoser):
elif os.path.exists("/sys/devices/virtual/dmi/id/sys_vendor"):
model = read_file("/sys/devices/virtual/dmi/id/sys_vendor").strip()
if os.path.exists("/sys/devices/virtual/dmi/id/product_name"):
product_name = read_file("/sys/devices/virtual/dmi/id/product_name").strip()
product_name = read_file(
"/sys/devices/virtual/dmi/id/product_name"
).strip()
model = f"{model} {product_name}"
hardware["data"]["model"] = model
hardware["details"] = ["diagnosis_basesystem_hardware_model"]

View file

@ -262,9 +262,7 @@ def dyndns_update(
else:
return None
raise YunohostError(
f"Failed to resolve {rdtype} for {domain}", raw_msg=True
)
raise YunohostError(f"Failed to resolve {rdtype} for {domain}", raw_msg=True)
old_ipv4 = resolve_domain(domain, "A")
old_ipv6 = resolve_domain(domain, "AAAA")

View file

@ -666,9 +666,9 @@ def permission_sync_to_user():
# These are the users that should be allowed because they are member of a group that is allowed for this permission ...
should_be_allowed_users = {
user
for group in permission_infos["allowed"]
for user in groups[group]["members"]
user
for group in permission_infos["allowed"]
for user in groups[group]["members"]
}
# Note that a LDAP operation with the same value that is in LDAP crash SLAP.

View file

@ -1013,9 +1013,7 @@ def test_permission_app_install():
assert res["permissions_app.dev"]["url"] == "/dev"
assert res["permissions_app.main"]["allowed"] == ["all_users"]
assert set(res["permissions_app.main"]["corresponding_users"]) == {
"alice", "bob"
}
assert set(res["permissions_app.main"]["corresponding_users"]) == {"alice", "bob"}
assert res["permissions_app.admin"]["allowed"] == ["alice"]
assert res["permissions_app.admin"]["corresponding_users"] == ["alice"]