File tree Expand file tree Collapse file tree 1 file changed +16
-16
lines changed Expand file tree Collapse file tree 1 file changed +16
-16
lines changed Original file line number Diff line number Diff line change 99from zeep .tornado import TornadoAsyncTransport
1010
1111
12+ @pytest .mark .requests
13+ @patch ('tornado.httpclient.HTTPClient.fetch' )
14+ def test_tornado_load (mock_httpclient_fetch ):
15+ cache = stub (get = lambda url : None , add = lambda url , content : None )
16+ response = HTTPResponse (HTTPRequest ('http://tests.python-zeep.org/test.xml' ), 200 )
17+ response .buffer = True
18+ response ._body = 'x'
19+ mock_httpclient_fetch .return_value = response
20+
21+ transport = TornadoAsyncTransport (cache = cache )
22+
23+ result = transport .load ('http://tests.python-zeep.org/test.xml' )
24+
25+ assert result == 'x'
26+
27+
1228class TornadoAsyncTransportTest (AsyncTestCase ):
1329 @pytest .mark .requests
1430 def test_no_cache (self ):
1531 transport = TornadoAsyncTransport ()
1632 assert transport .cache is None
1733
18- @pytest .mark .requests
19- @patch ('tornado.httpclient.HTTPClient.fetch' )
20- @gen_test
21- def test_load (self , mock_httpclient_fetch ):
22- cache = stub (get = lambda url : None , add = lambda url , content : None )
23- response = HTTPResponse (HTTPRequest ('http://tests.python-zeep.org/test.xml' ), 200 )
24- response .buffer = True
25- response ._body = 'x'
26- mock_httpclient_fetch .return_value = response
27-
28- transport = TornadoAsyncTransport (cache = cache )
29-
30- result = transport .load ('http://tests.python-zeep.org/test.xml' )
31-
32- assert result == 'x'
33-
3434 @pytest .mark .requests
3535 @patch ('tornado.httpclient.AsyncHTTPClient.fetch' )
3636 @gen_test
You can’t perform that action at this time.
0 commit comments