From fc9ca4177fc8bd5ef64d228f230effdab47f2d9a Mon Sep 17 00:00:00 2001 From: Markus Unterwaditzer Date: Thu, 12 Jun 2014 14:31:32 +0200 Subject: [PATCH] Add a test for HttpStorage.read_only --- tests/storage/test_http.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/storage/test_http.py b/tests/storage/test_http.py index fdc1369..845258b 100644 --- a/tests/storage/test_http.py +++ b/tests/storage/test_http.py @@ -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