[DRE-commits] [ruby-fastimage] 02/03: Add patch:Drop some tests which need network connectivity

Youhei SASAKI uwabami-guest at moszumanska.debian.org
Mon Nov 3 07:01:07 UTC 2014


This is an automated email from the git hooks/post-receive script.

uwabami-guest pushed a commit to branch master
in repository ruby-fastimage.

commit 162d9e89086c205c263661435cbe43f4c621540f
Author: Youhei SASAKI <uwabami at gfd-dennou.org>
Date:   Mon Nov 3 15:59:48 2014 +0900

    Add patch:Drop some tests which need network connectivity
    
    Signed-off-by: Youhei SASAKI <uwabami at gfd-dennou.org>
---
 ...ome-tests-which-need-network-connectivity.patch | 61 ++++++++++++++++++++++
 debian/patches/series                              |  1 +
 2 files changed, 62 insertions(+)

diff --git a/debian/patches/0002-Drop-some-tests-which-need-network-connectivity.patch b/debian/patches/0002-Drop-some-tests-which-need-network-connectivity.patch
new file mode 100644
index 0000000..769b860
--- /dev/null
+++ b/debian/patches/0002-Drop-some-tests-which-need-network-connectivity.patch
@@ -0,0 +1,61 @@
+From: Youhei SASAKI <uwabami at gfd-dennou.org>
+Date: Mon, 3 Nov 2014 15:58:36 +0900
+Subject: Drop some tests which need network connectivity
+
+Signed-off-by: Youhei SASAKI <uwabami at gfd-dennou.org>
+---
+ test/test.rb | 27 +++------------------------
+ 1 file changed, 3 insertions(+), 24 deletions(-)
+
+diff --git a/test/test.rb b/test/test.rb
+index 1a429b3..771d2ce 100644
+--- a/test/test.rb
++++ b/test/test.rb
+@@ -34,12 +34,9 @@ TestUrl = "http://example.nowhere/"
+ 
+ # this image fetch allows me to really test that fastimage is truly fast
+ # but it's not ideal relying on external resources and connectivity speed
+-LargeImage = "http://upload.wikimedia.org/wikipedia/commons/b/b4/Mardin_1350660_1350692_33_images.jpg"
+-LargeImageInfo = [:jpeg, [9545, 6623]]
+-LargeImageFetchLimit = 2  # seconds
+-
+-HTTPSImage = "https://upload.wikimedia.org/wikipedia/commons/b/b4/Mardin_1350660_1350692_33_images.jpg"
+-HTTPSImageInfo = [:jpeg, [9545, 6623]]
++# LargeImage = "http://upload.wikimedia.org/wikipedia/commons/b/b4/Mardin_1350660_1350692_33_images.jpg"
++# LargeImageInfo = [:jpeg, [9545, 6623]]
++# LargeImageFetchLimit = 2  # seconds
+ 
+ GoodFixtures.each do |fn, info|
+   FakeWeb.register_uri(:get, "#{TestUrl}#{fn}", :body => File.join(FixturePath, fn))
+@@ -203,19 +200,6 @@ class FastImageTest < Test::Unit::TestCase
+     FakeWeb.register_uri(:get, from, :response=>resp)
+   end
+ 
+-  def test_should_fetch_info_of_large_image_faster_than_downloading_the_whole_thing
+-    time = Time.now
+-    size = FastImage.size(LargeImage)
+-    size_time = Time.now
+-    assert size_time - time < LargeImageFetchLimit
+-    assert_equal LargeImageInfo[1], size
+-    time = Time.now
+-    type = FastImage.type(LargeImage)
+-    type_time = Time.now
+-    assert type_time - time < LargeImageFetchLimit
+-    assert_equal LargeImageInfo[0], type
+-  end
+-
+   # This test doesn't actually test the proxy function, but at least
+   # it excercises the code. You could put anything in the http_proxy and it would still pass.
+   # Any ideas on how to actually test this?
+@@ -228,11 +212,6 @@ class FastImageTest < Test::Unit::TestCase
+     assert_equal actual_size, size
+   end
+ 
+-  def test_should_handle_https_image
+-    size = FastImage.size(HTTPSImage)
+-    assert_equal HTTPSImageInfo[1], size
+-  end
+-  
+   require 'pathname'
+   def test_should_handle_pathname
+     # bad.jpg does not have the size info in the first 256 bytes
diff --git a/debian/patches/series b/debian/patches/series
index ab3a91c..8f4d7c2 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
 0001-Drop-RubyGems-Depends.patch
+0002-Drop-some-tests-which-need-network-connectivity.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-fastimage.git



More information about the Pkg-ruby-extras-commits mailing list