Skip to content

Commit

Permalink
tox -e format
Browse files Browse the repository at this point in the history
  • Loading branch information
mar10 committed Oct 16, 2024
1 parent 37b8ece commit 57ac83d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
14 changes: 8 additions & 6 deletions tests/test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)) == (
'<?xml version=\'1.0\' encoding=\'UTF-8\'?>\n'
"<?xml version='1.0' encoding='UTF-8'?>\n"
'<D:multistatus xmlns:D="DAV:"><D:response>'
'<D:href></D:href><D:propstat><D:prop><C:name xmlns:C="custom"/></D:prop><D:status>HTTP/1.1 200 OK</D:status></D:propstat>'
'</D:response></D:multistatus>'
"</D:response></D:multistatus>"
)


Expand Down
4 changes: 3 additions & 1 deletion wsgidav/dc/pam_dc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."
)
Expand Down

0 comments on commit 57ac83d

Please sign in to comment.