Esempio n. 1
0
def test_loose_cookies_types(loop: Any) -> None:
    req = ClientRequest("get", URL("http://python.org"), loop=loop)
    morsel = Morsel()
    morsel.set(key="string", val="Another string", coded_val="really")

    accepted_types = [
        [("str", BaseCookie())],
        [("str", morsel)],
        [
            ("str", "str"),
        ],
        {
            "str": BaseCookie()
        },
        {
            "str": morsel
        },
        {
            "str": "str"
        },
        SimpleCookie(),
    ]

    for loose_cookies_type in accepted_types:
        req.update_cookies(cookies=loose_cookies_type)
Esempio n. 2
0
def test_loose_cookies_types(loop) -> None:
    req = ClientRequest('get', URL('http://python.org'), loop=loop)
    morsel = Morsel()
    morsel.set(key='string', val='Another string', coded_val='really')

    accepted_types = [
        [('str', BaseCookie())],
        [('str', morsel)],
        [('str', 'str'), ],
        {'str': BaseCookie()},
        {'str': morsel},
        {'str': 'str'},
        SimpleCookie(),
    ]

    for loose_cookies_type in accepted_types:
        req.update_cookies(cookies=loose_cookies_type)