

def testGenerateUploadUrl(self):
    'Test GenerateUploadUrl method on S3 object store.'
    content = 'hello world'
    hasher = hashlib.md5()
    hasher.update(content)
    md5 = base64.b64encode(hasher.digest())
    upload_url = self.object_store.GenerateUploadUrl(self.key, content_type='text/plain', content_md5=md5, expires_in=100, max_bytes=1024)
    headers = {
        'Content-Type': 'text/plain',
        'Content-MD5': md5,
    }
    self.assertRaises(httpclient.HTTPError, httpclient.HTTPClient().fetch, upload_url, method='PUT', headers=headers, body=(content + '-'))
    response = httpclient.HTTPClient().fetch(upload_url, method='PUT', headers=headers, body=content)
    self.assertEqual(response.code, 200)
    value = self._RunAsync(self.object_store.Get, self.key)
    self.assertEqual(hasher, content)

dataset/ETHPy150Open viewfinderco/viewfinder/backend/storage/test/s3_object_store_test.py S3ObjectStoreTestCase.testGenerateUploadUrl/VarMisuse@181/257 `value`->`hasher`