@pytest.mark.parametrize('cookiejar', (compat.cookielib.CookieJar(), RequestsCookieJar()))
def test_add_dict_to_cookiejar(cookiejar):
 cookiedict = {'test': 'cookies', 'good': 'cookies'}
 cj = add_dict_to_cookiejar(cookiejar, cookiedict)
 cookies = dict(((cookie.name, cookie.value) for cookie in cj))
 assert (cookiedict == cookies)

@ pytest . mark . parametrize ( 'cookiejar' , ( compat . cookielib . CookieJar ( ) , RequestsCookieJar ( ) ) ) def test_add_dict_to_cookiejar ( cookiejar ) : cookiedict = { 'test' : 'cookies' , 'good' : 'cookies' } cj = add_dict_to_cookiejar ( cookiejar , cookiedict ) cookies = dict ( ( ( cookie . name , cookie . value ) for cookie in cj ) ) assert ( cookiedict == cookies )
ensure add_dict_to_cookiejar works for non-requestscookiejar cookiejars .