def test_cookiejar_ignores_cookie_domain_set_as_ipaddress():
    jar = CookieJar()

    assert (jar.get_domain(
        URL(b"https://foo.org/hello-world"),
        Cookie(b"foo", b"foo", domain=b"192.168.1.5"),
    ) == b"foo.org")
Example #2
0
def test_cookiejar_get_domain(request_url, cookie_domain, expected_domain):
    jar = CookieJar()
    cookie = Cookie(b'Name', b'Value', domain=cookie_domain)
    domain = jar.get_domain(request_url, cookie)
    assert domain == expected_domain