From d4a2521eec0746d56483595b86277ff8bed11284 Mon Sep 17 00:00:00 2001 From: Albert Yi Date: Wed, 9 May 2018 14:59:18 -0700 Subject: [PATCH] reset connection for pixiv tests --- test/unit/downloads/pixiv_test.rb | 7 +++++++ test/unit/sources/pixiv_test.rb | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/test/unit/downloads/pixiv_test.rb b/test/unit/downloads/pixiv_test.rb index 54f4161ff..2c2b15c86 100644 --- a/test/unit/downloads/pixiv_test.rb +++ b/test/unit/downloads/pixiv_test.rb @@ -2,6 +2,13 @@ require 'test_helper' module Downloads class PixivTest < ActiveSupport::TestCase + def teardown + super + + # need to reset the connection + Sources::Strategies::Pixiv.new.agent.shutdown + end + context "An ugoira site for pixiv" do setup do @download = Downloads::File.new("http://www.pixiv.net/member_illust.php?mode=medium&illust_id=62247364") diff --git a/test/unit/sources/pixiv_test.rb b/test/unit/sources/pixiv_test.rb index 0aa3e3553..531beb05c 100644 --- a/test/unit/sources/pixiv_test.rb +++ b/test/unit/sources/pixiv_test.rb @@ -1,11 +1,12 @@ require 'test_helper' -require 'resolv-replace' module Sources class PixivTest < ActiveSupport::TestCase def get_source(source) @site = Sources::Site.new(source) @site.get + + # need to reset the connection @site.strategy.agent.shutdown @site end