From 1cef3bf805d1b106c01aa5c4125797ca39559078 Mon Sep 17 00:00:00 2001 From: evazion Date: Mon, 6 Jul 2020 17:23:53 -0500 Subject: [PATCH] tests: fix artstation download tests. ArtStation is apparently returning images with smaller filesizes for /4k/ images now. It doesn't look like we can get the old images, so just update the tests. --- test/unit/danbooru_http_test.rb | 2 +- test/unit/downloads/art_station_test.rb | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/test/unit/danbooru_http_test.rb b/test/unit/danbooru_http_test.rb index a981bc0ea..4cc54ac29 100644 --- a/test/unit/danbooru_http_test.rb +++ b/test/unit/danbooru_http_test.rb @@ -152,7 +152,7 @@ class DanbooruHttpTest < ActiveSupport::TestCase response = Danbooru::Http.use(:unpolish_cloudflare).get(url) assert_equal(200, response.status) - assert_equal(720_743, response.content_length) + assert_equal(622_594, response.content_length) end end diff --git a/test/unit/downloads/art_station_test.rb b/test/unit/downloads/art_station_test.rb index 83b1710ca..47e4609c6 100644 --- a/test/unit/downloads/art_station_test.rb +++ b/test/unit/downloads/art_station_test.rb @@ -4,26 +4,26 @@ module Downloads class ArtStationTest < ActiveSupport::TestCase context "a download for a (small) artstation image" do should "download the /4k/ image instead" do - assert_downloaded(1_880_910, "https://cdnb3.artstation.com/p/assets/images/images/003/716/071/small/aoi-ogata-hate-city.jpg?1476754974") + assert_downloaded(1_816_438, "https://cdnb3.artstation.com/p/assets/images/images/003/716/071/small/aoi-ogata-hate-city.jpg?1476754974") end end context "for an image where an original does not exist" do should "not try to download the original" do - assert_downloaded(483_192, "https://cdna.artstation.com/p/assets/images/images/004/730/278/large/mendel-oh-dragonll.jpg") + assert_downloaded(452_795, "https://cdna.artstation.com/p/assets/images/images/004/730/278/large/mendel-oh-dragonll.jpg") end end context "a download for an ArtStation image hosted on CloudFlare" do should "return the original file, not the polished file" do @asset = "https://cdnb.artstation.com/p/assets/images/images/003/716/071/large/aoi-ogata-hate-city.jpg?1476754974" - assert_downloaded(1_880_910, @asset) + assert_downloaded(1_816_438, @asset) end end context "a download for a https://$artist.artstation.com/projects/$id page" do should "download the original image instead" do - assert_downloaded(247_350, "https://dantewontdie.artstation.com/projects/YZK5q") + assert_downloaded(210_709, "https://dantewontdie.artstation.com/projects/YZK5q") end end end