mirror of
https://github.com/samsonjs/vdirsyncer.git
synced 2026-04-27 14:57:41 +00:00
[tests] directly monkeypatch requests Session
need for later changes
This commit is contained in:
parent
cef25b58da
commit
d5e8be4979
1 changed files with 2 additions and 2 deletions
|
|
@ -41,7 +41,7 @@ def test_list(monkeypatch):
|
||||||
u'\n'.join([u'BEGIN:VCALENDAR'] + items + [u'END:VCALENDAR'])
|
u'\n'.join([u'BEGIN:VCALENDAR'] + items + [u'END:VCALENDAR'])
|
||||||
] * 2
|
] * 2
|
||||||
|
|
||||||
def get(method, url, *a, **kw):
|
def get(self, method, url, *a, **kw):
|
||||||
assert method == 'GET'
|
assert method == 'GET'
|
||||||
assert url == collection_url
|
assert url == collection_url
|
||||||
r = Response()
|
r = Response()
|
||||||
|
|
@ -52,7 +52,7 @@ def test_list(monkeypatch):
|
||||||
r.encoding = 'ISO-8859-1'
|
r.encoding = 'ISO-8859-1'
|
||||||
return r
|
return r
|
||||||
|
|
||||||
monkeypatch.setattr('requests.request', get)
|
monkeypatch.setattr('requests.sessions.Session.request', get)
|
||||||
|
|
||||||
s = HttpStorage(url=collection_url)
|
s = HttpStorage(url=collection_url)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue