def test_download(mock_boto): """Тестирование функции скачивания из хранилища S3""" resource = mock_boto res = download(resource=resource, bucket='gdelt-open-data', key='events/1979.csv', filename='1979.csv') assert res == '1979.csv'
def test_download(mock_boto): """Test s3 download function""" resource = mock_boto res = download(resource=resource, bucket='gdelt-open-data', key='events/1979.csv', filename='1979.csv') assert res == '1979.csv'
def test_download(mock_boto): """Test s3 download function""" resource = mock_boto res = download(resource=resource, bucket="gdelt-open-data", key="events/1979.csv", filename="1979.csv") assert res == "1979.csv" import os os.unlink("1979.csv")
def download(bucket, key, filename): """Downloads an S3 file ./paws-cli.py download --bucket gdelt-open-data --key events/1979.csv --filename 1979.csv """ if not bucket and not key and not filename: click.echo("--bucket and --key and --filename are required") sys.exit(1) click.echo("Downloading s3 file with: bucket-{bucket},key{key},filename{filename}".\ format(bucket=bucket, key=key, filename=filename)) res = s3.download(bucket, key, filename) click.echo(res)
def download(bucket, key, filename): """Downloads an S3 file ./pcli.py --bucket gedlt-open-data --key events/1979.csv --filename 1979.csv """ click.echo( "Downloading s3 file with bucket: {}, key {}, filename {}".format( bucket, key, filename)) res = s3.download(bucket, key, filename) click.echo(res)
from paws.s3 import download download(bucket='gdelt-open-data',\ key='events/1979.csv',filename='1979.csv')