Skip to content
Myr

Fixing tests to verify thrown ValueError's.

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

authored by Stephen Huenneke · committed by Stephen Huenneke · parent 9dd823c · Browse files · 1 file+5 added−4 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+5 added−4 removed

  • other:+5 added−4 removed

1 file+5 added−4 removed

modified:test_requests.py+5 added-4 removed
8 unmodified lines
9import unittest10import pickle1112import requests13import pytest14from requests.auth import HTTPDigestAuth15from requests.adapters import HTTPAdapter16from requests.compat import str, cookielib, getproxies, urljoin17from requests.cookies import cookiejar_from_dict
339 unmodified lines
357 requests.post(url, files=['bad file data'])358 except ValueError:359 pass360361 def test_conflicting_post_params(self):362 url = httpbin('post')363 with open('requirements.txt') as f:361 try:362 requests.post(url, data='[{"some": "data"}]', files={'some': f})363 except ValueError:364 pass364 pytest.raises(ValueError, "requests.post(url, data='[{\"some\": \"data\"}]', files={'some': f})")365 pytest.raises(ValueError, "requests.post(url, data=u'[{\"some\": \"data\"}]', files={'some': f})")366367 def test_request_ok_set(self):368 r = requests.get(httpbin('status', '404'))369 self.assertEqual(r.ok, False)
427 unmodified lines