Пример #1
0
 def test_request_with_body_buffer(self):
     x = AsyncHTTPSConnection('aws.vandelay.com')
     body = Mock(name='body')
     body.read.return_value = 'Vandelay Industries'
     x.request('PUT', '/importer-exporter', body)
     assert x.method == 'PUT'
     assert x.path == '/importer-exporter'
     assert x.body == 'Vandelay Industries'
     body.read.assert_called_with()
Пример #2
0
 def test_request_with_body_buffer(self):
     x = AsyncHTTPSConnection('aws.vandelay.com')
     body = Mock(name='body')
     body.read.return_value = 'Vandelay Industries'
     x.request('PUT', '/importer-exporter', body)
     assert x.method == 'PUT'
     assert x.path == '/importer-exporter'
     assert x.body == 'Vandelay Industries'
     body.read.assert_called_with()
Пример #3
0
 def test_request_with_headers(self):
     x = AsyncHTTPSConnection()
     headers = {'Proxy': 'proxy.vandelay.com'}
     x.request('PUT', '/importer-exporter', None, headers)
     assert 'Proxy' in dict(x.headers)
     assert dict(x.headers)['Proxy'] == 'proxy.vandelay.com'
Пример #4
0
 def test_request_with_body_text(self):
     x = AsyncHTTPSConnection('aws.vandelay.com')
     x.request('PUT', '/importer-exporter', 'Vandelay Industries')
     assert x.method == 'PUT'
     assert x.path == '/importer-exporter'
     assert x.body == 'Vandelay Industries'
Пример #5
0
 def test_request(self):
     x = AsyncHTTPSConnection('aws.vandelay.com')
     x.request('PUT', '/importer-exporter')
     assert x.path == '/importer-exporter'
     assert x.method == 'PUT'
Пример #6
0
 def test_request_with_headers(self):
     x = AsyncHTTPSConnection()
     headers = {'Proxy': 'proxy.vandelay.com'}
     x.request('PUT', '/importer-exporter', None, headers)
     assert 'Proxy' in dict(x.headers)
     assert dict(x.headers)['Proxy'] == 'proxy.vandelay.com'
Пример #7
0
 def test_request_with_body_text(self):
     x = AsyncHTTPSConnection('aws.vandelay.com')
     x.request('PUT', '/importer-exporter', 'Vandelay Industries')
     assert x.method == 'PUT'
     assert x.path == '/importer-exporter'
     assert x.body == 'Vandelay Industries'
Пример #8
0
 def test_request(self):
     x = AsyncHTTPSConnection('aws.vandelay.com')
     x.request('PUT', '/importer-exporter')
     assert x.path == '/importer-exporter'
     assert x.method == 'PUT'