#!/usr/bin/python

import traceback
from os.path import expanduser
from conduit.datatypes.File import ProxyFile

# fails with Access denied
uri = 'http://d134w4tst3t.s3.amazonaws.com:80/a?Signature=aNxGCZQ6s5Wr3WeCIDXvQrivjhA%3D&Expires=1217534131&AWSAccessKeyId=0EYZF4DV8A7WM0H73602'
pf = ProxyFile(uri, None, None, 0)
try:
    pf.transfer(expanduser('~/tmptestfile'))
    print "1: success"
except:
    traceback.print_exc()
    print "1: failure"

uri2 = 'http://www.amazon.com/favicon.ico'
pf2 = ProxyFile(uri2, None, None, 0)
try:
    pf2.transfer(expanduser('~/tmptestfile2'))
    print "2: success"
except:
    traceback.print_exc()
    print "2: failure"
