Browse files

Rename builder methods in gs tests for nose compatibility

Nose was matching these methods, thinking that they were tests.
Rather than rename the regex, it's more of an isolated change
to just rename the two affected methods.
  • Loading branch information...
1 parent 276d0eb commit f561558d62cdc1ef7c3e1bf3fbfb077767aa634a @jamesls jamesls committed Jun 18, 2012
Showing with 11 additions and 11 deletions.
  1. +4 −4 tests/integration/s3/test_resumable_downloads.py
  2. +7 −7 tests/integration/s3/test_resumable_uploads.py
View
8 tests/integration/s3/test_resumable_downloads.py
@@ -73,7 +73,7 @@ def resilient_close(key):
except StorageResponseError, e:
pass
- def build_test_input_object(self, obj_name, size):
+ def build_input_object(self, obj_name, size):
buf = []
for i in range(size):
buf.append(str(random.randint(0, 9)))
@@ -97,13 +97,13 @@ def setUp(self):
# Create test source objects.
self.empty_src_key_size = 0
(self.empty_src_key_as_string, self.empty_src_key) = (
- self.build_test_input_object('empty', self.empty_src_key_size))
+ self.build_input_object('empty', self.empty_src_key_size))
self.small_src_key_size = 2 * 1024 # 2 KB.
(self.small_src_key_as_string, self.small_src_key) = (
- self.build_test_input_object('small', self.small_src_key_size))
+ self.build_input_object('small', self.small_src_key_size))
self.larger_src_key_size = 500 * 1024 # 500 KB.
(self.larger_src_key_as_string, self.larger_src_key) = (
- self.build_test_input_object('larger', self.larger_src_key_size))
+ self.build_input_object('larger', self.larger_src_key_size))
# Use a designated tmpdir prefix to make it easy to find the end of
# the tmp path.
View
14 tests/integration/s3/test_resumable_uploads.py
@@ -66,7 +66,7 @@ class ResumableUploadTests(unittest.TestCase):
def get_suite_description(self):
return 'Resumable upload test suite'
- def build_test_input_file(self, size):
+ def build_input_file(self, size):
buf = []
# I manually construct the random data here instead of calling
# os.urandom() because I want to constrain the range of data (in
@@ -110,16 +110,16 @@ def setUp(self):
# Create test source file data.
self.empty_src_file_size = 0
(self.empty_src_file_as_string, self.empty_src_file) = (
- self.build_test_input_file(self.empty_src_file_size))
+ self.build_input_file(self.empty_src_file_size))
self.small_src_file_size = 2 * 1024 # 2 KB.
(self.small_src_file_as_string, self.small_src_file) = (
- self.build_test_input_file(self.small_src_file_size))
+ self.build_input_file(self.small_src_file_size))
self.larger_src_file_size = 500 * 1024 # 500 KB.
(self.larger_src_file_as_string, self.larger_src_file) = (
- self.build_test_input_file(self.larger_src_file_size))
+ self.build_input_file(self.larger_src_file_size))
self.largest_src_file_size = 1024 * 1024 # 1 MB.
(self.largest_src_file_as_string, self.largest_src_file) = (
- self.build_test_input_file(self.largest_src_file_size))
+ self.build_input_file(self.largest_src_file_size))
# Create temp dir.
self.tmp_dir = tempfile.mkdtemp(prefix=self.tmpdir_prefix)
@@ -458,7 +458,7 @@ def test_upload_with_file_size_change_during_upload(self):
"""
# Create a file we can change during the upload.
test_file_size = 500 * 1024 # 500 KB.
- test_file = self.build_test_input_file(test_file_size)[1]
+ test_file = self.build_input_file(test_file_size)[1]
harnass = CallbackTestHarnass(fp_to_change=test_file,
fp_change_pos=test_file_size)
res_upload_handler = ResumableUploadHandler(num_retries=1)
@@ -478,7 +478,7 @@ def test_upload_with_file_content_change_during_upload(self):
(so, size stays the same) while upload in progress
"""
test_file_size = 500 * 1024 # 500 KB.
- test_file = self.build_test_input_file(test_file_size)[1]
+ test_file = self.build_input_file(test_file_size)[1]
harnass = CallbackTestHarnass(fail_after_n_bytes=test_file_size/2,
fp_to_change=test_file,
# Write to byte 1, as the CallbackTestHarnass writes

0 comments on commit f561558

Please sign in to comment.