"""
These functions are written assuming the under a moto call stack.
TODO add check is a fake bucket?
"""
import boto3


def pre_load_s3_data(bucket_name, prefix, region='us-east-1'):
    s3 = boto3.client('s3', region_name=region)
    res = s3.create_bucket(Bucket=bucket_name)

    default_kwargs = {"Body": b"Fake data for testing.", "Bucket": bucket_name}
    s3.put_object(Key="{}/readme.txt".format(prefix), **default_kwargs)
    s3.put_object(Key="{}/notes.md".format(prefix), **default_kwargs)

    # load items, 3 directories
    for i, _ in enumerate(range(500)):
        res = s3.put_object(Key="{}/images/myimage{i}.tif".format(prefix),
                            **default_kwargs)

    for i, _ in enumerate(range(400)):
        s3.put_object(Key="{}/scripts/myscripts{i}.py".format(prefix),
                      **default_kwargs)

    for i, _ in enumerate(range(110)):
        s3.put_object(
            Key="{}/scripts/subdir/otherscripts{i}.sh".format(prefix),
            **default_kwargs)

@@ -619,17 +619,16 @@
 myimage%7B
-i
 %7D.tif%22.f
@@ -631,32 +631,35 @@
 f%22.format(prefix
+, i
 ),%0A             
@@ -779,17 +779,16 @@
 scripts%7B
-i
 %7D.py%22.fo
@@ -790,32 +790,35 @@
 y%22.format(prefix
+, i
 ),%0A             
@@ -955,17 +955,16 @@
 scripts%7B
-i
 %7D.sh%22.fo
@@ -974,16 +974,19 @@
 t(prefix
+, i
 ),%0A     

Fix kwargs fromat error.