mirror of
https://github.com/samsonjs/vdirsyncer.git
synced 2026-04-27 14:57:41 +00:00
Flake8
This commit is contained in:
parent
d41d974608
commit
cef68b5d09
5 changed files with 8 additions and 4 deletions
|
|
@ -43,6 +43,7 @@ create table property (
|
||||||
|
|
||||||
storage_backend = os.environ.get('RADICALE_BACKEND', '') or 'filesystem'
|
storage_backend = os.environ.get('RADICALE_BACKEND', '') or 'filesystem'
|
||||||
|
|
||||||
|
|
||||||
def do_the_radicale_dance(tmpdir):
|
def do_the_radicale_dance(tmpdir):
|
||||||
# All of radicale is already global state, the cleanliness of the code and
|
# All of radicale is already global state, the cleanliness of the code and
|
||||||
# all hope is already lost. This function runs before every test.
|
# all hope is already lost. This function runs before every test.
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@ import requests.exceptions
|
||||||
|
|
||||||
dav_server = os.environ.get('DAV_SERVER', '').strip() or 'radicale'
|
dav_server = os.environ.get('DAV_SERVER', '').strip() or 'radicale'
|
||||||
|
|
||||||
|
|
||||||
def _get_server_mixin(server_name):
|
def _get_server_mixin(server_name):
|
||||||
from . import __name__ as base
|
from . import __name__ as base
|
||||||
x = __import__('{}.servers.{}'.format(base, server_name), fromlist=[''])
|
x = __import__('{}.servers.{}'.format(base, server_name), fromlist=[''])
|
||||||
|
|
@ -102,7 +103,6 @@ class DavStorageTests(ServerMixin, StorageTests):
|
||||||
super(DavStorageTests, self).test_update_nonexisting()
|
super(DavStorageTests, self).test_update_nonexisting()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class TestCaldavStorage(DavStorageTests):
|
class TestCaldavStorage(DavStorageTests):
|
||||||
storage_class = CaldavStorage
|
storage_class = CaldavStorage
|
||||||
|
|
||||||
|
|
@ -240,7 +240,7 @@ class TestCaldavStorage(DavStorageTests):
|
||||||
monkeypatch.setattr('requests.sessions.Session.request', request)
|
monkeypatch.setattr('requests.sessions.Session.request', request)
|
||||||
|
|
||||||
with pytest.raises(vdirsyncer.exceptions.StorageError):
|
with pytest.raises(vdirsyncer.exceptions.StorageError):
|
||||||
s = self.storage_class(**args)
|
self.storage_class(**args)
|
||||||
assert len(calls) == 1
|
assert len(calls) == 1
|
||||||
|
|
||||||
def test_empty_get_multi_performance(self, monkeypatch):
|
def test_empty_get_multi_performance(self, monkeypatch):
|
||||||
|
|
@ -253,6 +253,7 @@ class TestCaldavStorage(DavStorageTests):
|
||||||
|
|
||||||
assert list(s.get_multi([])) == []
|
assert list(s.get_multi([])) == []
|
||||||
|
|
||||||
|
|
||||||
class TestCarddavStorage(DavStorageTests):
|
class TestCarddavStorage(DavStorageTests):
|
||||||
storage_class = CarddavStorage
|
storage_class = CarddavStorage
|
||||||
item_template = VCARD_TEMPLATE
|
item_template = VCARD_TEMPLATE
|
||||||
|
|
|
||||||
|
|
@ -167,6 +167,7 @@ def test_conflict_resolution_new_etags_without_changes():
|
||||||
sync(a, b, status)
|
sync(a, b, status)
|
||||||
assert status == {'1': (href_a, etag_a, href_b, etag_b)}
|
assert status == {'1': (href_a, etag_a, href_b, etag_b)}
|
||||||
|
|
||||||
|
|
||||||
def test_uses_get_multi(monkeypatch):
|
def test_uses_get_multi(monkeypatch):
|
||||||
def breakdown(*a, **kw):
|
def breakdown(*a, **kw):
|
||||||
raise AssertionError('Expected use of get_multi')
|
raise AssertionError('Expected use of get_multi')
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@
|
||||||
|
|
||||||
from .. import exceptions
|
from .. import exceptions
|
||||||
|
|
||||||
|
|
||||||
class Item(object):
|
class Item(object):
|
||||||
|
|
||||||
'''should-be-immutable wrapper class for VCALENDAR and VCARD'''
|
'''should-be-immutable wrapper class for VCALENDAR and VCARD'''
|
||||||
|
|
|
||||||
|
|
@ -335,7 +335,7 @@ class CaldavStorage(DavStorage):
|
||||||
end = end.strftime(CALDAV_DT_FORMAT)
|
end = end.strftime(CALDAV_DT_FORMAT)
|
||||||
|
|
||||||
timefilter = ('<C:time-range start="{start}" end="{end}"/>'
|
timefilter = ('<C:time-range start="{start}" end="{end}"/>'
|
||||||
.format(start=start, end=end))
|
.format(start=start, end=end))
|
||||||
else:
|
else:
|
||||||
timefilter = ''
|
timefilter = ''
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue