Skip to content
Myr

Add tests to specify when CookieConflicError should be raised. References #3028.

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

authored by Casey Davidson · committed by Casey Davidson · parent 4618423 · Browse files · 1 file+22 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+22 added−0 removed

  • tests:+22 added−0 removed

1 file+22 added−0 removed

modified:tests/test_requests.py+22 added
752 unmodified lines
753 assert items == list(items)754 # make sure one can use items multiple times755 assert list(items) == list(items)756757 def test_cookie_duplicate_names_different_domains(self):758 key = 'some_cookie'759 value = 'some_value'760 domain1 = 'test1.com'761 domain2 = 'test2.com'762763 jar = requests.cookies.RequestsCookieJar()764 jar.set(key, value, domain=domain1)765 jar.set(key, value, domain=domain2)766 assert key in jar767768 def test_cookie_duplicte_names_raises_cookie_conflict_error(self):769 key = 'some_cookie'770 value = 'some_value'771 path = 'some_path'772773 jar = requests.cookies.RequestsCookieJar()774 jar.set(key, value, path=path)775 jar.set(key, value)776 with pytest.raises(requests.cookies.CookieConflictError):777 jar.get(key)778779 def test_time_elapsed_blank(self, httpbin):780 r = requests.get(httpbin('get'))781 td = r.elapsed782 total_seconds = ((td.microseconds + (td.seconds + td.days * 24 * 3600)
694 unmodified lines