Skip to content
Myr

Merge pull request #3627 from nateprewitt/remove_update_call

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

remove RequestsCookieJar specific update call

authored by Cory Benfield · committed by GitHub · parents 9deb603, 390a499 · Browse files · 2 files+18 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

2 files+18 added−4 removed

  • tests:+17 added−1 removed
  • other:+1 added−3 removed

2 files+18 added−4 removed

modified:requests/utils.py+1 added-3 removed
329 unmodified lines
330 :param cookie_dict: Dict of key/values to insert into CookieJar.331 :rtype: CookieJar332 """333334 cj2 = cookiejar_from_dict(cookie_dict)335 cj.update(cj2)336 return cj334 return cookiejar_from_dict(cookie_dict, cj)335336337def get_encodings_from_content(content):338 """Returns encodings from given content string.
473 unmodified lines
modified:tests/test_utils.py+17 added-1 removed
2 unmodified lines
3from io import BytesIO45import pytest6from requests import compat7from requests.cookies import RequestsCookieJar, cookiejar_from_dict8from requests.structures import CaseInsensitiveDict9from requests.utils import (10 address_in_network, dotted_netmask,11 get_auth_from_url, get_encoding_from_headers,
3 unmodified lines
15 parse_header_links, prepend_scheme_if_needed,16 requote_uri, select_proxy, should_bypass_proxies, super_len,17 to_key_val_list, to_native_string,18 unquote_header_value, unquote_unreserved,18 urldefragauth)19 urldefragauth, add_dict_to_cookiejar)2021from .compat import StringIO, cStringIO2223
489 unmodified lines
513 """514 monkeypatch.setenv('no_proxy', '192.168.0.0/24,127.0.0.1,localhost.localdomain,172.16.1.1')515 monkeypatch.setenv('NO_PROXY', '192.168.0.0/24,127.0.0.1,localhost.localdomain,172.16.1.1')516 assert should_bypass_proxies(url) == expected517518@pytest.mark.parametrize(519 'cookiejar', (520 compat.cookielib.CookieJar(),521 RequestsCookieJar()522 ))523def test_add_dict_to_cookiejar(cookiejar):524 """Ensure add_dict_to_cookiejar works for525 non-RequestsCookieJar CookieJars526 """527 cookiedict = {'test': 'cookies',528 'good': 'cookies'}529 cj = add_dict_to_cookiejar(cookiejar, cookiedict)530 cookies = dict((cookie.name, cookie.value) for cookie in cj)531 assert cookiedict == cookies