def test__get_download_url_on_the_fly_with_generation(self):
    blob_name = 'pretend.txt'
    bucket = mock.Mock(path='/b/fictional', spec=['path'])
    blob = self._make_one(blob_name, bucket=bucket)
    generation = 1493058489532987
    blob._properties['generation'] = str(generation)
    self.assertIsNone(blob.media_link)
    download_url = blob._get_download_url()
    expected_url = 'https://www.googleapis.com/download/storage/v1/b/fictional/o/pretend.txt?alt=media&generation=1493058489532987'
    self.assertEqual(download_url, expected_url)
def test__get_download_url_on_the_fly_with_generation(self):
    blob_name = 'pretend.txt'
    bucket = mock.Mock(path='/b/fictional', spec=['path'])
    blob = self._make_one(blob_name, bucket=bucket)
    generation = 1493058489532987
    blob._properties['generation'] = str(generation)
    self.assertIsNone(blob.media_link)
    download_url = blob._get_download_url()
    expected_url = 'https://www.googleapis.com/download/storage/v1/b/fictional/o/pretend.txt?alt=media&generation=1493058489532987'
    self.assertEqual(download_url, expected_url)