Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Commit

Permalink
Rename builder methods in gs tests for nose compatibility
Browse files Browse the repository at this point in the history
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
James Saryerwinnie committed Jun 18, 2012
1 parent 276d0eb commit f561558
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions tests/integration/s3/test_resumable_downloads.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def resilient_close(key):
except StorageResponseError, e: except StorageResponseError, e:
pass pass


def build_test_input_object(self, obj_name, size): def build_input_object(self, obj_name, size):
buf = [] buf = []
for i in range(size): for i in range(size):
buf.append(str(random.randint(0, 9))) buf.append(str(random.randint(0, 9)))
Expand All @@ -97,13 +97,13 @@ def setUp(self):
# Create test source objects. # Create test source objects.
self.empty_src_key_size = 0 self.empty_src_key_size = 0
(self.empty_src_key_as_string, self.empty_src_key) = ( (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_size = 2 * 1024 # 2 KB.
(self.small_src_key_as_string, self.small_src_key) = ( (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_size = 500 * 1024 # 500 KB.
(self.larger_src_key_as_string, self.larger_src_key) = ( (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 # Use a designated tmpdir prefix to make it easy to find the end of
# the tmp path. # the tmp path.
Expand Down
14 changes: 7 additions & 7 deletions tests/integration/s3/test_resumable_uploads.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class ResumableUploadTests(unittest.TestCase):
def get_suite_description(self): def get_suite_description(self):
return 'Resumable upload test suite' return 'Resumable upload test suite'


def build_test_input_file(self, size): def build_input_file(self, size):
buf = [] buf = []
# I manually construct the random data here instead of calling # I manually construct the random data here instead of calling
# os.urandom() because I want to constrain the range of data (in # os.urandom() because I want to constrain the range of data (in
Expand Down Expand Up @@ -110,16 +110,16 @@ def setUp(self):
# Create test source file data. # Create test source file data.
self.empty_src_file_size = 0 self.empty_src_file_size = 0
(self.empty_src_file_as_string, self.empty_src_file) = ( (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_size = 2 * 1024 # 2 KB.
(self.small_src_file_as_string, self.small_src_file) = ( (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_size = 500 * 1024 # 500 KB.
(self.larger_src_file_as_string, self.larger_src_file) = ( (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_size = 1024 * 1024 # 1 MB.
(self.largest_src_file_as_string, self.largest_src_file) = ( (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. # Create temp dir.
self.tmp_dir = tempfile.mkdtemp(prefix=self.tmpdir_prefix) self.tmp_dir = tempfile.mkdtemp(prefix=self.tmpdir_prefix)
Expand Down Expand Up @@ -458,7 +458,7 @@ def test_upload_with_file_size_change_during_upload(self):
""" """
# Create a file we can change during the upload. # Create a file we can change during the upload.
test_file_size = 500 * 1024 # 500 KB. 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, harnass = CallbackTestHarnass(fp_to_change=test_file,
fp_change_pos=test_file_size) fp_change_pos=test_file_size)
res_upload_handler = ResumableUploadHandler(num_retries=1) res_upload_handler = ResumableUploadHandler(num_retries=1)
Expand All @@ -478,7 +478,7 @@ def test_upload_with_file_content_change_during_upload(self):
(so, size stays the same) while upload in progress (so, size stays the same) while upload in progress
""" """
test_file_size = 500 * 1024 # 500 KB. 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, harnass = CallbackTestHarnass(fail_after_n_bytes=test_file_size/2,
fp_to_change=test_file, fp_to_change=test_file,
# Write to byte 1, as the CallbackTestHarnass writes # Write to byte 1, as the CallbackTestHarnass writes
Expand Down

0 comments on commit f561558

Please sign in to comment.