예제 #1
0
def test_parse_cookie(
    name,
    value,
    expires,
    domain,
    path,
    http_only,
    secure,
    max_age,
    same_site,
    expected_result,
):
    cookie = parse_cookie(expected_result)
    assert cookie is not None
    assert cookie.name == name
    assert cookie.value == value
    if expires:
        assert cookie.expires is not None
        assert cookie.expires == expires
    assert cookie.domain == domain
    assert cookie.path == path
    assert cookie.http_only == http_only
    assert cookie.secure == secure
    if max_age is not None:
        assert cookie.max_age == max_age
예제 #2
0
def test_parse_cookie_separators(value, expected_name, expected_value, expected_path):
    cookie = parse_cookie(value)

    assert cookie is not None
    assert cookie.name == expected_name
    assert cookie.value == expected_value
    assert cookie.path == expected_path