Skip to content
Myr

Modifying tests to include header name info

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

authored by mgasvoda · committed by GitHub · parent e36083b · Browse files · 1 file+6 added−3 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+6 added−3 removed

  • tests:+6 added−3 removed

1 file+6 added−3 removed

modified:tests/test_requests.py+6 added-3 removed
1399 unmodified lines
1400 headers_dict = {'bar': {'foo': 'bar'}}1401 headers_list = {'baz': ['foo', 'bar']}14021403 # Test for int1404 with pytest.raises(InvalidHeader):1404 with pytest.raises(InvalidHeader) as excinfo:1405 r = requests.get(httpbin('get'), headers=headers_int)1406 assert 'foo' in str(excinfo.value)1407 # Test for dict1407 with pytest.raises(InvalidHeader):1408 with pytest.raises(InvalidHeader) as excinfo:1409 r = requests.get(httpbin('get'), headers=headers_dict)1410 assert 'bar' in str(excinfo.value)1411 # Test for list1410 with pytest.raises(InvalidHeader):1412 with pytest.raises(InvalidHeader) as excinfo:1413 r = requests.get(httpbin('get'), headers=headers_list)1414 assert 'baz' in str(excinfo.value)14151416 def test_header_no_return_chars(self, httpbin):1417 """Ensure that a header containing return character sequences raise an1418 exception. Otherwise, multiple headers are created from single string.
971 unmodified lines