Ejemplo n.º 1
0
def remote_md5_fail_test():
    # ensure original text
    with open(TEST_FILE, 'w') as test_file:
        test_file.write("data")
    radu = RadulaProxy(connection=boto.connect_s3())
    radu.make_bucket(subject=TEST_BUCKET)
    sys.stdout.truncate(0)

    # 'threads' needed
    args = vars(_parse_args(["remote-md5", "-t", "2"]))
    args.update({
        "subject": os.path.join(TEST_BUCKET, 'test_file_not_found__intentional')
    })
    radu.remote_md5(**args)
Ejemplo n.º 2
0
def remote_md5_test():
    # ensure original text
    with open(TEST_FILE, 'w') as test_file:
        test_file.write("data")
    radu = RadulaProxy(connection=boto.connect_s3())
    radu.make_bucket(subject=TEST_BUCKET)

    # give something to download
    args = vars(_parse_args(['up']))
    args.update({"subject": TEST_FILE, "target": REMOTE_FILE})
    radu.upload(**args)
    sys.stdout.truncate(0)

    # 'threads' needed
    args = vars(_parse_args(["remote-md5", "-t", "2"]))
    args.update({"subject": REMOTE_FILE})
    radu.remote_md5(**args)
    out = sys.stdout.getvalue().strip()
    assert_equal('8d777f385d3dfec8815d20f7496026dc', out)
Ejemplo n.º 3
0
def remote_md5_test():
    # ensure original text
    with open(TEST_FILE, 'w') as test_file:
        test_file.write("data")
    radu = RadulaProxy(connection=boto.connect_s3())
    radu.make_bucket(subject=TEST_BUCKET)

    # give something to download
    args = vars(_parse_args(['up']))
    args.update({
        "subject": TEST_FILE,
        "target": REMOTE_FILE
    })
    radu.upload(**args)
    sys.stdout.truncate(0)

    # 'threads' needed
    args = vars(_parse_args(["remote-md5", "-t", "2"]))
    args.update({
        "subject": REMOTE_FILE
    })
    radu.remote_md5(**args)
    out = sys.stdout.getvalue().strip()
    assert_equal('8d777f385d3dfec8815d20f7496026dc', out)
Ejemplo n.º 4
0
def remote_md5_nosubject_test():
    radu = RadulaProxy(connection=boto.connect_s3())
    args = vars(_parse_args(["remote-md5"]))
    radu.remote_md5(**args)