From 57ac83d89f88c0103492581a7f58c06aa86717d9 Mon Sep 17 00:00:00 2001 From: Martin Wendt Date: Wed, 16 Oct 2024 19:12:44 +0200 Subject: [PATCH] tox -e format --- tests/test_util.py | 14 ++++++++------ wsgidav/dc/pam_dc.py | 4 +++- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/tests/test_util.py b/tests/test_util.py index 2e56c3b..54e0aa2 100644 --- a/tests/test_util.py +++ b/tests/test_util.py @@ -185,16 +185,18 @@ def testBasics(self): assert get_dict_value(d, "c", as_dict=True) is False assert get_dict_value(d, "x", as_dict=True) == {} self.assertRaises(KeyError, get_dict_value, d, "x", as_dict=False) - + multistatus_el = xml_tools.make_multistatus_el() - add_property_response(multistatus_el, "", [ - ('{custom}name', etree.Element("{custom}name", nsmap={"C": "custom"})) - ]) + add_property_response( + multistatus_el, + "", + [("{custom}name", etree.Element("{custom}name", nsmap={"C": "custom"}))], + ) assert to_str(xml_tools.xml_to_bytes(multistatus_el, pretty=False)) == ( - '\n' + "\n" '' 'HTTP/1.1 200 OK' - '' + "" ) diff --git a/wsgidav/dc/pam_dc.py b/wsgidav/dc/pam_dc.py index 702ad7c..f94eea1 100644 --- a/wsgidav/dc/pam_dc.py +++ b/wsgidav/dc/pam_dc.py @@ -39,7 +39,9 @@ def __init__(self, wsgidav_app, config): self.pam_encoding = dc_conf.get("encoding", "utf-8") self.pam_resetcreds = dc_conf.get("resetcreds", True) self.allow_users = dc_conf.get("allow_users", "all") - if not (self.allow_users in ("all", "current") or isinstance(self.allow_users, list)): + if not ( + self.allow_users in ("all", "current") or isinstance(self.allow_users, list) + ): raise ValueError( f"Invalid 'allow_users' value: {self.allow_users!r}, expected 'all', 'current' or list of allowed users." )