Use singular variable name for the single content
Change-Id: I8541f0b1797f2b525d730a6f816aa3c4850a49ad
This commit is contained in:
@@ -35,11 +35,11 @@ class TestSwift3Object(Swift3FunctionalTestCase):
|
||||
|
||||
def test_object(self):
|
||||
obj = 'object'
|
||||
contents = 'abc123'
|
||||
content = 'abc123'
|
||||
|
||||
# PUT Object
|
||||
status, headers, body = \
|
||||
self.conn.make_request('PUT', self.bucket, obj, body=contents)
|
||||
self.conn.make_request('PUT', self.bucket, obj, body=content)
|
||||
self.assertEquals(status, 200)
|
||||
|
||||
assert_common_response_headers(self, headers)
|
||||
@@ -70,7 +70,7 @@ class TestSwift3Object(Swift3FunctionalTestCase):
|
||||
self.assertTrue(headers['last-modified'] is not None)
|
||||
self.assertTrue(headers['etag'] is not None)
|
||||
self.assertTrue(headers['content-type'] is not None)
|
||||
self.assertEquals(headers['content-length'], str(len(contents)))
|
||||
self.assertEquals(headers['content-length'], str(len(content)))
|
||||
|
||||
# HEAD Object
|
||||
status, headers, body = \
|
||||
@@ -81,7 +81,7 @@ class TestSwift3Object(Swift3FunctionalTestCase):
|
||||
self.assertTrue(headers['last-modified'] is not None)
|
||||
self.assertTrue(headers['etag'] is not None)
|
||||
self.assertTrue(headers['content-type'] is not None)
|
||||
self.assertEquals(headers['content-length'], str(len(contents)))
|
||||
self.assertEquals(headers['content-length'], str(len(content)))
|
||||
|
||||
# DELETE Object
|
||||
status, headers, body = \
|
||||
@@ -196,18 +196,18 @@ class TestSwift3Object(Swift3FunctionalTestCase):
|
||||
|
||||
def test_put_object_content_md5(self):
|
||||
obj = 'object'
|
||||
contents = 'abcdefghij'
|
||||
headers = {'Content-MD5': calculate_md5(contents)}
|
||||
content = 'abcdefghij'
|
||||
headers = {'Content-MD5': calculate_md5(content)}
|
||||
status, headers, body = \
|
||||
self.conn.make_request('PUT', self.bucket, obj, headers, contents)
|
||||
self.conn.make_request('PUT', self.bucket, obj, headers, content)
|
||||
self.assertEquals(status, 200)
|
||||
|
||||
def test_put_object_content_type(self):
|
||||
obj = 'object'
|
||||
contents = 'abcdefghij'
|
||||
content = 'abcdefghij'
|
||||
headers = {'Content-Type': 'text/plain'}
|
||||
status, headers, body = \
|
||||
self.conn.make_request('PUT', self.bucket, obj, headers, contents)
|
||||
self.conn.make_request('PUT', self.bucket, obj, headers, content)
|
||||
self.assertEquals(status, 200)
|
||||
status, headers, body = \
|
||||
self.conn.make_request('HEAD', self.bucket, obj)
|
||||
@@ -215,18 +215,18 @@ class TestSwift3Object(Swift3FunctionalTestCase):
|
||||
|
||||
def test_put_object_expect(self):
|
||||
obj = 'object'
|
||||
contents = 'abcdefghij'
|
||||
content = 'abcdefghij'
|
||||
headers = {'Expect': '100-continue'}
|
||||
status, headers, body = \
|
||||
self.conn.make_request('PUT', self.bucket, obj, headers, contents)
|
||||
self.conn.make_request('PUT', self.bucket, obj, headers, content)
|
||||
self.assertEquals(status, 200)
|
||||
|
||||
def test_put_object_metadata(self):
|
||||
obj = 'object'
|
||||
contents = 'abcdefghij'
|
||||
content = 'abcdefghij'
|
||||
headers = {'X-Amz-Meta-Bar': 'foo', 'X-Amz-Meta-Bar2': 'foo2'}
|
||||
status, headers, body = \
|
||||
self.conn.make_request('PUT', self.bucket, obj, headers, contents)
|
||||
self.conn.make_request('PUT', self.bucket, obj, headers, content)
|
||||
self.assertEquals(status, 200)
|
||||
status, headers, body = \
|
||||
self.conn.make_request('HEAD', self.bucket, obj)
|
||||
@@ -235,10 +235,10 @@ class TestSwift3Object(Swift3FunctionalTestCase):
|
||||
|
||||
def test_put_object_storage_class(self):
|
||||
obj = 'object'
|
||||
contents = 'abcdefghij'
|
||||
content = 'abcdefghij'
|
||||
headers = {'X-Amz-Storage-Class': 'STANDARD'}
|
||||
status, headers, body = \
|
||||
self.conn.make_request('PUT', self.bucket, obj, headers, contents)
|
||||
self.conn.make_request('PUT', self.bucket, obj, headers, content)
|
||||
self.assertEquals(status, 200)
|
||||
|
||||
def test_put_object_copy_source(self):
|
||||
@@ -395,8 +395,8 @@ class TestSwift3Object(Swift3FunctionalTestCase):
|
||||
|
||||
def test_get_object_range(self):
|
||||
obj = 'object'
|
||||
contents = 'abcdefghij'
|
||||
self.conn.make_request('PUT', self.bucket, obj, body=contents)
|
||||
content = 'abcdefghij'
|
||||
self.conn.make_request('PUT', self.bucket, obj, body=content)
|
||||
|
||||
headers = {'Range': 'bytes=1-5'}
|
||||
status, headers, body = \
|
||||
@@ -456,13 +456,13 @@ class TestSwift3Object(Swift3FunctionalTestCase):
|
||||
|
||||
# second line should be byte range information
|
||||
# e.g. Content-Range: bytes 1-2/11
|
||||
expected_range = 'bytes %s/%s' % (range_value, len(contents))
|
||||
expected_range = 'bytes %s/%s' % (range_value, len(content))
|
||||
check_line_header(
|
||||
lines[1].strip(), 'Content-Range', expected_range)
|
||||
# rest
|
||||
rest = [line for line in lines[2:] if line.strip()]
|
||||
self.assertEquals(1, len(rest)) # sanity
|
||||
self.assertTrue(contents[start:end], rest[0])
|
||||
self.assertTrue(content[start:end], rest[0])
|
||||
|
||||
# no next section
|
||||
self.assertFalse(mfile.next()) # sanity
|
||||
@@ -516,8 +516,8 @@ class TestSwift3Object(Swift3FunctionalTestCase):
|
||||
|
||||
def test_head_object_range(self):
|
||||
obj = 'object'
|
||||
contents = 'abcdefghij'
|
||||
self.conn.make_request('PUT', self.bucket, obj, body=contents)
|
||||
content = 'abcdefghij'
|
||||
self.conn.make_request('PUT', self.bucket, obj, body=content)
|
||||
|
||||
headers = {'Range': 'bytes=1-5'}
|
||||
status, headers, body = \
|
||||
|
||||
Reference in New Issue
Block a user