Exemplo n.º 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()
Exemplo n.º 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()
Exemplo n.º 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'
Exemplo n.º 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'
Exemplo n.º 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'
Exemplo n.º 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'
Exemplo n.º 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'
Exemplo n.º 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'