mirror of
https://github.com/samsonjs/vdirsyncer.git
synced 2026-04-27 14:57:41 +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 tempfile
|
||||||
import shutil
|
import shutil
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def class_tmpdir(request):
|
def class_tmpdir(request):
|
||||||
request.cls.tmpdir = x = tempfile.mkdtemp()
|
request.cls.tmpdir = x = tempfile.mkdtemp()
|
||||||
|
|
|
||||||
|
|
@ -13,8 +13,6 @@
|
||||||
:license: MIT, see LICENSE for more details.
|
:license: MIT, see LICENSE for more details.
|
||||||
'''
|
'''
|
||||||
|
|
||||||
import tempfile
|
|
||||||
import shutil
|
|
||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
import urlparse
|
import urlparse
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,6 @@
|
||||||
|
|
||||||
from unittest import TestCase
|
from unittest import TestCase
|
||||||
|
|
||||||
from vdirsyncer.storage.base import Item
|
|
||||||
from vdirsyncer.storage.dav.caldav import CaldavStorage
|
from vdirsyncer.storage.dav.caldav import CaldavStorage
|
||||||
from . import DavStorageTests
|
from . import DavStorageTests
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,6 @@
|
||||||
|
|
||||||
from unittest import TestCase
|
from unittest import TestCase
|
||||||
|
|
||||||
from vdirsyncer.storage.base import Item
|
|
||||||
from vdirsyncer.storage.dav.carddav import CarddavStorage
|
from vdirsyncer.storage.dav.carddav import CarddavStorage
|
||||||
from . import DavStorageTests
|
from . import DavStorageTests
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,9 +9,7 @@
|
||||||
'''
|
'''
|
||||||
|
|
||||||
from unittest import TestCase
|
from unittest import TestCase
|
||||||
import tempfile
|
|
||||||
import pytest
|
import pytest
|
||||||
import shutil
|
|
||||||
import os
|
import os
|
||||||
from vdirsyncer.storage.filesystem import FilesystemStorage
|
from vdirsyncer.storage.filesystem import FilesystemStorage
|
||||||
from . import StorageTests
|
from . import StorageTests
|
||||||
|
|
@ -33,7 +31,8 @@ class FilesystemStorageTests(TestCase, StorageTests):
|
||||||
f.write(self._create_bogus_item(i).raw)
|
f.write(self._create_bogus_item(i).raw)
|
||||||
paths.add(p)
|
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
|
assert len(storages) == 4
|
||||||
for s in storages:
|
for s in storages:
|
||||||
assert s.path in paths
|
assert s.path in paths
|
||||||
|
|
|
||||||
|
|
@ -8,12 +8,10 @@
|
||||||
'''
|
'''
|
||||||
|
|
||||||
import mock
|
import mock
|
||||||
import requests
|
|
||||||
from unittest import TestCase
|
from unittest import TestCase
|
||||||
from . import StorageTests
|
|
||||||
from .. import assert_item_equals
|
from .. import assert_item_equals
|
||||||
from textwrap import dedent
|
from textwrap import dedent
|
||||||
from vdirsyncer.storage.http import HttpStorage, Item, split_collection
|
from vdirsyncer.storage.http import HttpStorage, Item
|
||||||
|
|
||||||
|
|
||||||
class HttpStorageTests(TestCase):
|
class HttpStorageTests(TestCase):
|
||||||
|
|
@ -31,7 +29,6 @@ class HttpStorageTests(TestCase):
|
||||||
METHOD:PUBLISH
|
METHOD:PUBLISH
|
||||||
BEGIN:VEVENT
|
BEGIN:VEVENT
|
||||||
UID:461092315540@example.com
|
UID:461092315540@example.com
|
||||||
ORGANIZER;CN="Alice Balder, Example Inc.":MAILTO:alice@example.com
|
|
||||||
LOCATION:Somewhere
|
LOCATION:Somewhere
|
||||||
SUMMARY:Eine Kurzinfo
|
SUMMARY:Eine Kurzinfo
|
||||||
DESCRIPTION:Beschreibung des Termines
|
DESCRIPTION:Beschreibung des Termines
|
||||||
|
|
@ -48,7 +45,7 @@ class HttpStorageTests(TestCase):
|
||||||
BEGIN:VALARM
|
BEGIN:VALARM
|
||||||
ACTION:AUDIO
|
ACTION:AUDIO
|
||||||
TRIGGER:19980403T120000
|
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
|
REPEAT:4
|
||||||
DURATION:PT1H
|
DURATION:PT1H
|
||||||
END:VALARM
|
END:VALARM
|
||||||
|
|
@ -68,7 +65,6 @@ class HttpStorageTests(TestCase):
|
||||||
assert_item_equals(item, Item(dedent(u'''
|
assert_item_equals(item, Item(dedent(u'''
|
||||||
BEGIN:VEVENT
|
BEGIN:VEVENT
|
||||||
UID:461092315540@example.com
|
UID:461092315540@example.com
|
||||||
ORGANIZER;CN="Alice Balder, Example Inc.":MAILTO:alice@example.com
|
|
||||||
LOCATION:Somewhere
|
LOCATION:Somewhere
|
||||||
SUMMARY:Eine Kurzinfo
|
SUMMARY:Eine Kurzinfo
|
||||||
DESCRIPTION:Beschreibung des Termines
|
DESCRIPTION:Beschreibung des Termines
|
||||||
|
|
@ -89,7 +85,7 @@ class HttpStorageTests(TestCase):
|
||||||
BEGIN:VALARM
|
BEGIN:VALARM
|
||||||
ACTION:AUDIO
|
ACTION:AUDIO
|
||||||
TRIGGER:19980403T120000
|
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
|
REPEAT:4
|
||||||
DURATION:PT1H
|
DURATION:PT1H
|
||||||
END:VALARM
|
END:VALARM
|
||||||
|
|
|
||||||
|
|
@ -144,7 +144,8 @@ def _main(env, file_cfg):
|
||||||
actions = []
|
actions = []
|
||||||
for pair_name in pairs:
|
for pair_name in pairs:
|
||||||
try:
|
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:
|
except KeyError:
|
||||||
cli_logger.critical('Pair not found: {}'.format(pair_name))
|
cli_logger.critical('Pair not found: {}'.format(pair_name))
|
||||||
cli_logger.critical('These are the pairs found: ')
|
cli_logger.critical('These are the pairs found: ')
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,8 @@ class FilesystemStorage(Storage):
|
||||||
|
|
||||||
_repr_attributes = ('path',)
|
_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.
|
:param path: Absolute path to a *collection* inside a vdir.
|
||||||
'''
|
'''
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue