Skip to content
Myr

binary data upload bug test

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Kenneth Reitz · committed by Kenneth Reitz · parent ab4c03a · Browse files · 2 files+12 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+12 added−2 removed

  • other:+12 added−2 removed

2 files+12 added−2 removed

modified:test_requests_ext.py+7 added
20 unmodified lines
2122 def test_addition(self):23 assert (1 + 1) == 2242526 def test_ssl_hostname_ok(self):27 requests.get('https://github.com', verify=True)282930 def test_ssl_hostname_not_ok(self):31 requests.get('https://kennethreitz.com', verify=False)3233 self.assertRaises(requests.exceptions.SSLError, requests.get, 'https://kennethreitz.com')343536 def test_ssl_hostname_session_not_ok(self):3738 s = requests.session()39
1 unmodified line
4142 s.get('https://kennethreitz.com', verify=False)434445 def test_binary_post(self):46 utf8_string = (u'Smörgås').encode('utf-8')47 requests.post('http://www.google.com/', data=utf8_string)484950if __name__ == '__main__':51 unittest.main()52
modified:test_requests.py+5 added-2 removed
63 unmodified lines
64 requests.put65 requests.patch66 requests.post67686968 def test_invalid_url(self):69 self.assertRaises(ValueError, get, 'hiwpefhipowhefopw')7071
726 unmodified lines
798 config=dict(safe_mode=True))799 assert r.content is None800 assert isinstance(r.error, requests.exceptions.Timeout)801802 def test_upload_binary_data(self):803804 r = requests.get(httpbin('post'), auth=('a', 'b'), data='\xff')805806807808if __name__ == '__main__':809 unittest.main()