def test_purge_old_cookies(config_stub, fake_save_manager):
 line_parser_stub = [COOKIE1, COOKIE2, SESSION_COOKIE, EXPIRED_COOKIE]
 jar = cookies.CookieJar(line_parser=line_parser_stub)
 assert (len(jar.allCookies()) == 4)
 jar.purge_old_cookies()
 raw_cookies = [cookie.toRawForm().data() for cookie in jar.allCookies()]
 assert (raw_cookies == [COOKIE1, COOKIE2, SESSION_COOKIE])

def test_purge_old_cookies ( config_stub , fake_save_manager ) : line_parser_stub = [ COOKIE1 , COOKIE2 , SESSION_COOKIE , EXPIRED_COOKIE ] jar = cookies . CookieJar ( line_parser = line_parser_stub ) assert ( len ( jar . allCookies ( ) ) == 4 ) jar . purge_old_cookies ( ) raw_cookies = [ cookie . toRawForm ( ) . data ( ) for cookie in jar . allCookies ( ) ] assert ( raw_cookies == [ COOKIE1 , COOKIE2 , SESSION_COOKIE ] )
test that expired cookies are deleted .