Example #1
0
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'
Example #2
0
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'
Example #3
0
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")
Example #4
0
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)
Example #5
0
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)
Example #6
0
File: try.py Project: DuHo3aBp/paws
from paws.s3 import download

download(bucket='gdelt-open-data',\
    key='events/1979.csv',filename='1979.csv')