mirror of
https://github.com/samsonjs/vdirsyncer.git
synced 2026-03-25 08:55:50 +00:00
Add a test for HttpStorage.read_only
This commit is contained in:
parent
5028d09f61
commit
fc9ca4177f
1 changed files with 12 additions and 0 deletions
|
|
@ -7,6 +7,8 @@
|
|||
:license: MIT, see LICENSE for more details.
|
||||
'''
|
||||
|
||||
import pytest
|
||||
|
||||
from requests import Response
|
||||
|
||||
from tests import normalize_item
|
||||
|
|
@ -71,3 +73,13 @@ def test_list(monkeypatch):
|
|||
assert item.uid is None
|
||||
assert etag2 == etag
|
||||
assert found_items[normalize_item(item)] == href
|
||||
|
||||
|
||||
def test_readonly_param():
|
||||
url = u'http://example.com/'
|
||||
with pytest.raises(ValueError):
|
||||
HttpStorage(url=url, read_only=False)
|
||||
|
||||
a = HttpStorage(url=url, read_only=True).read_only
|
||||
b = HttpStorage(url=url, read_only=None).read_only
|
||||
assert a is b is True
|
||||
|
|
|
|||
Loading…
Reference in a new issue