def test_cookie_jar_init(config_stub, fake_save_manager):
 line_parser_stub = [COOKIE1, COOKIE2]
 jar = cookies.CookieJar(line_parser=line_parser_stub)
 assert fake_save_manager.add_saveable.called
 assert (len(jar.allCookies()) == 2)
 raw_cookies = [c.toRawForm().data() for c in jar.allCookies()]
 assert (raw_cookies == [COOKIE1, COOKIE2])

def test_cookie_jar_init ( config_stub , fake_save_manager ) : line_parser_stub = [ COOKIE1 , COOKIE2 ] jar = cookies . CookieJar ( line_parser = line_parser_stub ) assert fake_save_manager . add_saveable . called assert ( len ( jar . allCookies ( ) ) == 2 ) raw_cookies = [ c . toRawForm ( ) . data ( ) for c in jar . allCookies ( ) ] assert ( raw_cookies == [ COOKIE1 , COOKIE2 ] )
test the cookiejar constructor .