tests: don't cache pixiv sessions.

This commit is contained in:
evazion
2020-06-11 00:47:12 -05:00
parent 7ba786010d
commit 2d05004bef
3 changed files with 0 additions and 37 deletions

View File

@@ -35,22 +35,6 @@ module TestHelpers
def as_user(&block)
CurrentUser.as(@user, &block)
end
def load_pixiv_tokens!
if ENV["DANBOORU_PERSIST_PIXIV_SESSION"] && Cache.get("pixiv-papi-access-token")
Cache.put("pixiv-papi-access-token", Thread.current[:pixiv_papi_access_token])
Cache.put(PixivWebAgent::SESSION_CACHE_KEY, Thread.current[:pixiv_session_cache_key])
Cache.put(PixivWebAgent::COMIC_SESSION_CACHE_KEY, Thread.current[:pixiv_comic_session_cache_key])
end
end
def save_pixiv_tokens!
if ENV["DANBOORU_PERSIST_PIXIV_SESSION"]
Thread.current[:pixiv_papi_access_token] = Cache.get("pixiv-papi-access-token")
Thread.current[:pixiv_session_cache_key] = Cache.get(PixivWebAgent::SESSION_CACHE_KEY)
Thread.current[:pixiv_comic_session_cache_key] = Cache.get(PixivWebAgent::COMIC_SESSION_CACHE_KEY)
end
end
end
class ActiveSupport::TestCase

View File

@@ -2,17 +2,6 @@ require 'test_helper'
module Downloads
class PixivTest < ActiveSupport::TestCase
def setup
super
Downloads::File.stubs(:is_cloudflare?).returns(false)
load_pixiv_tokens!
end
def teardown
save_pixiv_tokens!
super
end
context "in all cases" do
# Test a new illustration (one uploaded after 2014-09-30). New illustrations
# must use /img-original/ for full size URLs. Old /imgXX/img/username/ style URLs

View File

@@ -21,16 +21,6 @@ module Sources
skip "Remote connection to #{source} failed"
end
def setup
super
load_pixiv_tokens!
end
def teardown
save_pixiv_tokens!
super
end
context "in all cases" do
context "A gallery page" do
setup do