Skip to content

Instantly share code, notes, and snippets.

@tseaver
Created July 16, 2018 16:02
Show Gist options
  • Save tseaver/8fc69f3c86df400e97d1c80ff8677877 to your computer and use it in GitHub Desktop.
Save tseaver/8fc69f3c86df400e97d1c80ff8677877 to your computer and use it in GitHub Desktop.
# System test for 'Blob.generate_signed_url' w/ non-ASCII blob name.
def test_create_signed_read_url_w_non_ascii_name(self):
blob = self.bucket.blob(u'Caf\xe9.txt')
payload = b'Test signed URL for blob w/ non-ASCII name'
blob.upload_from_string(payload)
self.case_blobs_to_delete.append(blob)
expiration = int(time.time() + 10)
signed_url = blob.generate_signed_url(expiration, method='GET',
client=Config.CLIENT)
response = requests.get(signed_url)
self.assertEqual(response.status_code, 200)
self.assertEqual(response.content, payload)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment