From 62340814fa3b4ca01e036bfe59c9b1954aa16bb5 Mon Sep 17 00:00:00 2001 From: Markus Unterwaditzer Date: Sun, 8 Jun 2014 00:28:39 +0200 Subject: [PATCH] Fix bug in repr of davstorage --- tests/storage/__init__.py | 4 ++++ vdirsyncer/storage/dav.py | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/tests/storage/__init__.py b/tests/storage/__init__.py index cbc5c1f..20803d0 100644 --- a/tests/storage/__init__.py +++ b/tests/storage/__init__.py @@ -178,3 +178,7 @@ class StorageTests(object): (href, etag) for href, item, etag in s.get_multi(href for href, etag in iteritems(info)) ) == info + + def test_repr(self): + s = self._get_storage() + assert self.storage_class.__name__ in repr(s) diff --git a/vdirsyncer/storage/dav.py b/vdirsyncer/storage/dav.py index 7ed2c97..9d776c7 100644 --- a/vdirsyncer/storage/dav.py +++ b/vdirsyncer/storage/dav.py @@ -264,6 +264,10 @@ class DavStorage(Storage): useragent, dav_header=self.dav_header) self.collection = collection + # defined for _repr_attributes + self.username = username + self.url = url + @classmethod def discover(cls, url, **kwargs): if kwargs.pop('collection', None) is not None: