This commit is contained in:
Markus Unterwaditzer 2014-04-11 15:49:15 +02:00
parent 70b446e673
commit 65e6397806
9 changed files with 12 additions and 11 deletions

View file

@ -9,7 +9,7 @@
from vdirsyncer.storage.base import Item
import vdirsyncer.exceptions as exceptions
from .. import assert_item_equals, normalize_item
from .. import assert_item_equals
import random
import pytest

View file

@ -15,7 +15,6 @@
import sys
import os
import urlparse
import shutil
import pytest
from werkzeug.test import Client
@ -75,8 +74,8 @@ def do_the_radicale_dance(tmpdir):
radicale.config.set('rights', 'type', 'owner_only')
radicale.config.set('auth', 'type', 'http')
import radicale.auth.http
def is_authenticated(user, password):
assert user == 'bob' and password == 'bob'
return True
@ -121,7 +120,6 @@ class ServerMixin(object):
r.status_code = wr.status_code
return r
monkeypatch.setattr('requests.adapters.HTTPAdapter.send', send)
def get_storage_args(self, collection='test'):

View file

@ -44,6 +44,7 @@ class TestFilesystemStorage(StorageTests):
def test_broken_data(self, tmpdir):
s = self.storage_class(str(tmpdir), '.txt')
class BrokenItem(object):
raw = b'Ц, Ш, Л, ж, Д, З, Ю'
uid = 'jeezus'

View file

@ -7,9 +7,8 @@
:license: MIT, see LICENSE for more details.
'''
from .. import assert_item_equals
from textwrap import dedent
from vdirsyncer.storage.http import HttpStorage, Item
from vdirsyncer.storage.http import HttpStorage
from requests import Response

View file

@ -9,7 +9,7 @@
from textwrap import dedent
import vdirsyncer.cli as cli
import vdirsyncer.exceptions as exceptions
def test_load_config(tmpdir, monkeypatch):
f = tmpdir.join('test.cfg')
@ -54,6 +54,7 @@ def test_load_config(tmpdir, monkeypatch):
assert errors[0].startswith('Unknown section')
assert 'bogus' in errors[0]
def test_storage_instance_from_config(monkeypatch):
def lol(**kw):
assert kw == {'foo': 'bar', 'baz': 1}

View file

@ -35,6 +35,9 @@ def test_parse_options():
assert a == expected
for key in a:
# Yes, we want a very strong typecheck here, because we actually have
# to differentiate between bool and int, and in Python 2, bool is a
# subclass of int.
assert type(a[key]) is type(expected[key])

View file

@ -35,8 +35,8 @@ class Storage(object):
- HREF: String; Per-storage identifier of item, might be UID. The reason
items aren't just referenced by their UID is because the CalDAV and
CardDAV specifications make this imperformant to implement.
- ETAG: String; Checksum of item, or something similar that changes when the
item does.
- ETAG: String; Checksum of item, or something similar that changes when
the item does.
Strings can be either unicode strings or bytestrings. If bytestrings, an
ASCII encoding is assumed.

View file

@ -11,7 +11,7 @@ from .base import Storage, Item
from .http import prepare_auth, prepare_verify, USERAGENT
from .. import exceptions
from .. import log
from ..utils import request
from ..utils import request, get_password
import requests
import datetime
import urlparse

View file

@ -8,7 +8,6 @@
:license: MIT, see LICENSE for more details.
'''
import requests
import urlparse
import hashlib
from .base import Storage, Item