Skip to content
Myr

Merge branch 'develop' of git://github.com/kennethreitz/requests into develop

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

authored by Zbigniew Siciarz · committed by Zbigniew Siciarz · parents 24e2a05, 1749260 · Browse files · 2 files+14 added−9 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+14 added−9 removed

  • other:+14 added−9 removed

2 files+14 added−9 removed

modified:AUTHORS+3 added-1 removed
18 unmodified lines
19- Aram Dulyan20- Johannes Gorset21- 村山めがね (Megane Murayama)22- James Rowe23- Daniel Schauenberg23- Daniel Schauenberg24- Zbigniew Siciarz25- Daniele Tricoli 'Eriol'
modified:test_requests.py+11 added-8 removed
24 unmodified lines
25 self.assertRaises(ValueError, requests.get, 'hiwpefhipowhefopw')262728 def test_HTTP_200_OK_GET(self):29 r = requests.get('http://google.com')29 r = requests.get('http://httpbin.org/')30 self.assertEqual(r.status_code, 200)313233 def test_HTTPS_200_OK_GET(self):34 r = requests.get('https://google.com')34 r = requests.get('https://github.com/')35 self.assertEqual(r.status_code, 200)363738 def test_HTTP_200_OK_GET_WITH_PARAMS(self):39 heads = {'User-agent': 'Mozilla/5.0'}4041 r = requests.get('http://www.google.com/search', params={'q': 'test'}, headers=heads)41 r = requests.get('http://httpbin.org/user-agent', headers=heads)4243 assert heads['User-agent'] in r.content44 self.assertEqual(r.status_code, 200)454647 def test_HTTP_200_OK_GET_WITH_MIXED_PARAMS(self):48 heads = {'User-agent': 'Mozilla/5.0'}4948 r = requests.get('http://google.com/search?test=true', params={'q': 'test'}, headers=heads)50 r = requests.get('http://httpbin.org/get?test=true', params={'q': 'test'}, headers=heads)51 self.assertEqual(r.status_code, 200)525354 def test_user_agent_transfers(self):55 """Issue XX"""5657 heads = {58 'User-agent':59 'Mozilla/5.0 (github.com/kennethreitz/requests)'60 }6159 r = requests.get('http://whatsmyua.com', headers=heads);62 r = requests.get('http://httpbin.org/user-agent', headers=heads);63 self.assertTrue(heads['User-agent'] in r.content)6465 heads = {66 'user-agent':67 'Mozilla/5.0 (github.com/kennethreitz/requests)'68 }6967 r = requests.get('http://whatsmyua.com', headers=heads);70 r = requests.get('http://httpbin.org/user-agent', headers=heads);71 self.assertTrue(heads['user-agent'] in r.content)727374 def test_HTTP_200_OK_HEAD(self):72 r = requests.head('http://google.com')75 r = requests.head('http://httpbin.org')76 self.assertEqual(r.status_code, 200)777879 def test_HTTPS_200_OK_HEAD(self):77 r = requests.head('https://google.com')80 r = requests.head('https://github.com')81 self.assertEqual(r.status_code, 200)828384 def test_AUTH_HTTPS_200_OK_GET(self):
132 unmodified lines