mirror of
https://github.com/samsonjs/vdirsyncer.git
synced 2026-03-25 08:55:50 +00:00
Flake 8
This commit is contained in:
parent
ef786c3586
commit
bcc3dc560e
8 changed files with 10 additions and 16 deletions
|
|
@ -2,6 +2,7 @@ import pytest
|
|||
import tempfile
|
||||
import shutil
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def class_tmpdir(request):
|
||||
request.cls.tmpdir = x = tempfile.mkdtemp()
|
||||
|
|
|
|||
|
|
@ -13,8 +13,6 @@
|
|||
:license: MIT, see LICENSE for more details.
|
||||
'''
|
||||
|
||||
import tempfile
|
||||
import shutil
|
||||
import sys
|
||||
import os
|
||||
import urlparse
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@
|
|||
|
||||
from unittest import TestCase
|
||||
|
||||
from vdirsyncer.storage.base import Item
|
||||
from vdirsyncer.storage.dav.caldav import CaldavStorage
|
||||
from . import DavStorageTests
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@
|
|||
|
||||
from unittest import TestCase
|
||||
|
||||
from vdirsyncer.storage.base import Item
|
||||
from vdirsyncer.storage.dav.carddav import CarddavStorage
|
||||
from . import DavStorageTests
|
||||
|
||||
|
|
|
|||
|
|
@ -9,9 +9,7 @@
|
|||
'''
|
||||
|
||||
from unittest import TestCase
|
||||
import tempfile
|
||||
import pytest
|
||||
import shutil
|
||||
import os
|
||||
from vdirsyncer.storage.filesystem import FilesystemStorage
|
||||
from . import StorageTests
|
||||
|
|
@ -33,7 +31,8 @@ class FilesystemStorageTests(TestCase, StorageTests):
|
|||
f.write(self._create_bogus_item(i).raw)
|
||||
paths.add(p)
|
||||
|
||||
storages = list(FilesystemStorage.discover(path=self.tmpdir, fileext='.txt'))
|
||||
storages = list(FilesystemStorage.discover(path=self.tmpdir,
|
||||
fileext='.txt'))
|
||||
assert len(storages) == 4
|
||||
for s in storages:
|
||||
assert s.path in paths
|
||||
|
|
|
|||
|
|
@ -8,12 +8,10 @@
|
|||
'''
|
||||
|
||||
import mock
|
||||
import requests
|
||||
from unittest import TestCase
|
||||
from . import StorageTests
|
||||
from .. import assert_item_equals
|
||||
from textwrap import dedent
|
||||
from vdirsyncer.storage.http import HttpStorage, Item, split_collection
|
||||
from vdirsyncer.storage.http import HttpStorage, Item
|
||||
|
||||
|
||||
class HttpStorageTests(TestCase):
|
||||
|
|
@ -31,7 +29,6 @@ class HttpStorageTests(TestCase):
|
|||
METHOD:PUBLISH
|
||||
BEGIN:VEVENT
|
||||
UID:461092315540@example.com
|
||||
ORGANIZER;CN="Alice Balder, Example Inc.":MAILTO:alice@example.com
|
||||
LOCATION:Somewhere
|
||||
SUMMARY:Eine Kurzinfo
|
||||
DESCRIPTION:Beschreibung des Termines
|
||||
|
|
@ -48,7 +45,7 @@ class HttpStorageTests(TestCase):
|
|||
BEGIN:VALARM
|
||||
ACTION:AUDIO
|
||||
TRIGGER:19980403T120000
|
||||
ATTACH;FMTTYPE=audio/basic:http://host.com/pub/audio-files/ssbanner.aud
|
||||
ATTACH;FMTTYPE=audio/basic:http://host.com/pub/ssbanner.aud
|
||||
REPEAT:4
|
||||
DURATION:PT1H
|
||||
END:VALARM
|
||||
|
|
@ -68,7 +65,6 @@ class HttpStorageTests(TestCase):
|
|||
assert_item_equals(item, Item(dedent(u'''
|
||||
BEGIN:VEVENT
|
||||
UID:461092315540@example.com
|
||||
ORGANIZER;CN="Alice Balder, Example Inc.":MAILTO:alice@example.com
|
||||
LOCATION:Somewhere
|
||||
SUMMARY:Eine Kurzinfo
|
||||
DESCRIPTION:Beschreibung des Termines
|
||||
|
|
@ -89,7 +85,7 @@ class HttpStorageTests(TestCase):
|
|||
BEGIN:VALARM
|
||||
ACTION:AUDIO
|
||||
TRIGGER:19980403T120000
|
||||
ATTACH;FMTTYPE=audio/basic:http://host.com/pub/audio-files/ssbanner.aud
|
||||
ATTACH;FMTTYPE=audio/basic:http://host.com/pub/ssbanner.aud
|
||||
REPEAT:4
|
||||
DURATION:PT1H
|
||||
END:VALARM
|
||||
|
|
|
|||
|
|
@ -144,7 +144,8 @@ def _main(env, file_cfg):
|
|||
actions = []
|
||||
for pair_name in pairs:
|
||||
try:
|
||||
a_name, b_name, pair_options, storage_defaults = all_pairs[pair_name]
|
||||
a_name, b_name, pair_options, storage_defaults = \
|
||||
all_pairs[pair_name]
|
||||
except KeyError:
|
||||
cli_logger.critical('Pair not found: {}'.format(pair_name))
|
||||
cli_logger.critical('These are the pairs found: ')
|
||||
|
|
|
|||
|
|
@ -21,7 +21,8 @@ class FilesystemStorage(Storage):
|
|||
|
||||
_repr_attributes = ('path',)
|
||||
|
||||
def __init__(self, path, fileext, collection=None, encoding='utf-8', **kwargs):
|
||||
def __init__(self, path, fileext, collection=None, encoding='utf-8',
|
||||
**kwargs):
|
||||
'''
|
||||
:param path: Absolute path to a *collection* inside a vdir.
|
||||
'''
|
||||
|
|
|
|||
Loading…
Reference in a new issue