Пример #1
0
def s3_command(argv=None, aws_config=None):
    from acli.commands import s3 as command_s3
    s3_res = docopt(command_s3.__doc__, argv=argv)
    if any((s3_res.get('ls'), s3_res.get('list'))):
        path = s3_res.get('<item>')
        if path and not '/' == path[-1:]:
            path += '/'
        s3.s3_list(aws_config, item=path)
    elif s3_res.get('info'):
        s3.s3_info(aws_config, item=s3_res.get('<item>'))
    elif s3_res.get('cp'):
        s3.s3_cp(aws_config, source=s3_res.get('<source>'), dest=s3_res.get('<dest>'))
    elif any((s3_res.get('rm'), s3_res.get('del'))):
        s3.s3_rm(aws_config, item=s3_res.get('<item>'))
Пример #2
0
def test_s3_list_service(s3_bucket):
    with pytest.raises(SystemExit):
        assert s3_list(aws_config=config)