Skip to content
Myr

testing requests with poster and adding headers

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 9fdee25 · Browse files · 1 file+11 added−0 removed
This commit

State

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

Diff stats

1 file+11 added−0 removed

  • other:+11 added−0 removed

1 file+11 added−0 removed

modified:test_requests.py+11 added
82 unmodified lines
8384 post2 = requests.post(bin.url, files={'some': open('test_requests.py')}, data={'some': 'data'})85 self.assertEqual(post2.status_code, 201)868788 def test_POSTBIN_GET_POST_FILES_WITH_HEADERS(self):8990 bin = requests.post('http://www.postbin.org/')91 self.assertEqual(bin.status_code, 200)9293 post2 = requests.post(bin.url, files={'some': open('test_requests.py')},94 headers={'User-Agent': 'requests-tests'})9596 self.assertEqual(post2.status_code, 201)97 98 def test_nonzero_evaluation(self):99 r = requests.get('http://google.com/some-404-url')100 self.assertEqual(bool(r), False)101
20 unmodified lines