From ad888729e789f1d5827c16d0da3e27890cb05792 Mon Sep 17 00:00:00 2001 From: Artem Bityutskiy Date: Mon, 17 Dec 2012 17:07:13 +0200 Subject: [PATCH] test_api_base: test urllib2 as well Prepend "file:" to file names sometimes to make all the I/O go through urllib2. Change-Id: I0ed499f33edb7b7c2ec43a69bec4ed781716a8b3 Signed-off-by: Artem Bityutskiy --- tests/test_api_base.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/test_api_base.py b/tests/test_api_base.py index 106cb26..c0f8df7 100644 --- a/tests/test_api_base.py +++ b/tests/test_api_base.py @@ -221,6 +221,11 @@ def _do_test(f_image, image_size, delete = True): # Test without setting the size _copy_image(compressed, f_copy, f_bmap1, image_sha1, None) + # Append a "file:" prefixe to make BmapCopy use urllib + compressed = "file:" + compressed + _copy_image(compressed, f_copy, f_bmap1, image_sha1, image_size) + _copy_image(compressed, f_copy, f_bmap1, image_sha1, None) + # # Pass 5: copy without bmap and make sure it is identical to the original # file. @@ -238,6 +243,10 @@ def _do_test(f_image, image_size, delete = True): # Test without setting the size _copy_image(compressed, f_copy, f_bmap1, image_sha1, None) + # Append a "file:" prefixe to make BmapCopy use urllib + _copy_image(compressed, f_copy, f_bmap1, image_sha1, image_size) + _copy_image(compressed, f_copy, f_bmap1, image_sha1, None) + # Close temporary files, which will also remove them f_copy.close() f_bmap1.close() -- 2.7.4