Skip to content

Commit 24b6f19

Browse files
committed
more asserts
1 parent 0b730e9 commit 24b6f19

3 files changed

Lines changed: 8 additions & 1 deletion

File tree

caldav/compatibility_hints.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,10 @@ def _dotted_feature_set_list(self, feature_path, feature_node):
224224
ret.update(self._dotted_feature_set_list(full, subnode))
225225
return ret
226226

227+
def __eq__(self, other):
228+
## TODO: this won't work, but it's a start
229+
return self.dotted_feature_set_list() == other.dotted_feature_set_list()
230+
227231
#### OLD STYLE
228232

229233
## The lists below are specifying what tests should be skipped or

caldav/davclient.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
from caldav.collection import Calendar
2727
from caldav.collection import CalendarSet
2828
from caldav.collection import Principal
29+
from caldav.compatibility_hints import FeatureSet
2930
from caldav.elements import cdav
3031
from caldav.elements import dav
3132
from caldav.lib import error
@@ -458,6 +459,7 @@ def __init__(
458459
ssl_cert: Union[str, Tuple[str, str], None] = None,
459460
headers: Mapping[str, str] = None,
460461
huge_tree: bool = False,
462+
features: FeatureSet = None
461463
) -> None:
462464
"""
463465
Sets up a HTTPConnection object towards the server in the url.
@@ -491,6 +493,7 @@ def __init__(
491493
log.debug("url: " + str(url))
492494
self.url = URL.objectify(url)
493495
self.huge_tree = huge_tree
496+
self.features = features
494497
# Prepare proxy info
495498
if proxy is not None:
496499
_proxy = proxy

tests/test_caldav.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -846,12 +846,12 @@ def _fixCalendar(self, **kwargs):
846846
ret.objects = lambda load_objects: ret.events()
847847
if self.cleanup_regime == "post":
848848
self.calendars_used.append(ret)
849-
850849
return ret
851850

852851
def testCheckCompatibility(self):
853852
checker = ServerQuirkChecker(self.caldav)
854853
checker.check_all()
854+
assert(checker.features_checked == self.caldav.feature_set)
855855

856856
def testSupport(self):
857857
"""

0 commit comments

Comments
 (0)