sources: replace HTTParty with Danbooru::Http in http_exists?.

This commit is contained in:
evazion
2020-06-21 13:10:16 -05:00
parent 3ad8c708c5
commit 7e471fe223
5 changed files with 8 additions and 24 deletions

View File

@@ -16,19 +16,4 @@ module DownloadTestHelper
def assert_not_rewritten(source, referer = nil)
assert_rewritten(source, source, referer)
end
def assert_http_exists(url, headers: {})
res = HTTParty.head(url, Danbooru.config.httparty_options.deep_merge(headers: headers))
assert_equal(true, res.success?)
end
def assert_http_status(code, url, headers: {})
res = HTTParty.head(url, Danbooru.config.httparty_options.deep_merge(headers: headers))
assert_equal(code, res.code)
end
def assert_http_size(size, url, headers: {})
res = HTTParty.head(url, Danbooru.config.httparty_options.deep_merge(headers: headers))
assert_equal(size, res.content_length)
end
end