Skip to content

Commit

Permalink
Test-code exercising non-base-URLs
Browse files Browse the repository at this point in the history
Two Home Assistant users reported that they were unable to connect to their
caldav servers after upgrading HA.  Both of them got the same error message,
both of them had configured up a non-base-URL in the config.  Feeding DAVClient
with a calendar URL, principal URL or any other caldav URL should work and was
working with earlier versions of caldav, though it appears we have no specific
test code on that.

Now we have test code feeding the DAVClient with a principal URL and a calendar
URL.  Unfortunately, I haven't been able to reproduce the problem yet.

Updates #171
References #169
References home-assistant/core#65941
References home-assistant/core#65588
  • Loading branch information
tobixen committed Feb 11, 2022
1 parent d809eca commit 1de95ce
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/test_caldav.py
Original file line number Diff line number Diff line change
Expand Up @@ -1555,6 +1555,19 @@ def testRecurringDateSearch(self):
assert_equal(len(r), 1)
assert_equal(r[0].data.count("END:VEVENT"), 1)

def testOffsetURL(self):
"""
pass an URL pointing to a calendar or a user to the DAVClient class,
and things should still work
"""
urls = [ self.principal.url, self._fixCalendar().url ]
connect_params = self.server_params.copy()
connect_params.pop('url')
for url in urls:
conn = client(**connect_params, url=url)
principal = conn.principal()
calendars = principal.calendars()

## TODO: run this test, ref https://github.com/python-caldav/caldav/issues/91
## It should be removed prior to a 1.0-release.
def testBackwardCompatibility(self):
Expand Down

0 comments on commit 1de95ce

Please sign in to comment.