Verify that cookie can be properly accessed if domain is specified, and that error is raised otherwise. Refs #3028.

This commit is contained in:
Casey Davidson
2016-03-05 20:37:56 -08:00
parent c53a685e7d
commit f74a6707af
+8
View File
@@ -767,6 +767,14 @@ class TestRequests:
items = jar.items()
assert len(items) == 2
# Verify that CookieConflictError is raised if domain is not specified
with pytest.raises(requests.cookies.CookieConflictError):
jar.get(key)
# Verify that CookieConflictError is not raised if domain is specified
cookie = jar.get(key, domain=domain1)
assert cookie == value
def test_cookie_duplicate_names_raises_cookie_conflict_error(self):
key = 'some_cookie'
value = 'some_value'