Skip to content

Commit ea50321

Browse files
committed
wrapping long lines
1 parent 326035d commit ea50321

2 files changed

Lines changed: 17 additions & 5 deletions

File tree

caldav/collection.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -850,7 +850,10 @@ def search(
850850
## and still, Zimbra seems to deliver too many TODOs in the
851851
## matches2 ... let's do some post-filtering in case the
852852
## server fails in filtering things the right way
853-
if any(x.get('STATUS') not in ('COMPLETED', 'CANCELLED') for x in item.icalendar_instance.subcomponents):
853+
if any(
854+
x.get("STATUS") not in ("COMPLETED", "CANCELLED")
855+
for x in item.icalendar_instance.subcomponents
856+
):
854857
objects.append(item)
855858
else:
856859
if not xml:

tests/test_caldav_unit.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@
225225
</d:multistatus>
226226
"""
227227

228+
228229
def MockedDAVResponse(text, davclient=None):
229230
"""
230231
For unit testing - a mocked DAVResponse with some specific content
@@ -242,9 +243,12 @@ class MockedDAVClient(DAVClient):
242243
For unit testing - a mocked DAVClient returning some specific content every time
243244
a request is performed
244245
"""
246+
245247
def __init__(self, xml_returned):
246248
self.xml_returned = xml_returned
247-
DAVClient.__init__(self, url = "https://somwhere.in.the.universe.example/some/caldav/root")
249+
DAVClient.__init__(
250+
self, url="https://somwhere.in.the.universe.example/some/caldav/root"
251+
)
248252

249253
def request(self, *largs, **kwargs):
250254
return MockedDAVResponse(self.xml_returned)
@@ -349,9 +353,14 @@ def testSearchForRecurringTask(self):
349353
client = MockedDAVClient(recurring_task_response)
350354
calendar = Calendar(client, url="/calendar/issue491/")
351355
mytasks = calendar.search(todo=True, expand=False)
352-
assert(len(mytasks) == 1)
353-
mytasks = calendar.search(todo=True, expand='client', start=datetime(2025,6,6), end=datetime(2011,7,6))
354-
assert(len(mytasks) == 4)
356+
assert len(mytasks) == 1
357+
mytasks = calendar.search(
358+
todo=True,
359+
expand="client",
360+
start=datetime(2025, 6, 6),
361+
end=datetime(2011, 7, 6),
362+
)
363+
assert len(mytasks) == 4
355364

356365
def testLoadByMultiGet404(self):
357366
xml = """

0 commit comments

Comments
 (0)